UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 2.07 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.StepFunctionsRestApi=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var _1=()=>{var tmp=require(".");return _1=()=>tmp,tmp},stepfunctions_1=()=>{var tmp=require("./integrations/stepfunctions");return stepfunctions_1=()=>tmp,tmp},sfn=()=>{var tmp=require("../../aws-stepfunctions");return sfn=()=>tmp,tmp},errors_1=()=>{var tmp=require("../../core/lib/errors");return errors_1=()=>tmp,tmp},metadata_resource_1=()=>{var tmp=require("../../core/lib/metadata-resource");return metadata_resource_1=()=>tmp,tmp};class StepFunctionsRestApi extends _1().RestApi{constructor(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigateway_StepFunctionsRestApiProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,StepFunctionsRestApi),error}if(props.defaultIntegration)throw new(errors_1()).ValidationError('Cannot specify "defaultIntegration" since Step Functions integration is automatically defined',scope);if(props.stateMachine.node.defaultChild.stateMachineType!==sfn().StateMachineType.EXPRESS)throw new(errors_1()).ValidationError('State Machine must be of type "EXPRESS". Please use StateMachineType.EXPRESS as the stateMachineType',scope);const stepfunctionsIntegration=stepfunctions_1().StepFunctionsIntegration.startExecution(props.stateMachine,{credentialsRole:props.role,requestContext:props.requestContext,path:props.path??!0,querystring:props.querystring??!0,headers:props.headers,authorizer:props.authorizer,useDefaultMethodResponses:props.useDefaultMethodResponses});super(scope,id,props),(0,metadata_resource_1().addConstructMetadata)(this,props),this.root.addMethod("ANY",stepfunctionsIntegration)}}exports.StepFunctionsRestApi=StepFunctionsRestApi,_a=JSII_RTTI_SYMBOL_1,StepFunctionsRestApi[_a]={fqn:"aws-cdk-lib.aws_apigateway.StepFunctionsRestApi",version:"2.185.0"};