"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CfnSimpleADPropsMixin = exports.CfnMicrosoftADPropsMixin = void 0;
const jsiiDeprecationWarnings = require("../../../.warnings.jsii.js");
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
/* eslint-disable @stylistic/max-len, eol-last */
const cdk = __importStar(require("aws-cdk-lib/core"));
const service = __importStar(require("aws-cdk-lib/aws-directoryservice"));
/**
 * The `AWS::DirectoryService::MicrosoftAD` resource specifies a Microsoft Active Directory in AWS so that your directory users and groups can access the AWS Management Console and AWS applications using their existing credentials.
 *
 * For more information, see [AWS Managed Microsoft AD](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html) in the *Directory Service Admin Guide* .
 *
 * @cloudformationResource AWS::DirectoryService::MicrosoftAD
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html
 */
class CfnMicrosoftADPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_directoryservice.CfnMicrosoftADPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["createAlias", "edition", "enableSso", "name", "password", "shortName", "vpcSettings"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::DirectoryService::MicrosoftAD`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_directoryservice_CfnMicrosoftADMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnMicrosoftADPropsMixin);
            }
            throw error;
        }
        this.props = props;
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnMicrosoftAD.isCfnMicrosoftAD(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnMicrosoftADPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnMicrosoftADPropsMixin = CfnMicrosoftADPropsMixin;
/**
 * The `AWS::DirectoryService::SimpleAD` resource specifies an Directory Service Simple Active Directory ( Simple AD ) in AWS so that your directory users and groups can access the AWS Management Console and AWS applications using their existing credentials.
 *
 * Simple AD is a Microsoft Active Directory–compatible directory. For more information, see [Simple Active Directory](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_simple_ad.html) in the *Directory Service Admin Guide* .
 *
 * @cloudformationResource AWS::DirectoryService::SimpleAD
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html
 */
class CfnSimpleADPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_directoryservice.CfnSimpleADPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["createAlias", "description", "enableSso", "name", "password", "shortName", "size", "tags", "vpcSettings"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::DirectoryService::SimpleAD`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_directoryservice_CfnSimpleADMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnSimpleADPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnSimpleADMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnSimpleAD.isCfnSimpleAD(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnSimpleADPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnSimpleADPropsMixin = CfnSimpleADPropsMixin;
// @ts-ignore TS6133
function flattenCfnSimpleADPropsMixinVpcSettingsProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        subnetIds: (!props.subnetIds ? undefined : cdk.mapArrayInPlace(props.subnetIds, (item) => cdk.getRefProperty(item?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(item, "subnetIds", "ec2.ISubnetRef | string"))),
        vpcId: (!props.vpcId ? undefined : cdk.getRefProperty(props.vpcId?.vpcRef, 'vpcId') ?? cdk.ensureStringOrUndefined(props.vpcId, "vpcId", "ec2.IVPCRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnSimpleADMixinProps(props) {
    const ret = {};
    if ((props.vpcSettings !== undefined))
        ret.vpcSettings = flattenCfnSimpleADPropsMixinVpcSettingsProperty(props.vpcSettings);
    return ret;
}
