"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CliCredentialsStackSynthesizer=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cxapi=require("../../../cx-api"),token_1=require("../token"),_asset_manifest_builder_1=require("./_asset-manifest-builder"),_shared_1=require("./_shared"),default_synthesizer_1=require("./default-synthesizer"),stack_synthesizer_1=require("./stack-synthesizer");class CliCredentialsStackSynthesizer extends stack_synthesizer_1.StackSynthesizer{constructor(props={}){super();this.props=props,this.assetManifest=new _asset_manifest_builder_1.AssetManifestBuilder,jsiiDeprecationWarnings.aws_cdk_lib_CliCredentialsStackSynthesizerProps(props);for(const key in props)props.hasOwnProperty(key)&&validateNoToken(key);function validateNoToken(key){const prop=props[key];if(typeof prop=="string"&&token_1.Token.isUnresolved(prop))throw new Error(`DefaultSynthesizer property '${key}' cannot contain tokens; only the following placeholder strings are allowed: `+["${Qualifier}",cxapi.EnvironmentPlaceholders.CURRENT_REGION,cxapi.EnvironmentPlaceholders.CURRENT_ACCOUNT,cxapi.EnvironmentPlaceholders.CURRENT_PARTITION].join(", "))}}bind(stack){var _b,_c,_d,_e,_f,_g;if(jsiiDeprecationWarnings.aws_cdk_lib_Stack(stack),this.stack!==void 0)throw new Error("A StackSynthesizer can only be used for one Stack: create a new instance to use with a different Stack");this.stack=stack;const qualifier=(_c=(_b=this.props.qualifier)!==null&&_b!==void 0?_b:stack.node.tryGetContext(default_synthesizer_1.BOOTSTRAP_QUALIFIER_CONTEXT))!==null&&_c!==void 0?_c:default_synthesizer_1.DefaultStackSynthesizer.DEFAULT_QUALIFIER;this.qualifier=qualifier;const spec=new _shared_1.StringSpecializer(stack,qualifier);this.bucketName=spec.specialize((_d=this.props.fileAssetsBucketName)!==null&&_d!==void 0?_d:default_synthesizer_1.DefaultStackSynthesizer.DEFAULT_FILE_ASSETS_BUCKET_NAME),this.repositoryName=spec.specialize((_e=this.props.imageAssetsRepositoryName)!==null&&_e!==void 0?_e:default_synthesizer_1.DefaultStackSynthesizer.DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME),this.bucketPrefix=spec.specialize((_f=this.props.bucketPrefix)!==null&&_f!==void 0?_f:default_synthesizer_1.DefaultStackSynthesizer.DEFAULT_FILE_ASSET_PREFIX),this.dockerTagPrefix=spec.specialize((_g=this.props.dockerTagPrefix)!==null&&_g!==void 0?_g:default_synthesizer_1.DefaultStackSynthesizer.DEFAULT_DOCKER_ASSET_PREFIX)}addFileAsset(asset){return jsiiDeprecationWarnings.aws_cdk_lib_FileAssetSource(asset),_shared_1.assertBound(this.stack),_shared_1.assertBound(this.bucketName),_shared_1.assertBound(this.bucketPrefix),this.assetManifest.addFileAssetDefault(asset,this.stack,this.bucketName,this.bucketPrefix)}addDockerImageAsset(asset){return jsiiDeprecationWarnings.aws_cdk_lib_DockerImageAssetSource(asset),_shared_1.assertBound(this.stack),_shared_1.assertBound(this.repositoryName),_shared_1.assertBound(this.dockerTagPrefix),this.assetManifest.addDockerImageAssetDefault(asset,this.stack,this.repositoryName,this.dockerTagPrefix)}synthesize(session){jsiiDeprecationWarnings.aws_cdk_lib_ISynthesisSession(session),_shared_1.assertBound(this.stack),_shared_1.assertBound(this.qualifier),this.synthesizeStackTemplate(this.stack,session);const templateAsset=this.addFileAsset(_shared_1.stackTemplateFileAsset(this.stack,session)),assetManifestId=this.assetManifest.writeManifest(this.stack,session);this.emitStackArtifact(this.stack,session,{stackTemplateAssetObjectUrl:templateAsset.s3ObjectUrlWithPlaceholders,additionalDependencies:[assetManifestId]})}}exports.CliCredentialsStackSynthesizer=CliCredentialsStackSynthesizer,_a=JSII_RTTI_SYMBOL_1,CliCredentialsStackSynthesizer[_a]={fqn:"aws-cdk-lib.CliCredentialsStackSynthesizer",version:"2.13.0"};
//# sourceMappingURL=cli-credentials-synthesizer.js.map
