"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InlineCode=exports.AssetCode=exports.Code=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var s3_assets=()=>{var tmp=require("../../aws-s3-assets");return s3_assets=()=>tmp,tmp},cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class Code{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_appsync.Code",version:"2.256.1"};static fromAsset(path,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_s3_assets_AssetOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromAsset),error}return new AssetCode(path,options)}static fromInline(code){return new InlineCode(code)}}exports.Code=Code;class AssetCode extends Code{path;options;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_appsync.AssetCode",version:"2.256.1"};asset;constructor(path,options={}){super(),this.path=path,this.options=options;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_s3_assets_AssetOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AssetCode),error}}bind(scope){if(!this.asset)this.asset=new(s3_assets()).Asset(scope,"Code",{path:this.path,...this.options});else if(cdk().Stack.of(this.asset)!==cdk().Stack.of(scope))throw new(cdk()).ValidationError((0,literal_string_1().lit)`AssetAlreadyAssociated`,`Asset is already associated with another stack '${cdk().Stack.of(this.asset).stackName}'. Create a new Code instance for every stack.`,scope);return{s3Location:this.asset.s3ObjectUrl}}}exports.AssetCode=AssetCode;class InlineCode extends Code{code;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_appsync.InlineCode",version:"2.256.1"};constructor(code){if(super(),this.code=code,code.length===0)throw new(cdk()).UnscopedValidationError((0,literal_string_1().lit)`InlineCodeEmpty`,"AppSync Inline code cannot be empty")}bind(_scope){return{inlineCode:this.code}}}exports.InlineCode=InlineCode;
