"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.EventInvokeConfig=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),core_1=require("../../core"),destination_1=require("./destination"),lambda_generated_1=require("./lambda.generated");class EventInvokeConfig extends core_1.Resource{constructor(scope,id,props){var _b;super(scope,id);if(jsiiDeprecationWarnings.aws_cdk_lib_aws_lambda_EventInvokeConfigProps(props),props.maxEventAge&&(props.maxEventAge.toSeconds()<60||props.maxEventAge.toSeconds()>21600))throw new Error("`maximumEventAge` must represent a `Duration` that is between 60 and 21600 seconds.");if(props.retryAttempts&&(props.retryAttempts<0||props.retryAttempts>2))throw new Error("`retryAttempts` must be between 0 and 2.");new lambda_generated_1.CfnEventInvokeConfig(this,"Resource",{destinationConfig:props.onFailure||props.onSuccess?{...props.onFailure?{onFailure:props.onFailure.bind(this,props.function,{type:destination_1.DestinationType.FAILURE})}:{},...props.onSuccess?{onSuccess:props.onSuccess.bind(this,props.function,{type:destination_1.DestinationType.SUCCESS})}:{}}:void 0,functionName:props.function.functionName,maximumEventAgeInSeconds:props.maxEventAge&&props.maxEventAge.toSeconds(),maximumRetryAttempts:(_b=props.retryAttempts)!==null&&_b!==void 0?_b:void 0,qualifier:props.qualifier||"$LATEST"})}}exports.EventInvokeConfig=EventInvokeConfig,_a=JSII_RTTI_SYMBOL_1,EventInvokeConfig[_a]={fqn:"aws-cdk-lib.aws_lambda.EventInvokeConfig",version:"2.13.0"};
//# sourceMappingURL=event-invoke-config.js.map
