aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 9.59 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnBillScenario=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/lib");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 CfnBillScenario extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_bcmpricingcalculator.CfnBillScenario",version:"2.252.0"};static CFN_RESOURCE_TYPE_NAME="AWS::BcmPricingCalculator::BillScenario";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnBillScenarioPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnBillScenario(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}static isCfnBillScenario(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnBillScenario.CFN_RESOURCE_TYPE_NAME}static arnForBillScenario(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_bcmpricingcalculator_IBillScenarioRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForBillScenario),error}return resource.billScenarioRef.billScenarioArn}cdkTagManager;_costCategoryGroupSharingPreferenceArn;_expiresAt;_groupSharingPreference;_name;_tags;cfnPropertyNames={tags:"Tags",costCategoryGroupSharingPreferenceArn:"CostCategoryGroupSharingPreferenceArn",expiresAt:"ExpiresAt",groupSharingPreference:"GroupSharingPreference",name:"Name"};constructor(scope,id,props={}){super(scope,id,{type:CfnBillScenario.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bcmpricingcalculator_CfnBillScenarioProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnBillScenario),error}this.cdkTagManager=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::BcmPricingCalculator::BillScenario",void 0,{tagPropertyName:"tags"}),this._costCategoryGroupSharingPreferenceArn=props.costCategoryGroupSharingPreferenceArn,this._expiresAt=props.expiresAt,this._groupSharingPreference=props.groupSharingPreference,this._name=props.name,this._tags=props.tags}get billScenarioRef(){return{billScenarioArn:this.ref}}get costCategoryGroupSharingPreferenceArn(){return this._costCategoryGroupSharingPreferenceArn}set costCategoryGroupSharingPreferenceArn(value){cdk().traceProperty(this.node,"CostCategoryGroupSharingPreferenceArn"),this._costCategoryGroupSharingPreferenceArn=value}get expiresAt(){return this._expiresAt}set expiresAt(value){cdk().traceProperty(this.node,"ExpiresAt"),this._expiresAt=value}get groupSharingPreference(){return this._groupSharingPreference}set groupSharingPreference(value){cdk().traceProperty(this.node,"GroupSharingPreference"),this._groupSharingPreference=value}get name(){return this._name}set name(value){cdk().traceProperty(this.node,"Name"),this._name=value}get tags(){return this._tags}set tags(value){cdk().traceProperty(this.node,"Tags"),this._tags=value}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrBillInterval(){return this.getAtt("BillInterval")}get attrCreatedAt(){return cdk().Token.asString(this.getAtt("CreatedAt",cdk().ResolutionTypeHint.STRING))}get attrFailureMessage(){return cdk().Token.asString(this.getAtt("FailureMessage",cdk().ResolutionTypeHint.STRING))}get attrId(){return cdk().Token.asString(this.getAtt("Id",cdk().ResolutionTypeHint.STRING))}get attrStatus(){return cdk().Token.asString(this.getAtt("Status",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{tags:this.cdkTagManager.renderTags(this._tags),costCategoryGroupSharingPreferenceArn:this._costCategoryGroupSharingPreferenceArn,expiresAt:this._expiresAt,groupSharingPreference:this._groupSharingPreference,name:this._name}}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",CfnBillScenario.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnBillScenarioPropsToCloudFormation(props)}}exports.CfnBillScenario=CfnBillScenario;function CfnBillScenarioBillIntervalPropertyValidator(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("end",cdk().validateString)(properties.end)),errors.collect(cdk().propertyValidator("start",cdk().validateString)(properties.start)),errors.wrap('supplied properties not correct for "BillIntervalProperty"')}function convertCfnBillScenarioBillIntervalPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnBillScenarioBillIntervalPropertyValidator(properties).assertSuccess(),{End:cdk().stringToCloudFormation(properties.end),Start:cdk().stringToCloudFormation(properties.start)}):properties}function CfnBillScenarioBillIntervalPropertyFromCloudFormation(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("end","End",properties.End!=null?cfn_parse().FromCloudFormation.getString(properties.End):void 0),ret.addPropertyResult("start","Start",properties.Start!=null?cfn_parse().FromCloudFormation.getString(properties.Start):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnBillScenarioPropsValidator(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("costCategoryGroupSharingPreferenceArn",cdk().validateString)(properties.costCategoryGroupSharingPreferenceArn)),errors.collect(cdk().propertyValidator("expiresAt",cdk().validateString)(properties.expiresAt)),errors.collect(cdk().propertyValidator("groupSharingPreference",cdk().validateString)(properties.groupSharingPreference)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnBillScenarioProps"')}function convertCfnBillScenarioPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnBillScenarioPropsValidator(properties).assertSuccess(),{CostCategoryGroupSharingPreferenceArn:cdk().stringToCloudFormation(properties.costCategoryGroupSharingPreferenceArn),ExpiresAt:cdk().stringToCloudFormation(properties.expiresAt),GroupSharingPreference:cdk().stringToCloudFormation(properties.groupSharingPreference),Name:cdk().stringToCloudFormation(properties.name),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnBillScenarioPropsFromCloudFormation(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("costCategoryGroupSharingPreferenceArn","CostCategoryGroupSharingPreferenceArn",properties.CostCategoryGroupSharingPreferenceArn!=null?cfn_parse().FromCloudFormation.getString(properties.CostCategoryGroupSharingPreferenceArn):void 0),ret.addPropertyResult("expiresAt","ExpiresAt",properties.ExpiresAt!=null?cfn_parse().FromCloudFormation.getString(properties.ExpiresAt):void 0),ret.addPropertyResult("groupSharingPreference","GroupSharingPreference",properties.GroupSharingPreference!=null?cfn_parse().FromCloudFormation.getString(properties.GroupSharingPreference):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}