UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 1.54 kB
"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)}}exports.LambdaRestApi=LambdaRestApi,_a=JSII_RTTI_SYMBOL_1,LambdaRestApi[_a]={fqn:"aws-cdk-lib.aws_apigateway.LambdaRestApi",version:"2.70.0"};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")}