"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaFunction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var util_1=()=>{var tmp=require("./util");return util_1=()=>tmp,tmp};class LambdaFunction{constructor(handler,props={}){this.handler=handler,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_IFunction(handler),jsiiDeprecationWarnings().aws_cdk_lib_aws_events_targets_LambdaFunctionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,LambdaFunction),error}}bind(rule,_id){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_events_IRule(rule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return(0,util_1().addLambdaPermission)(rule,this.handler),this.props.deadLetterQueue&&(0,util_1().addToDeadLetterQueueResourcePolicy)(rule,this.props.deadLetterQueue),{...(0,util_1().bindBaseTargetConfig)(this.props),arn:this.handler.functionArn,input:this.props.event,targetResource:this.handler}}}exports.LambdaFunction=LambdaFunction,_a=JSII_RTTI_SYMBOL_1,LambdaFunction[_a]={fqn:"aws-cdk-lib.aws_events_targets.LambdaFunction",version:"2.148.1"};
