UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 6.6 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnDatastore=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 CfnDatastore extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_healthimaging.CfnDatastore",version:"2.246.0"};static CFN_RESOURCE_TYPE_NAME="AWS::HealthImaging::Datastore";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnDatastorePropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("UnexpectedIResolvable","Unexpected IResolvable",scope);const ret=new CfnDatastore(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 isCfnDatastore(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnDatastore.CFN_RESOURCE_TYPE_NAME}static fromDatastoreArn(scope,id,arn){class Import extends cdk().Resource{datastoreRef;constructor(scope2,id2,arn2){super(scope2,id2,{environmentFromArn:arn2});const variables=new(cfn_parse()).TemplateString("arn:${Partition}:medical-imaging:${Region}:${Account}:datastore/${DatastoreId}").parse(arn2);this.datastoreRef={datastoreId:variables.DatastoreId,datastoreArn:arn2}}}return new Import(scope,id,arn)}static fromDatastoreId(scope,id,datastoreId){class Import extends cdk().Resource{datastoreRef;constructor(scope2,id2,datastoreId2){const arn=new(cfn_parse()).TemplateString("arn:${Partition}:medical-imaging:${Region}:${Account}:datastore/${DatastoreId}").interpolate({Partition:cdk().Stack.of(scope2).partition,Region:cdk().Stack.of(scope2).region,Account:cdk().Stack.of(scope2).account,DatastoreId:datastoreId2});super(scope2,id2,{environmentFromArn:arn}),this.datastoreRef={datastoreId:datastoreId2,datastoreArn:arn}}}return new Import(scope,id,datastoreId)}static arnForDatastore(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_healthimaging_IDatastoreRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForDatastore),error}return resource.datastoreRef.datastoreArn}cdkTagManager;datastoreName;kmsKeyArn;tags;constructor(scope,id,props={}){super(scope,id,{type:CfnDatastore.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_healthimaging_CfnDatastoreProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnDatastore),error}this.cdkTagManager=new(cdk()).TagManager(cdk().TagType.MAP,"AWS::HealthImaging::Datastore",void 0,{tagPropertyName:"tags"}),this.datastoreName=props.datastoreName,this.kmsKeyArn=props.kmsKeyArn,this.tags=props.tags}get datastoreRef(){return{datastoreId:this.ref,datastoreArn:this.attrDatastoreArn}}get attrCreatedAt(){return cdk().Token.asString(this.getAtt("CreatedAt",cdk().ResolutionTypeHint.STRING))}get attrDatastoreArn(){return cdk().Token.asString(this.getAtt("DatastoreArn",cdk().ResolutionTypeHint.STRING))}get attrDatastoreId(){return cdk().Token.asString(this.getAtt("DatastoreId",cdk().ResolutionTypeHint.STRING))}get attrDatastoreStatus(){return cdk().Token.asString(this.getAtt("DatastoreStatus",cdk().ResolutionTypeHint.STRING))}get attrUpdatedAt(){return cdk().Token.asString(this.getAtt("UpdatedAt",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{tags:this.cdkTagManager.renderTags(this.tags),datastoreName:this.datastoreName,kmsKeyArn:this.kmsKeyArn}}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",CfnDatastore.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnDatastorePropsToCloudFormation(props)}}exports.CfnDatastore=CfnDatastore;function CfnDatastorePropsValidator(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("datastoreName",cdk().validateString)(properties.datastoreName)),errors.collect(cdk().propertyValidator("kmsKeyArn",cdk().validateString)(properties.kmsKeyArn)),errors.collect(cdk().propertyValidator("tags",cdk().hashValidator(cdk().validateString))(properties.tags)),errors.wrap('supplied properties not correct for "CfnDatastoreProps"')}function convertCfnDatastorePropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnDatastorePropsValidator(properties).assertSuccess(),{DatastoreName:cdk().stringToCloudFormation(properties.datastoreName),KmsKeyArn:cdk().stringToCloudFormation(properties.kmsKeyArn),Tags:cdk().hashMapper(cdk().stringToCloudFormation)(properties.tags)}):properties}function CfnDatastorePropsFromCloudFormation(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("datastoreName","DatastoreName",properties.DatastoreName!=null?cfn_parse().FromCloudFormation.getString(properties.DatastoreName):void 0),ret.addPropertyResult("kmsKeyArn","KmsKeyArn",properties.KmsKeyArn!=null?cfn_parse().FromCloudFormation.getString(properties.KmsKeyArn):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getMap(cfn_parse().FromCloudFormation.getString)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}