aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 20.4 kB
JavaScript
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnExport=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},cfn_parse=()=>{var tmp=require("../../core/lib/helpers-internal");return cfn_parse=()=>tmp,tmp},cdk_errors=()=>{var tmp=require("../../core/lib/errors");return cdk_errors=()=>tmp,tmp};class CfnExport extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnExportPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("Unexpected IResolvable",scope);const ret=new CfnExport(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}constructor(scope,id,props){super(scope,id,{type:CfnExport.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bcmdataexports_CfnExportProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnExport),error}cdk().requireProperty(props,"export",this),this.attrExportArn=cdk().Token.asString(this.getAtt("ExportArn",cdk().ResolutionTypeHint.STRING)),this.cdkTagManager=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::BCMDataExports::Export",void 0,{tagPropertyName:"tags"}),this.export=props.export,this.tags=props.tags}get cfnProperties(){return{tags:this.cdkTagManager.renderTags(this.tags),export:this.export}}inspect(inspector){try{jsiiDeprecationWarnings().aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnExport.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnExportPropsToCloudFormation(props)}}exports.CfnExport=CfnExport,_a=JSII_RTTI_SYMBOL_1,CfnExport[_a]={fqn:"aws-cdk-lib.aws_bcmdataexports.CfnExport",version:"2.202.0"},CfnExport.CFN_RESOURCE_TYPE_NAME="AWS::BCMDataExports::Export";function CfnExportDataQueryPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("queryStatement",cdk().requiredValidator)(properties.queryStatement)),errors.collect(cdk().propertyValidator("queryStatement",cdk().validateString)(properties.queryStatement)),errors.collect(cdk().propertyValidator("tableConfigurations",cdk().hashValidator(cdk().hashValidator(cdk().validateString)))(properties.tableConfigurations)),errors.wrap('supplied properties not correct for "DataQueryProperty"')}function convertCfnExportDataQueryPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportDataQueryPropertyValidator(properties).assertSuccess(),{QueryStatement:cdk().stringToCloudFormation(properties.queryStatement),TableConfigurations:cdk().hashMapper(cdk().hashMapper(cdk().stringToCloudFormation))(properties.tableConfigurations)}):properties}function CfnExportDataQueryPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("queryStatement","QueryStatement",properties.QueryStatement!=null?cfn_parse().FromCloudFormation.getString(properties.QueryStatement):void 0),ret.addPropertyResult("tableConfigurations","TableConfigurations",properties.TableConfigurations!=null?cfn_parse().FromCloudFormation.getMap(cfn_parse().FromCloudFormation.getMap(cfn_parse().FromCloudFormation.getString))(properties.TableConfigurations):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnExportS3OutputConfigurationsPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("compression",cdk().requiredValidator)(properties.compression)),errors.collect(cdk().propertyValidator("compression",cdk().validateString)(properties.compression)),errors.collect(cdk().propertyValidator("format",cdk().requiredValidator)(properties.format)),errors.collect(cdk().propertyValidator("format",cdk().validateString)(properties.format)),errors.collect(cdk().propertyValidator("outputType",cdk().requiredValidator)(properties.outputType)),errors.collect(cdk().propertyValidator("outputType",cdk().validateString)(properties.outputType)),errors.collect(cdk().propertyValidator("overwrite",cdk().requiredValidator)(properties.overwrite)),errors.collect(cdk().propertyValidator("overwrite",cdk().validateString)(properties.overwrite)),errors.wrap('supplied properties not correct for "S3OutputConfigurationsProperty"')}function convertCfnExportS3OutputConfigurationsPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportS3OutputConfigurationsPropertyValidator(properties).assertSuccess(),{Compression:cdk().stringToCloudFormation(properties.compression),Format:cdk().stringToCloudFormation(properties.format),OutputType:cdk().stringToCloudFormation(properties.outputType),Overwrite:cdk().stringToCloudFormation(properties.overwrite)}):properties}function CfnExportS3OutputConfigurationsPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("compression","Compression",properties.Compression!=null?cfn_parse().FromCloudFormation.getString(properties.Compression):void 0),ret.addPropertyResult("format","Format",properties.Format!=null?cfn_parse().FromCloudFormation.getString(properties.Format):void 0),ret.addPropertyResult("outputType","OutputType",properties.OutputType!=null?cfn_parse().FromCloudFormation.getString(properties.OutputType):void 0),ret.addPropertyResult("overwrite","Overwrite",properties.Overwrite!=null?cfn_parse().FromCloudFormation.getString(properties.Overwrite):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnExportS3DestinationPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("s3Bucket",cdk().requiredValidator)(properties.s3Bucket)),errors.collect(cdk().propertyValidator("s3Bucket",cdk().validateString)(properties.s3Bucket)),errors.collect(cdk().propertyValidator("s3OutputConfigurations",cdk().requiredValidator)(properties.s3OutputConfigurations)),errors.collect(cdk().propertyValidator("s3OutputConfigurations",CfnExportS3OutputConfigurationsPropertyValidator)(properties.s3OutputConfigurations)),errors.collect(cdk().propertyValidator("s3Prefix",cdk().requiredValidator)(properties.s3Prefix)),errors.collect(cdk().propertyValidator("s3Prefix",cdk().validateString)(properties.s3Prefix)),errors.collect(cdk().propertyValidator("s3Region",cdk().requiredValidator)(properties.s3Region)),errors.collect(cdk().propertyValidator("s3Region",cdk().validateString)(properties.s3Region)),errors.wrap('supplied properties not correct for "S3DestinationProperty"')}function convertCfnExportS3DestinationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportS3DestinationPropertyValidator(properties).assertSuccess(),{S3Bucket:cdk().stringToCloudFormation(properties.s3Bucket),S3OutputConfigurations:convertCfnExportS3OutputConfigurationsPropertyToCloudFormation(properties.s3OutputConfigurations),S3Prefix:cdk().stringToCloudFormation(properties.s3Prefix),S3Region:cdk().stringToCloudFormation(properties.s3Region)}):properties}function CfnExportS3DestinationPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("s3Bucket","S3Bucket",properties.S3Bucket!=null?cfn_parse().FromCloudFormation.getString(properties.S3Bucket):void 0),ret.addPropertyResult("s3OutputConfigurations","S3OutputConfigurations",properties.S3OutputConfigurations!=null?CfnExportS3OutputConfigurationsPropertyFromCloudFormation(properties.S3OutputConfigurations):void 0),ret.addPropertyResult("s3Prefix","S3Prefix",properties.S3Prefix!=null?cfn_parse().FromCloudFormation.getString(properties.S3Prefix):void 0),ret.addPropertyResult("s3Region","S3Region",properties.S3Region!=null?cfn_parse().FromCloudFormation.getString(properties.S3Region):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnExportDestinationConfigurationsPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("s3Destination",cdk().requiredValidator)(properties.s3Destination)),errors.collect(cdk().propertyValidator("s3Destination",CfnExportS3DestinationPropertyValidator)(properties.s3Destination)),errors.wrap('supplied properties not correct for "DestinationConfigurationsProperty"')}function convertCfnExportDestinationConfigurationsPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportDestinationConfigurationsPropertyValidator(properties).assertSuccess(),{S3Destination:convertCfnExportS3DestinationPropertyToCloudFormation(properties.s3Destination)}):properties}function CfnExportDestinationConfigurationsPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("s3Destination","S3Destination",properties.S3Destination!=null?CfnExportS3DestinationPropertyFromCloudFormation(properties.S3Destination):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnExportRefreshCadencePropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("frequency",cdk().requiredValidator)(properties.frequency)),errors.collect(cdk().propertyValidator("frequency",cdk().validateString)(properties.frequency)),errors.wrap('supplied properties not correct for "RefreshCadenceProperty"')}function convertCfnExportRefreshCadencePropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportRefreshCadencePropertyValidator(properties).assertSuccess(),{Frequency:cdk().stringToCloudFormation(properties.frequency)}):properties}function CfnExportRefreshCadencePropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("frequency","Frequency",properties.Frequency!=null?cfn_parse().FromCloudFormation.getString(properties.Frequency):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnExportExportPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("dataQuery",cdk().requiredValidator)(properties.dataQuery)),errors.collect(cdk().propertyValidator("dataQuery",CfnExportDataQueryPropertyValidator)(properties.dataQuery)),errors.collect(cdk().propertyValidator("description",cdk().validateString)(properties.description)),errors.collect(cdk().propertyValidator("destinationConfigurations",cdk().requiredValidator)(properties.destinationConfigurations)),errors.collect(cdk().propertyValidator("destinationConfigurations",CfnExportDestinationConfigurationsPropertyValidator)(properties.destinationConfigurations)),errors.collect(cdk().propertyValidator("exportArn",cdk().validateString)(properties.exportArn)),errors.collect(cdk().propertyValidator("name",cdk().requiredValidator)(properties.name)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("refreshCadence",cdk().requiredValidator)(properties.refreshCadence)),errors.collect(cdk().propertyValidator("refreshCadence",CfnExportRefreshCadencePropertyValidator)(properties.refreshCadence)),errors.wrap('supplied properties not correct for "ExportProperty"')}function convertCfnExportExportPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportExportPropertyValidator(properties).assertSuccess(),{DataQuery:convertCfnExportDataQueryPropertyToCloudFormation(properties.dataQuery),Description:cdk().stringToCloudFormation(properties.description),DestinationConfigurations:convertCfnExportDestinationConfigurationsPropertyToCloudFormation(properties.destinationConfigurations),ExportArn:cdk().stringToCloudFormation(properties.exportArn),Name:cdk().stringToCloudFormation(properties.name),RefreshCadence:convertCfnExportRefreshCadencePropertyToCloudFormation(properties.refreshCadence)}):properties}function CfnExportExportPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("dataQuery","DataQuery",properties.DataQuery!=null?CfnExportDataQueryPropertyFromCloudFormation(properties.DataQuery):void 0),ret.addPropertyResult("description","Description",properties.Description!=null?cfn_parse().FromCloudFormation.getString(properties.Description):void 0),ret.addPropertyResult("destinationConfigurations","DestinationConfigurations",properties.DestinationConfigurations!=null?CfnExportDestinationConfigurationsPropertyFromCloudFormation(properties.DestinationConfigurations):void 0),ret.addPropertyResult("exportArn","ExportArn",properties.ExportArn!=null?cfn_parse().FromCloudFormation.getString(properties.ExportArn):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("refreshCadence","RefreshCadence",properties.RefreshCadence!=null?CfnExportRefreshCadencePropertyFromCloudFormation(properties.RefreshCadence):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnExportResourceTagPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("key",cdk().requiredValidator)(properties.key)),errors.collect(cdk().propertyValidator("key",cdk().validateString)(properties.key)),errors.collect(cdk().propertyValidator("value",cdk().requiredValidator)(properties.value)),errors.collect(cdk().propertyValidator("value",cdk().validateString)(properties.value)),errors.wrap('supplied properties not correct for "ResourceTagProperty"')}function convertCfnExportResourceTagPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportResourceTagPropertyValidator(properties).assertSuccess(),{Key:cdk().stringToCloudFormation(properties.key),Value:cdk().stringToCloudFormation(properties.value)}):properties}function CfnExportResourceTagPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("key","Key",properties.Key!=null?cfn_parse().FromCloudFormation.getString(properties.Key):void 0),ret.addPropertyResult("value","Value",properties.Value!=null?cfn_parse().FromCloudFormation.getString(properties.Value):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnExportPropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("export",cdk().requiredValidator)(properties.export)),errors.collect(cdk().propertyValidator("export",CfnExportExportPropertyValidator)(properties.export)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(CfnExportResourceTagPropertyValidator))(properties.tags)),errors.wrap('supplied properties not correct for "CfnExportProps"')}function convertCfnExportPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnExportPropsValidator(properties).assertSuccess(),{Export:convertCfnExportExportPropertyToCloudFormation(properties.export),Tags:cdk().listMapper(convertCfnExportResourceTagPropertyToCloudFormation)(properties.tags)}):properties}function CfnExportPropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("export","Export",properties.Export!=null?CfnExportExportPropertyFromCloudFormation(properties.Export):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(CfnExportResourceTagPropertyFromCloudFormation)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}