aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 7.58 kB
JavaScript
var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnSimulation=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 CfnSimulation extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnSimulationPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("Unexpected IResolvable",scope);const ret=new CfnSimulation(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:CfnSimulation.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_simspaceweaver_CfnSimulationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnSimulation),error}cdk().requireProperty(props,"name",this),cdk().requireProperty(props,"roleArn",this),this.attrDescribePayload=cdk().Token.asString(this.getAtt("DescribePayload",cdk().ResolutionTypeHint.STRING)),this.maximumDuration=props.maximumDuration,this.name=props.name,this.roleArn=props.roleArn,this.schemaS3Location=props.schemaS3Location,this.snapshotS3Location=props.snapshotS3Location}get cfnProperties(){return{maximumDuration:this.maximumDuration,name:this.name,roleArn:this.roleArn,schemaS3Location:this.schemaS3Location,snapshotS3Location:this.snapshotS3Location}}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",CfnSimulation.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnSimulationPropsToCloudFormation(props)}}exports.CfnSimulation=CfnSimulation,_a=JSII_RTTI_SYMBOL_1,CfnSimulation[_a]={fqn:"aws-cdk-lib.aws_simspaceweaver.CfnSimulation",version:"2.202.0"},CfnSimulation.CFN_RESOURCE_TYPE_NAME="AWS::SimSpaceWeaver::Simulation";function CfnSimulationS3LocationPropertyValidator(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("bucketName",cdk().requiredValidator)(properties.bucketName)),errors.collect(cdk().propertyValidator("bucketName",cdk().validateString)(properties.bucketName)),errors.collect(cdk().propertyValidator("objectKey",cdk().requiredValidator)(properties.objectKey)),errors.collect(cdk().propertyValidator("objectKey",cdk().validateString)(properties.objectKey)),errors.wrap('supplied properties not correct for "S3LocationProperty"')}function convertCfnSimulationS3LocationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnSimulationS3LocationPropertyValidator(properties).assertSuccess(),{BucketName:cdk().stringToCloudFormation(properties.bucketName),ObjectKey:cdk().stringToCloudFormation(properties.objectKey)}):properties}function CfnSimulationS3LocationPropertyFromCloudFormation(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("bucketName","BucketName",properties.BucketName!=null?cfn_parse().FromCloudFormation.getString(properties.BucketName):void 0),ret.addPropertyResult("objectKey","ObjectKey",properties.ObjectKey!=null?cfn_parse().FromCloudFormation.getString(properties.ObjectKey):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnSimulationPropsValidator(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("maximumDuration",cdk().validateString)(properties.maximumDuration)),errors.collect(cdk().propertyValidator("name",cdk().requiredValidator)(properties.name)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("roleArn",cdk().requiredValidator)(properties.roleArn)),errors.collect(cdk().propertyValidator("roleArn",cdk().validateString)(properties.roleArn)),errors.collect(cdk().propertyValidator("schemaS3Location",CfnSimulationS3LocationPropertyValidator)(properties.schemaS3Location)),errors.collect(cdk().propertyValidator("snapshotS3Location",CfnSimulationS3LocationPropertyValidator)(properties.snapshotS3Location)),errors.wrap('supplied properties not correct for "CfnSimulationProps"')}function convertCfnSimulationPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnSimulationPropsValidator(properties).assertSuccess(),{MaximumDuration:cdk().stringToCloudFormation(properties.maximumDuration),Name:cdk().stringToCloudFormation(properties.name),RoleArn:cdk().stringToCloudFormation(properties.roleArn),SchemaS3Location:convertCfnSimulationS3LocationPropertyToCloudFormation(properties.schemaS3Location),SnapshotS3Location:convertCfnSimulationS3LocationPropertyToCloudFormation(properties.snapshotS3Location)}):properties}function CfnSimulationPropsFromCloudFormation(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("maximumDuration","MaximumDuration",properties.MaximumDuration!=null?cfn_parse().FromCloudFormation.getString(properties.MaximumDuration):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("roleArn","RoleArn",properties.RoleArn!=null?cfn_parse().FromCloudFormation.getString(properties.RoleArn):void 0),ret.addPropertyResult("schemaS3Location","SchemaS3Location",properties.SchemaS3Location!=null?CfnSimulationS3LocationPropertyFromCloudFormation(properties.SchemaS3Location):void 0),ret.addPropertyResult("snapshotS3Location","SnapshotS3Location",properties.SnapshotS3Location!=null?CfnSimulationS3LocationPropertyFromCloudFormation(properties.SnapshotS3Location):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}
;