aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 5.48 kB
JavaScript
;var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnFlowTemplate=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 CfnFlowTemplatePropsValidator(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("compatibleNamespaceVersion",cdk.validateNumber)(properties.compatibleNamespaceVersion)),errors.collect(cdk.propertyValidator("definition",cdk.requiredValidator)(properties.definition)),errors.collect(cdk.propertyValidator("definition",CfnFlowTemplate_DefinitionDocumentPropertyValidator)(properties.definition)),errors.wrap('supplied properties not correct for "CfnFlowTemplateProps"')}function cfnFlowTemplatePropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnFlowTemplatePropsValidator(properties).assertSuccess(),{Definition:cfnFlowTemplateDefinitionDocumentPropertyToCloudFormation(properties.definition),CompatibleNamespaceVersion:cdk.numberToCloudFormation(properties.compatibleNamespaceVersion)}):properties}function CfnFlowTemplatePropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("definition","Definition",CfnFlowTemplateDefinitionDocumentPropertyFromCloudFormation(properties.Definition)),ret.addPropertyResult("compatibleNamespaceVersion","CompatibleNamespaceVersion",properties.CompatibleNamespaceVersion!=null?cfn_parse.FromCloudFormation.getNumber(properties.CompatibleNamespaceVersion):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnFlowTemplate extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnFlowTemplate.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_iotthingsgraph_CfnFlowTemplateProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnFlowTemplate),error}cdk.requireProperty(props,"definition",this),this.definition=props.definition,this.compatibleNamespaceVersion=props.compatibleNamespaceVersion}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnFlowTemplatePropsFromCloudFormation(resourceProperties),ret=new CfnFlowTemplate(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",CfnFlowTemplate.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{definition:this.definition,compatibleNamespaceVersion:this.compatibleNamespaceVersion}}renderProperties(props){return cfnFlowTemplatePropsToCloudFormation(props)}}exports.CfnFlowTemplate=CfnFlowTemplate,_a=JSII_RTTI_SYMBOL_1,CfnFlowTemplate[_a]={fqn:"aws-cdk-lib.aws_iotthingsgraph.CfnFlowTemplate",version:"2.70.0"},CfnFlowTemplate.CFN_RESOURCE_TYPE_NAME="AWS::IoTThingsGraph::FlowTemplate";function CfnFlowTemplate_DefinitionDocumentPropertyValidator(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("language",cdk.requiredValidator)(properties.language)),errors.collect(cdk.propertyValidator("language",cdk.validateString)(properties.language)),errors.collect(cdk.propertyValidator("text",cdk.requiredValidator)(properties.text)),errors.collect(cdk.propertyValidator("text",cdk.validateString)(properties.text)),errors.wrap('supplied properties not correct for "DefinitionDocumentProperty"')}function cfnFlowTemplateDefinitionDocumentPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnFlowTemplate_DefinitionDocumentPropertyValidator(properties).assertSuccess(),{Language:cdk.stringToCloudFormation(properties.language),Text:cdk.stringToCloudFormation(properties.text)}):properties}function CfnFlowTemplateDefinitionDocumentPropertyFromCloudFormation(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("language","Language",cfn_parse.FromCloudFormation.getString(properties.Language)),ret.addPropertyResult("text","Text",cfn_parse.FromCloudFormation.getString(properties.Text)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}