UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 5.56 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnSimulation=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cdk=require("../../core"),cfn_parse=require("../../core/lib/helpers-internal");function CfnSimulationPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("roleArn",cdk.validateString)(properties.roleArn)),errors.collect(cdk.propertyValidator("schemaS3Location",CfnSimulation_S3LocationPropertyValidator)(properties.schemaS3Location)),errors.wrap('supplied properties not correct for "CfnSimulationProps"')}function cfnSimulationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSimulationPropsValidator(properties).assertSuccess(),{Name:cdk.stringToCloudFormation(properties.name),RoleArn:cdk.stringToCloudFormation(properties.roleArn),SchemaS3Location:cfnSimulationS3LocationPropertyToCloudFormation(properties.schemaS3Location)}):properties}function CfnSimulationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return 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.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnSimulation extends cdk.CfnResource{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}this.attrDescribePayload=cdk.Token.asString(this.getAtt("DescribePayload",cdk.ResolutionTypeHint.STRING)),this.name=props.name,this.roleArn=props.roleArn,this.schemaS3Location=props.schemaS3Location}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnSimulationPropsFromCloudFormation(resourceProperties),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}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)}get cfnProperties(){return{name:this.name,roleArn:this.roleArn,schemaS3Location:this.schemaS3Location}}renderProperties(props){return cfnSimulationPropsToCloudFormation(props)}}exports.CfnSimulation=CfnSimulation,_a=JSII_RTTI_SYMBOL_1,CfnSimulation[_a]={fqn:"aws-cdk-lib.aws_simspaceweaver.CfnSimulation",version:"2.70.0"},CfnSimulation.CFN_RESOURCE_TYPE_NAME="AWS::SimSpaceWeaver::Simulation";function CfnSimulation_S3LocationPropertyValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&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 cfnSimulationS3LocationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSimulation_S3LocationPropertyValidator(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??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("bucketName","BucketName",cfn_parse.FromCloudFormation.getString(properties.BucketName)),ret.addPropertyResult("objectKey","ObjectKey",cfn_parse.FromCloudFormation.getString(properties.ObjectKey)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}