"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnEnabledControl=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");class CfnEnabledControl extends cdk.CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnEnabledControlPropsFromCloudFormation(resourceProperties);if(cdk.isResolvableObject(propsResult.value))throw new Error("Unexpected IResolvable");const ret=new CfnEnabledControl(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}constructor(scope,id,props){super(scope,id,{type:CfnEnabledControl.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_controltower_CfnEnabledControlProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnEnabledControl),error}cdk.requireProperty(props,"controlIdentifier",this),cdk.requireProperty(props,"targetIdentifier",this),this.controlIdentifier=props.controlIdentifier,this.targetIdentifier=props.targetIdentifier}get cfnProperties(){return{controlIdentifier:this.controlIdentifier,targetIdentifier:this.targetIdentifier}}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",CfnEnabledControl.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnEnabledControlPropsToCloudFormation(props)}}exports.CfnEnabledControl=CfnEnabledControl,_a=JSII_RTTI_SYMBOL_1,CfnEnabledControl[_a]={fqn:"aws-cdk-lib.aws_controltower.CfnEnabledControl",version:"2.96.1"},CfnEnabledControl.CFN_RESOURCE_TYPE_NAME="AWS::ControlTower::EnabledControl";function CfnEnabledControlPropsValidator(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("controlIdentifier",cdk.requiredValidator)(properties.controlIdentifier)),errors.collect(cdk.propertyValidator("controlIdentifier",cdk.validateString)(properties.controlIdentifier)),errors.collect(cdk.propertyValidator("targetIdentifier",cdk.requiredValidator)(properties.targetIdentifier)),errors.collect(cdk.propertyValidator("targetIdentifier",cdk.validateString)(properties.targetIdentifier)),errors.wrap('supplied properties not correct for "CfnEnabledControlProps"')}function convertCfnEnabledControlPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnEnabledControlPropsValidator(properties).assertSuccess(),{ControlIdentifier:cdk.stringToCloudFormation(properties.controlIdentifier),TargetIdentifier:cdk.stringToCloudFormation(properties.targetIdentifier)}):properties}function CfnEnabledControlPropsFromCloudFormation(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("controlIdentifier","ControlIdentifier",properties.ControlIdentifier!=null?cfn_parse.FromCloudFormation.getString(properties.ControlIdentifier):void 0),ret.addPropertyResult("targetIdentifier","TargetIdentifier",properties.TargetIdentifier!=null?cfn_parse.FromCloudFormation.getString(properties.TargetIdentifier):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}
