UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 29.8 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnResourcePolicy=exports.CfnPolicy=exports.CfnOrganizationalUnit=exports.CfnOrganization=exports.CfnAccount=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 CfnAccount extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_organizations.CfnAccount",version:"2.251.0"};static CFN_RESOURCE_TYPE_NAME="AWS::Organizations::Account";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnAccountPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnAccount(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 isCfnAccount(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnAccount.CFN_RESOURCE_TYPE_NAME}static arnForAccount(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_organizations_IAccountRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForAccount),error}return resource.accountRef.accountArn}_accountName;_email;_parentIds;_roleName;tags;_tagsRaw;constructor(scope,id,props){super(scope,id,{type:CfnAccount.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_organizations_CfnAccountProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnAccount),error}cdk().requireProperty(props,"accountName",this),cdk().requireProperty(props,"email",this),this._accountName=props.accountName,this._email=props.email,this._parentIds=props.parentIds,this._roleName=props.roleName,this.tags=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::Organizations::Account",props.tags,{tagPropertyName:"tags"}),this._tagsRaw=props.tags,this.node.scope!=null&&cdk().Resource.isResource(this.node.scope)&&this.node.addValidation({validate:()=>this.cfnOptions.deletionPolicy===void 0?["'AWS::Organizations::Account' is a stateful resource type, and you must specify a Removal Policy for it. Call 'resource.applyRemovalPolicy()'."]:[]})}get accountRef(){return{accountId:this.ref,accountArn:this.attrArn}}get accountName(){return this._accountName}set accountName(value){cdk().traceProperty(this.node,"AccountName"),this._accountName=value}get email(){return this._email}set email(value){cdk().traceProperty(this.node,"Email"),this._email=value}get parentIds(){return this._parentIds}set parentIds(value){cdk().traceProperty(this.node,"ParentIds"),this._parentIds=value}get roleName(){return this._roleName}set roleName(value){cdk().traceProperty(this.node,"RoleName"),this._roleName=value}get tagsRaw(){return this._tagsRaw}set tagsRaw(value){cdk().traceProperty(this.node,"Tags"),this._tagsRaw=value}get attrAccountId(){return cdk().Token.asString(this.getAtt("AccountId",cdk().ResolutionTypeHint.STRING))}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrJoinedMethod(){return cdk().Token.asString(this.getAtt("JoinedMethod",cdk().ResolutionTypeHint.STRING))}get attrJoinedTimestamp(){return cdk().Token.asString(this.getAtt("JoinedTimestamp",cdk().ResolutionTypeHint.STRING))}get attrPaths(){return cdk().Token.asList(this.getAtt("Paths",cdk().ResolutionTypeHint.STRING_LIST))}get attrState(){return cdk().Token.asString(this.getAtt("State",cdk().ResolutionTypeHint.STRING))}get attrStatus(){return cdk().Token.asString(this.getAtt("Status",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{accountName:this._accountName,email:this._email,parentIds:this._parentIds,roleName:this._roleName,tags:this.tags.renderTags()}}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",CfnAccount.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnAccountPropsToCloudFormation(props)}}exports.CfnAccount=CfnAccount;function CfnAccountPropsValidator(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("accountName",cdk().requiredValidator)(properties.accountName)),errors.collect(cdk().propertyValidator("accountName",cdk().validateString)(properties.accountName)),errors.collect(cdk().propertyValidator("email",cdk().requiredValidator)(properties.email)),errors.collect(cdk().propertyValidator("email",cdk().validateString)(properties.email)),errors.collect(cdk().propertyValidator("parentIds",cdk().listValidator(cdk().validateString))(properties.parentIds)),errors.collect(cdk().propertyValidator("roleName",cdk().validateString)(properties.roleName)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnAccountProps"')}function convertCfnAccountPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnAccountPropsValidator(properties).assertSuccess(),{AccountName:cdk().stringToCloudFormation(properties.accountName),Email:cdk().stringToCloudFormation(properties.email),ParentIds:cdk().listMapper(cdk().stringToCloudFormation)(properties.parentIds),RoleName:cdk().stringToCloudFormation(properties.roleName),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnAccountPropsFromCloudFormation(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("accountName","AccountName",properties.AccountName!=null?cfn_parse().FromCloudFormation.getString(properties.AccountName):void 0),ret.addPropertyResult("email","Email",properties.Email!=null?cfn_parse().FromCloudFormation.getString(properties.Email):void 0),ret.addPropertyResult("parentIds","ParentIds",properties.ParentIds!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getString)(properties.ParentIds):void 0),ret.addPropertyResult("roleName","RoleName",properties.RoleName!=null?cfn_parse().FromCloudFormation.getString(properties.RoleName):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnOrganization extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_organizations.CfnOrganization",version:"2.251.0"};static CFN_RESOURCE_TYPE_NAME="AWS::Organizations::Organization";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnOrganizationPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnOrganization(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 isCfnOrganization(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnOrganization.CFN_RESOURCE_TYPE_NAME}static arnForOrganization(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_organizations_IOrganizationRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForOrganization),error}return resource.organizationRef.organizationArn}_featureSet;constructor(scope,id,props={}){super(scope,id,{type:CfnOrganization.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_organizations_CfnOrganizationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnOrganization),error}this._featureSet=props.featureSet}get organizationRef(){return{organizationId:this.ref,organizationArn:this.attrArn}}get featureSet(){return this._featureSet}set featureSet(value){cdk().traceProperty(this.node,"FeatureSet"),this._featureSet=value}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrId(){return cdk().Token.asString(this.getAtt("Id",cdk().ResolutionTypeHint.STRING))}get attrManagementAccountArn(){return cdk().Token.asString(this.getAtt("ManagementAccountArn",cdk().ResolutionTypeHint.STRING))}get attrManagementAccountEmail(){return cdk().Token.asString(this.getAtt("ManagementAccountEmail",cdk().ResolutionTypeHint.STRING))}get attrManagementAccountId(){return cdk().Token.asString(this.getAtt("ManagementAccountId",cdk().ResolutionTypeHint.STRING))}get attrRootId(){return cdk().Token.asString(this.getAtt("RootId",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{featureSet:this._featureSet}}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",CfnOrganization.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnOrganizationPropsToCloudFormation(props)}}exports.CfnOrganization=CfnOrganization;function CfnOrganizationPropsValidator(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("featureSet",cdk().validateString)(properties.featureSet)),errors.wrap('supplied properties not correct for "CfnOrganizationProps"')}function convertCfnOrganizationPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnOrganizationPropsValidator(properties).assertSuccess(),{FeatureSet:cdk().stringToCloudFormation(properties.featureSet)}):properties}function CfnOrganizationPropsFromCloudFormation(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("featureSet","FeatureSet",properties.FeatureSet!=null?cfn_parse().FromCloudFormation.getString(properties.FeatureSet):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnOrganizationalUnit extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_organizations.CfnOrganizationalUnit",version:"2.251.0"};static CFN_RESOURCE_TYPE_NAME="AWS::Organizations::OrganizationalUnit";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnOrganizationalUnitPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnOrganizationalUnit(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 isCfnOrganizationalUnit(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnOrganizationalUnit.CFN_RESOURCE_TYPE_NAME}static arnForOrganizationalUnit(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_organizations_IOrganizationalUnitRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForOrganizationalUnit),error}return resource.organizationalUnitRef.organizationalUnitArn}_name;_parentId;tags;_tagsRaw;constructor(scope,id,props){super(scope,id,{type:CfnOrganizationalUnit.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_organizations_CfnOrganizationalUnitProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnOrganizationalUnit),error}cdk().requireProperty(props,"name",this),cdk().requireProperty(props,"parentId",this),this._name=props.name,this._parentId=props.parentId,this.tags=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::Organizations::OrganizationalUnit",props.tags,{tagPropertyName:"tags"}),this._tagsRaw=props.tags}get organizationalUnitRef(){return{organizationalUnitId:this.ref,organizationalUnitArn:this.attrArn}}get name(){return this._name}set name(value){cdk().traceProperty(this.node,"Name"),this._name=value}get parentId(){return this._parentId}set parentId(value){cdk().traceProperty(this.node,"ParentId"),this._parentId=value}get tagsRaw(){return this._tagsRaw}set tagsRaw(value){cdk().traceProperty(this.node,"Tags"),this._tagsRaw=value}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrId(){return cdk().Token.asString(this.getAtt("Id",cdk().ResolutionTypeHint.STRING))}get attrPath(){return cdk().Token.asString(this.getAtt("Path",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{name:this._name,parentId:this._parentId,tags:this.tags.renderTags()}}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",CfnOrganizationalUnit.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnOrganizationalUnitPropsToCloudFormation(props)}}exports.CfnOrganizationalUnit=CfnOrganizationalUnit;function CfnOrganizationalUnitPropsValidator(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("name",cdk().requiredValidator)(properties.name)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("parentId",cdk().requiredValidator)(properties.parentId)),errors.collect(cdk().propertyValidator("parentId",cdk().validateString)(properties.parentId)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnOrganizationalUnitProps"')}function convertCfnOrganizationalUnitPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnOrganizationalUnitPropsValidator(properties).assertSuccess(),{Name:cdk().stringToCloudFormation(properties.name),ParentId:cdk().stringToCloudFormation(properties.parentId),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnOrganizationalUnitPropsFromCloudFormation(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("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("parentId","ParentId",properties.ParentId!=null?cfn_parse().FromCloudFormation.getString(properties.ParentId):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnPolicy extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_organizations.CfnPolicy",version:"2.251.0"};static CFN_RESOURCE_TYPE_NAME="AWS::Organizations::Policy";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnPolicyPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnPolicy(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 isCfnPolicy(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnPolicy.CFN_RESOURCE_TYPE_NAME}static arnForPolicy(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_organizations_IPolicyRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForPolicy),error}return resource.policyRef.policyArn}_content;_description;_name;tags;_tagsRaw;_targetIds;_type;constructor(scope,id,props){super(scope,id,{type:CfnPolicy.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_organizations_CfnPolicyProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnPolicy),error}cdk().requireProperty(props,"content",this),cdk().requireProperty(props,"name",this),cdk().requireProperty(props,"type",this),this._content=props.content,this._description=props.description,this._name=props.name,this.tags=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::Organizations::Policy",props.tags,{tagPropertyName:"tags"}),this._tagsRaw=props.tags,this._targetIds=props.targetIds,this._type=props.type}get policyRef(){return{policyId:this.ref,policyArn:this.attrArn}}get content(){return this._content}set content(value){cdk().traceProperty(this.node,"Content"),this._content=value}get description(){return this._description}set description(value){cdk().traceProperty(this.node,"Description"),this._description=value}get name(){return this._name}set name(value){cdk().traceProperty(this.node,"Name"),this._name=value}get tagsRaw(){return this._tagsRaw}set tagsRaw(value){cdk().traceProperty(this.node,"Tags"),this._tagsRaw=value}get targetIds(){return this._targetIds}set targetIds(value){cdk().traceProperty(this.node,"TargetIds"),this._targetIds=value}get type(){return this._type}set type(value){cdk().traceProperty(this.node,"Type"),this._type=value}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrAwsManaged(){return this.getAtt("AwsManaged")}get attrId(){return cdk().Token.asString(this.getAtt("Id",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{content:this._content,description:this._description,name:this._name,tags:this.tags.renderTags(),targetIds:this._targetIds,type:this._type}}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",CfnPolicy.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnPolicyPropsToCloudFormation(props)}}exports.CfnPolicy=CfnPolicy;function CfnPolicyPropsValidator(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("content",cdk().requiredValidator)(properties.content)),errors.collect(cdk().propertyValidator("content",cdk().validateObject)(properties.content)),errors.collect(cdk().propertyValidator("description",cdk().validateString)(properties.description)),errors.collect(cdk().propertyValidator("name",cdk().requiredValidator)(properties.name)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.collect(cdk().propertyValidator("targetIds",cdk().listValidator(cdk().validateString))(properties.targetIds)),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 "CfnPolicyProps"')}function convertCfnPolicyPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnPolicyPropsValidator(properties).assertSuccess(),{Content:cdk().objectToCloudFormation(properties.content),Description:cdk().stringToCloudFormation(properties.description),Name:cdk().stringToCloudFormation(properties.name),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags),TargetIds:cdk().listMapper(cdk().stringToCloudFormation)(properties.targetIds),Type:cdk().stringToCloudFormation(properties.type)}):properties}function CfnPolicyPropsFromCloudFormation(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("content","Content",properties.Content!=null?cfn_parse().FromCloudFormation.getAny(properties.Content):void 0),ret.addPropertyResult("description","Description",properties.Description!=null?cfn_parse().FromCloudFormation.getString(properties.Description):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addPropertyResult("targetIds","TargetIds",properties.TargetIds!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getString)(properties.TargetIds):void 0),ret.addPropertyResult("type","Type",properties.Type!=null?cfn_parse().FromCloudFormation.getString(properties.Type):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnResourcePolicy extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_organizations.CfnResourcePolicy",version:"2.251.0"};static CFN_RESOURCE_TYPE_NAME="AWS::Organizations::ResourcePolicy";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnResourcePolicyPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnResourcePolicy(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 isCfnResourcePolicy(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME}static arnForResourcePolicy(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_organizations_IResourcePolicyRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForResourcePolicy),error}return resource.resourcePolicyRef.resourcePolicyArn}_content;tags;_tagsRaw;constructor(scope,id,props){super(scope,id,{type:CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_organizations_CfnResourcePolicyProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnResourcePolicy),error}cdk().requireProperty(props,"content",this),this._content=props.content,this.tags=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::Organizations::ResourcePolicy",props.tags,{tagPropertyName:"tags"}),this._tagsRaw=props.tags}get resourcePolicyRef(){return{resourcePolicyId:this.ref,resourcePolicyArn:this.attrArn}}get content(){return this._content}set content(value){cdk().traceProperty(this.node,"Content"),this._content=value}get tagsRaw(){return this._tagsRaw}set tagsRaw(value){cdk().traceProperty(this.node,"Tags"),this._tagsRaw=value}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrId(){return cdk().Token.asString(this.getAtt("Id",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{content:this._content,tags:this.tags.renderTags()}}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",CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnResourcePolicyPropsToCloudFormation(props)}}exports.CfnResourcePolicy=CfnResourcePolicy;function CfnResourcePolicyPropsValidator(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("content",cdk().requiredValidator)(properties.content)),errors.collect(cdk().propertyValidator("content",cdk().validateObject)(properties.content)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnResourcePolicyProps"')}function convertCfnResourcePolicyPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnResourcePolicyPropsValidator(properties).assertSuccess(),{Content:cdk().objectToCloudFormation(properties.content),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnResourcePolicyPropsFromCloudFormation(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("content","Content",properties.Content!=null?cfn_parse().FromCloudFormation.getAny(properties.Content):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}