首页 \ 问答 \ 使用由WorkMail事件调用的AWS Lambda调用外部Web Api REST端点(Call an external Web Api REST endpoint using AWS Lambda invoked by a WorkMail event)

使用由WorkMail事件调用的AWS Lambda调用外部Web Api REST端点(Call an external Web Api REST endpoint using AWS Lambda invoked by a WorkMail event)

我们正在使用许多AWS服务,并希望实施WorkMail来管理电子邮件帐户并调用各种Web Api端点。 我的高级要求如下。 这可能吗?

  1. 创建电子邮件地址(用户帐户)*完成

  2. 收到电子邮件地址(或别名)的电子邮件时,将带有附件的电子邮件复制到与该用户帐户/电子邮件地址关联的S3 Bucket文件夹(将通过外部休息端点检索S3文件夹名称)ex : https://54.166 /api/accounts/getS3Folder/test@test.com

  3. 触发Lambda操作,该操作调用将处理已保存电子邮件的外部Web Api REST端点


We are using a number of AWS services and would like to implement WorkMail to manage email accounts and invoke various Web Api endpoints. My high-level requirements are below. Is this possible?

  1. Create email addresses (user accounts) * Done

  2. When email is received for an email address (or alias), copy the email, with attachments, to a S3 Bucket folder that is associated with that user account / email address (the S3 folder name will be retrieved via an external rest endpoint) ex: https://54.166../api/accounts/getS3Folder/test@test.com

  3. Trigger a Lambda action that calls an external Web Api REST endpoint that will process the saved email message


原文:https://stackoverflow.com/questions/41808530
更新时间:2021-10-30 13:10

最满意答案

这取决于您的角度是指定顺时针还是逆时针方向的旋转。 如果您正朝着坦克炮塔的方向看,如果您需要顺时针旋转炮塔以尽快指向它,则在右侧有一个物体,如果您需要逆时针旋转,则在左侧。

显然,你可以在相反的方向旋转以“走很远”:如果一个物体向右10度,那么你可以顺时针旋转10度或逆时针旋转350度指向它。 但是,假设沿顺时针方向指定角度,我们只考虑短路:

// returns 1 if otherAngle is to the right of sourceAngle,
//         0 if the angles are identical
//         -1 if otherAngle is to the left of sourceAngle
int compareAngles(float sourceAngle, float otherAngle)
{
    // sourceAngle and otherAngle should be in the range -180 to 180
    float difference = otherAngle - sourceAngle;

    if(difference < -180.0f)
        difference += 360.0f;
    if(difference > 180.0f)
        difference -= 360.0f;

    if(difference > 0.0f)
        return 1;
    if(difference < 0.0f)
        return -1;

    return 0;
}

减去角度后,结果可以在-360(-180减180)到360(180减-180)的范围内。 您可以通过加或减360度将它们带到-180到180的范围内,然后比较为零并返回结果。

绝对值在180和360之间的角度对应于“长途”旋转,并且加或减360将它们转换为“短路”。 例如顺时针-350度,长距离(即逆时针350度)加360等于顺时针方向10度。

如果以逆时针方向指定角度,则返回值的含义相反(1表示左,-1表示右)


It depends on whether your angles specify a rotation in the clockwise or anti-clockwise direction. If you are looking in the direction of the tank turret, then an object is on the right if you need to rotate the turret clockwise to point at it as quickly as possible, and on the left if you need to rotate anti-clockwise.

Obviously, you can rotate in the opposite direction to go "the long way around": if an object is 10 degrees to the right then you can either rotate 10 degrees clockwise or 350 degrees anti-clockwise to point at it. But let's consider only the short way around, assuming that angles are specified in a clockwise direction:

// returns 1 if otherAngle is to the right of sourceAngle,
//         0 if the angles are identical
//         -1 if otherAngle is to the left of sourceAngle
int compareAngles(float sourceAngle, float otherAngle)
{
    // sourceAngle and otherAngle should be in the range -180 to 180
    float difference = otherAngle - sourceAngle;

    if(difference < -180.0f)
        difference += 360.0f;
    if(difference > 180.0f)
        difference -= 360.0f;

    if(difference > 0.0f)
        return 1;
    if(difference < 0.0f)
        return -1;

    return 0;
}

After subtracting the angles, the result can be in the range of -360 (-180 minus 180) to 360 (180 minus -180). You can bring them into the range of -180 to 180 by adding or subtracting 360 degrees, then compare to zero and return the result.

Angles with an absolute value between 180 and 360 correspond to the "long way around" rotations, and adding or subtracting 360 converts them to the "short way around". For example -350 degrees clockwise the long way around (i.e. 350 degrees anti-clockwise) plus 360 equates to 10 degrees clockwise the short way around.

If the angles are specified in an anti-clockwise direction, then the meaning of the return value is reversed (1 means left, -1 means right)

相关问答

更多
  • 不知何故,DrawArc根据具有规则半径的弧计算角度/绘图,因此需要较长的一侧。 我无法找到解释为什么它以这种方式工作,但也许这个链接有帮助。 var radiusX = rect.Width/2; var radiusY = rect.Height/2; // Mid point var mid = new Point(rect.Left + (rect.Width/2), rect.Top + (rect.Height/2)); ...
  • private void FixedUpdate() { RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 3000)) { Vector3 mousePos = hit.point; Debug.DrawLine(transform.position, hit.p ...
  • 以下讨论旨在检测阴影区域内的点。 有两种情况需要考虑: 角度AOB小于平面,那么点P必须在AO的右边和OB的右边(两个半平面的交点 ), 角度AOB大于平面,则点P必须位于AO的右侧或 OB的右侧(两个半平面的连接)。 完整的布尔表达式是 AO | B. (AO | P.OB | P)+¬AO| B. (AO | P + OB | P), 其中XY | Z表示Z位于XY的右侧,相当于“XYZ是顺时针”并且由三角形区域的符号确定。 我不认为可以使表达式更简单,除非你有几个P用于相同的AOB。 The disc ...
  • 你可以用一个简单的linear-gradient()来做到这一点,它比clip-path有更大的支持: .top-div { width: 310px; height: 25px; background: linear-gradient(45deg, transparent 10%, #A52432 10.01%); }
    You can do it with a simple linear-gradient() which has ...
  • 我不确定你的角度是什么意思,因为你只在你的例子中给出了一个向量。 但是,给定两个向量,您可以找到它们之间的角度,如下所示: 给定向量a和b ,对它们进行归一化。 然后,点( a , b )= cos(θ),其中θ是两个矢量之间的角度。 使用arccos找到θ。 I'm not sure what you mean by angle, since you only give one vector in your example. But, given two vectors, you can find the ...
  • 你可以...... lowerLimit = (targetAngle % 360) + 359; //360 - 1; upperLimit = (targetAngle % 360) + 361; //360 + 1; if (((transform.eulerAngles.z + 360) % 360) > lowerLimit && ((transform.eulerAngles.z + 360) % 360) < upperLimit) 这会使支票从零开始移动,您不必处理正/负检查。 编辑 ...
  • 在表达中, rotate=A*sin(2*PI/T*t) A和T不是文字。 用户应该用数字代替它们,以弧度表示幅度,以秒为单位表示周期。 例如 rotate=2*sin(2*PI/3*t) In the expression, rotate=A*sin(2*PI/T*t) A and T aren't literals. The user is meant to replace them with numerals, representing the amplitude in radians and ...
  • 这取决于您的角度是指定顺时针还是逆时针方向的旋转。 如果您正朝着坦克炮塔的方向看,如果您需要顺时针旋转炮塔以尽快指向它,则在右侧有一个物体,如果您需要逆时针旋转,则在左侧。 显然,你可以在相反的方向旋转以“走很远”:如果一个物体向右10度,那么你可以顺时针旋转10度或逆时针旋转350度指向它。 但是,假设沿顺时针方向指定角度,我们只考虑短路: // returns 1 if otherAngle is to the right of sourceAngle, // 0 if the angl ...
  • 如果我正确理解你的问题,我认为你最好使用css“transform”属性,它允许你旋转或翻译(也就是移动)一个元素。 这个的语法是 .box { transform: rotate(50deg); } 但为了兼容性,您还应该总是添加 -moz-transform: rotate(50deg); transform属性按指示移动元素,而不会影响其周围的任何其他元素。 转换将从元素已经由“顶部”和“左”属性定位的任何位置生效。 您还可以使用此属性来翻译或移动元素 transform: translate ...
  • 我认为scrollViewDidScroll对于你想要实现的目标来说太迟了。 也许尝试将UIScrollView的directionalLockEnabled属性设置为YES 。 (不确定这是否有帮助...但是玩它) 并且/或者实现UIScrollViewDelegate方法- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView并且在这个方法实现中获取一个指向传入的UIScrollView的panGestureRecognizer (只读 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)