"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.EnvironmentFileType=exports.S3EnvironmentFile=exports.AssetEnvironmentFile=exports.EnvironmentFile=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),aws_s3_assets_1=require("../../aws-s3-assets");class EnvironmentFile{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 AssetEnvironmentFile(path,options)}static fromBucket(bucket,key,objectVersion){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_s3_IBucket(bucket)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromBucket),error}return new S3EnvironmentFile(bucket,key,objectVersion)}}exports.EnvironmentFile=EnvironmentFile,_a=JSII_RTTI_SYMBOL_1,EnvironmentFile[_a]={fqn:"aws-cdk-lib.aws_ecs.EnvironmentFile",version:"2.96.1"};class AssetEnvironmentFile extends EnvironmentFile{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,AssetEnvironmentFile),error}}bind(scope){if(this.asset||(this.asset=new aws_s3_assets_1.Asset(scope,"EnvironmentFile",{path:this.path,...this.options})),!this.asset.isFile)throw new Error(`Asset must be a single file (${this.path})`);return{fileType:EnvironmentFileType.S3,s3Location:{bucketName:this.asset.s3BucketName,objectKey:this.asset.s3ObjectKey}}}}exports.AssetEnvironmentFile=AssetEnvironmentFile,_b=JSII_RTTI_SYMBOL_1,AssetEnvironmentFile[_b]={fqn:"aws-cdk-lib.aws_ecs.AssetEnvironmentFile",version:"2.96.1"};class S3EnvironmentFile extends EnvironmentFile{constructor(bucket,key,objectVersion){super(),this.key=key,this.objectVersion=objectVersion;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_s3_IBucket(bucket)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,S3EnvironmentFile),error}if(!bucket.bucketName)throw new Error("bucketName is undefined for the provided bucket");this.bucketName=bucket.bucketName}bind(_scope){return{fileType:EnvironmentFileType.S3,s3Location:{bucketName:this.bucketName,objectKey:this.key,objectVersion:this.objectVersion}}}}exports.S3EnvironmentFile=S3EnvironmentFile,_c=JSII_RTTI_SYMBOL_1,S3EnvironmentFile[_c]={fqn:"aws-cdk-lib.aws_ecs.S3EnvironmentFile",version:"2.96.1"};var EnvironmentFileType;(function(EnvironmentFileType2){EnvironmentFileType2.S3="s3"})(EnvironmentFileType||(exports.EnvironmentFileType=EnvironmentFileType={}));
