"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaInterceptor=exports.InterceptionPoint=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var InterceptionPoint;(function(InterceptionPoint2){InterceptionPoint2.REQUEST="REQUEST",InterceptionPoint2.RESPONSE="RESPONSE"})(InterceptionPoint||(exports.InterceptionPoint=InterceptionPoint={}));class LambdaInterceptor{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_bedrockagentcore.LambdaInterceptor",version:"2.256.1"};static forRequest(lambdaFunction,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_IFunction(lambdaFunction),jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_InterceptorOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.forRequest),error}return new LambdaInterceptor(InterceptionPoint.REQUEST,lambdaFunction,options)}static forResponse(lambdaFunction,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_IFunction(lambdaFunction),jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_InterceptorOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.forResponse),error}return new LambdaInterceptor(InterceptionPoint.RESPONSE,lambdaFunction,options)}interceptionPoint;lambdaFunction;passRequestHeaders;constructor(interceptionPoint,lambdaFunction,options){this.interceptionPoint=interceptionPoint,this.lambdaFunction=lambdaFunction,this.passRequestHeaders=options?.passRequestHeaders??!1}bind(_scope,gateway){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_IGateway(gateway)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return this.lambdaFunction.grantInvoke(gateway.role),{configuration:{interceptionPoints:[this.interceptionPoint],interceptor:{lambda:{arn:this.lambdaFunction.functionArn}},inputConfiguration:{passRequestHeaders:this.passRequestHeaders}}}}}exports.LambdaInterceptor=LambdaInterceptor;
