"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiDestination=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var connection_1=()=>{var tmp=require("./connection");return connection_1=()=>tmp,tmp},events_generated_1=()=>{var tmp=require("./events.generated");return events_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class ApiDestination extends core_1().Resource{static fromApiDestinationAttributes(scope,id,attrs){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_events_ApiDestinationAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromApiDestinationAttributes),error}const apiDestinationName=core_1().Stack.of(scope).splitArn(attrs.apiDestinationArn,core_1().ArnFormat.SLASH_RESOURCE_NAME).resourceName;if(!apiDestinationName)throw new Error(`Could not extract Api Destionation name from ARN: '${attrs.apiDestinationArn}'`);class Import extends core_1().Resource{constructor(){super(...arguments),this.apiDestinationArn=attrs.apiDestinationArn,this.apiDestinationName=apiDestinationName,this.connection=attrs.connection}}return new Import(scope,id)}constructor(scope,id,props){super(scope,id,{physicalName:props.apiDestinationName});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_events_ApiDestinationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ApiDestination),error}this.connection=props.connection;let apiDestination=new(events_generated_1()).CfnApiDestination(this,"ApiDestination",{connectionArn:this.connection.connectionArn,description:props.description,httpMethod:props.httpMethod??connection_1().HttpMethod.POST,invocationEndpoint:props.endpoint,invocationRateLimitPerSecond:props.rateLimitPerSecond,name:this.physicalName});this.apiDestinationName=this.getResourceNameAttribute(apiDestination.ref),this.apiDestinationArn=apiDestination.attrArn}}exports.ApiDestination=ApiDestination,_a=JSII_RTTI_SYMBOL_1,ApiDestination[_a]={fqn:"aws-cdk-lib.aws_events.ApiDestination",version:"2.159.0"};
