"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaRestApi=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),integrations_1=require("./integrations"),restapi_1=require("./restapi");class LambdaRestApi extends restapi_1.RestApi{constructor(scope,id,props){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_apigateway_LambdaRestApiProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,LambdaRestApi),error}if(props.options?.defaultIntegration||props.defaultIntegration)throw new Error('Cannot specify "defaultIntegration" since Lambda integration is automatically defined');super(scope,id,{defaultIntegration:new integrations_1.LambdaIntegration(props.handler,props.integrationOptions),...props.options,...props}),props.proxy!==!1&&(this.root.addProxy(),this.root.addResource=addResourceThrows,this.root.addMethod=addMethodThrows,this.root.addProxy=addProxyThrows),this.node.addValidation({validate(){for(const value of Object.values(props.deployOptions?.variables??{})){const regexp=/[A-Za-z0-9-._~:/?#&=,]+/;if(value.match(regexp)===null)return["Stage variable value "+value+" does not match the regex."]}return[]}})}}exports.LambdaRestApi=LambdaRestApi,_a=JSII_RTTI_SYMBOL_1,LambdaRestApi[_a]={fqn:"aws-cdk-lib.aws_apigateway.LambdaRestApi",version:"2.96.1"};function addResourceThrows(){throw new Error("Cannot call 'addResource' on a proxying LambdaRestApi; set 'proxy' to false")}function addMethodThrows(){throw new Error("Cannot call 'addMethod' on a proxying LambdaRestApi; set 'proxy' to false")}function addProxyThrows(){throw new Error("Cannot call 'addProxy' on a proxying LambdaRestApi; set 'proxy' to false")}
