"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Lambda=exports.LambdaInvocationType=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../aws-iam"),cdk=require("../../core");var LambdaInvocationType;(function(LambdaInvocationType2){LambdaInvocationType2.EVENT="Event",LambdaInvocationType2.REQUEST_RESPONSE="RequestResponse"})(LambdaInvocationType=exports.LambdaInvocationType||(exports.LambdaInvocationType={}));class Lambda{constructor(props){this.props=props,jsiiDeprecationWarnings.aws_cdk_lib_aws_ses_actions_LambdaProps(props)}bind(rule){var _b;jsiiDeprecationWarnings.aws_cdk_lib_aws_ses_IReceiptRule(rule);const permissionId="AllowSes";this.props.function.permissionsNode.tryFindChild(permissionId)||this.props.function.addPermission(permissionId,{action:"lambda:InvokeFunction",principal:new iam.ServicePrincipal("ses.amazonaws.com"),sourceAccount:cdk.Aws.ACCOUNT_ID});const permission=this.props.function.permissionsNode.tryFindChild(permissionId);return permission?rule.node.addDependency(permission):cdk.Annotations.of(rule).addWarning("This rule is using a Lambda action with an imported function. Ensure permission is given to SES to invoke that function."),{lambdaAction:{functionArn:this.props.function.functionArn,invocationType:this.props.invocationType,topicArn:(_b=this.props.topic)===null||_b===void 0?void 0:_b.topicArn}}}}exports.Lambda=Lambda,_a=JSII_RTTI_SYMBOL_1,Lambda[_a]={fqn:"aws-cdk-lib.aws_ses_actions.Lambda",version:"2.13.0"};
//# sourceMappingURL=lambda.js.map
