"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiDestination=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../aws-iam"),util_1=require("./util");class ApiDestination{constructor(apiDestination,props={}){this.apiDestination=apiDestination,this.props=props;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IApiDestination(apiDestination),jsiiDeprecationWarnings.aws_cdk_lib_aws_events_targets_ApiDestinationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}}bind(_rule,_id){var _b,_c,_d,_e,_f;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}const httpParameters=((_c=(_b=!!this.props.headerParameters)!==null&&_b!==void 0?_b:!!this.props.pathParameterValues)!==null&&_c!==void 0?_c:!!this.props.queryStringParameters)?{headerParameters:this.props.headerParameters,pathParameterValues:this.props.pathParameterValues,queryStringParameters:this.props.queryStringParameters}:void 0;return!((_d=this.props)===null||_d===void 0)&&_d.deadLetterQueue&&util_1.addToDeadLetterQueueResourcePolicy(_rule,this.props.deadLetterQueue),{...this.props?util_1.bindBaseTargetConfig(this.props):{},arn:this.apiDestination.apiDestinationArn,role:(_f=(_e=this.props)===null||_e===void 0?void 0:_e.eventRole)!==null&&_f!==void 0?_f:util_1.singletonEventRole(this.apiDestination,[new iam.PolicyStatement({resources:[this.apiDestination.apiDestinationArn],actions:["events:InvokeApiDestination"]})]),input:this.props.event,targetResource:this.apiDestination,httpParameters}}}exports.ApiDestination=ApiDestination,_a=JSII_RTTI_SYMBOL_1,ApiDestination[_a]={fqn:"aws-cdk-lib.aws_events_targets.ApiDestination",version:"2.24.1"};
//# sourceMappingURL=api-destination.js.map
