UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 13.6 kB
"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnView=exports.CfnIndex=exports.CfnDefaultViewAssociation=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 CfnDefaultViewAssociationPropsValidator(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("viewArn",cdk.requiredValidator)(properties.viewArn)),errors.collect(cdk.propertyValidator("viewArn",cdk.validateString)(properties.viewArn)),errors.wrap('supplied properties not correct for "CfnDefaultViewAssociationProps"')}function cfnDefaultViewAssociationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnDefaultViewAssociationPropsValidator(properties).assertSuccess(),{ViewArn:cdk.stringToCloudFormation(properties.viewArn)}):properties}function CfnDefaultViewAssociationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("viewArn","ViewArn",cfn_parse.FromCloudFormation.getString(properties.ViewArn)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnDefaultViewAssociation extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnDefaultViewAssociation.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_resourceexplorer2_CfnDefaultViewAssociationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnDefaultViewAssociation),error}cdk.requireProperty(props,"viewArn",this),this.attrAssociatedAwsPrincipal=cdk.Token.asString(this.getAtt("AssociatedAwsPrincipal",cdk.ResolutionTypeHint.STRING)),this.viewArn=props.viewArn}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnDefaultViewAssociationPropsFromCloudFormation(resourceProperties),ret=new CfnDefaultViewAssociation(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",CfnDefaultViewAssociation.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{viewArn:this.viewArn}}renderProperties(props){return cfnDefaultViewAssociationPropsToCloudFormation(props)}}exports.CfnDefaultViewAssociation=CfnDefaultViewAssociation,_a=JSII_RTTI_SYMBOL_1,CfnDefaultViewAssociation[_a]={fqn:"aws-cdk-lib.aws_resourceexplorer2.CfnDefaultViewAssociation",version:"2.70.0"},CfnDefaultViewAssociation.CFN_RESOURCE_TYPE_NAME="AWS::ResourceExplorer2::DefaultViewAssociation";function CfnIndexPropsValidator(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("tags",cdk.hashValidator(cdk.validateString))(properties.tags)),errors.collect(cdk.propertyValidator("type",cdk.requiredValidator)(properties.type)),errors.collect(cdk.propertyValidator("type",cdk.validateString)(properties.type)),errors.wrap('supplied properties not correct for "CfnIndexProps"')}function cfnIndexPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnIndexPropsValidator(properties).assertSuccess(),{Type:cdk.stringToCloudFormation(properties.type),Tags:cdk.hashMapper(cdk.stringToCloudFormation)(properties.tags)}):properties}function CfnIndexPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("type","Type",cfn_parse.FromCloudFormation.getString(properties.Type)),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getMap(cfn_parse.FromCloudFormation.getString)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnIndex extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnIndex.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_resourceexplorer2_CfnIndexProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnIndex),error}cdk.requireProperty(props,"type",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.attrIndexState=cdk.Token.asString(this.getAtt("IndexState",cdk.ResolutionTypeHint.STRING)),this.type=props.type,this.tags=new cdk.TagManager(cdk.TagType.MAP,"AWS::ResourceExplorer2::Index",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnIndexPropsFromCloudFormation(resourceProperties),ret=new CfnIndex(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",CfnIndex.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{type:this.type,tags:this.tags.renderTags()}}renderProperties(props){return cfnIndexPropsToCloudFormation(props)}}exports.CfnIndex=CfnIndex,_b=JSII_RTTI_SYMBOL_1,CfnIndex[_b]={fqn:"aws-cdk-lib.aws_resourceexplorer2.CfnIndex",version:"2.70.0"},CfnIndex.CFN_RESOURCE_TYPE_NAME="AWS::ResourceExplorer2::Index";function CfnViewPropsValidator(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("filters",CfnView_FiltersPropertyValidator)(properties.filters)),errors.collect(cdk.propertyValidator("includedProperties",cdk.listValidator(CfnView_IncludedPropertyPropertyValidator))(properties.includedProperties)),errors.collect(cdk.propertyValidator("tags",cdk.hashValidator(cdk.validateString))(properties.tags)),errors.collect(cdk.propertyValidator("viewName",cdk.requiredValidator)(properties.viewName)),errors.collect(cdk.propertyValidator("viewName",cdk.validateString)(properties.viewName)),errors.wrap('supplied properties not correct for "CfnViewProps"')}function cfnViewPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnViewPropsValidator(properties).assertSuccess(),{ViewName:cdk.stringToCloudFormation(properties.viewName),Filters:cfnViewFiltersPropertyToCloudFormation(properties.filters),IncludedProperties:cdk.listMapper(cfnViewIncludedPropertyPropertyToCloudFormation)(properties.includedProperties),Tags:cdk.hashMapper(cdk.stringToCloudFormation)(properties.tags)}):properties}function CfnViewPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("viewName","ViewName",cfn_parse.FromCloudFormation.getString(properties.ViewName)),ret.addPropertyResult("filters","Filters",properties.Filters!=null?CfnViewFiltersPropertyFromCloudFormation(properties.Filters):void 0),ret.addPropertyResult("includedProperties","IncludedProperties",properties.IncludedProperties!=null?cfn_parse.FromCloudFormation.getArray(CfnViewIncludedPropertyPropertyFromCloudFormation)(properties.IncludedProperties):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}class CfnView extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnView.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_resourceexplorer2_CfnViewProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnView),error}cdk.requireProperty(props,"viewName",this),this.attrViewArn=cdk.Token.asString(this.getAtt("ViewArn",cdk.ResolutionTypeHint.STRING)),this.viewName=props.viewName,this.filters=props.filters,this.includedProperties=props.includedProperties,this.tags=new cdk.TagManager(cdk.TagType.MAP,"AWS::ResourceExplorer2::View",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnViewPropsFromCloudFormation(resourceProperties),ret=new CfnView(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",CfnView.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{viewName:this.viewName,filters:this.filters,includedProperties:this.includedProperties,tags:this.tags.renderTags()}}renderProperties(props){return cfnViewPropsToCloudFormation(props)}}exports.CfnView=CfnView,_c=JSII_RTTI_SYMBOL_1,CfnView[_c]={fqn:"aws-cdk-lib.aws_resourceexplorer2.CfnView",version:"2.70.0"},CfnView.CFN_RESOURCE_TYPE_NAME="AWS::ResourceExplorer2::View";function CfnView_FiltersPropertyValidator(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("filterString",cdk.requiredValidator)(properties.filterString)),errors.collect(cdk.propertyValidator("filterString",cdk.validateString)(properties.filterString)),errors.wrap('supplied properties not correct for "FiltersProperty"')}function cfnViewFiltersPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnView_FiltersPropertyValidator(properties).assertSuccess(),{FilterString:cdk.stringToCloudFormation(properties.filterString)}):properties}function CfnViewFiltersPropertyFromCloudFormation(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("filterString","FilterString",cfn_parse.FromCloudFormation.getString(properties.FilterString)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnView_IncludedPropertyPropertyValidator(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.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.wrap('supplied properties not correct for "IncludedPropertyProperty"')}function cfnViewIncludedPropertyPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnView_IncludedPropertyPropertyValidator(properties).assertSuccess(),{Name:cdk.stringToCloudFormation(properties.name)}):properties}function CfnViewIncludedPropertyPropertyFromCloudFormation(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("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}