"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.CfnMountTargetPropsMixin = exports.CfnFileSystemPropsMixin = exports.CfnAccessPointPropsMixin = 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-efs"));
/**
 * The `AWS::EFS::AccessPoint` resource creates an EFS access point.
 *
 * An access point is an application-specific view into an EFS file system that applies an operating system user and group, and a file system path, to any file system request made through the access point. The operating system user and group override any identity information provided by the NFS client. The file system path is exposed as the access point's root directory. Applications using the access point can only access data in its own directory and below. To learn more, see [Mounting a file system using EFS access points](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html) .
 *
 * This operation requires permissions for the `elasticfilesystem:CreateAccessPoint` action.
 *
 * @cloudformationResource AWS::EFS::AccessPoint
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-accesspoint.html
 */
class CfnAccessPointPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_efs.CfnAccessPointPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["accessPointTags", "clientToken", "fileSystemId", "posixUser", "rootDirectory"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::EFS::AccessPoint`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_efs_CfnAccessPointMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAccessPointPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnAccessPointMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnAccessPoint.isCfnAccessPoint(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAccessPointPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAccessPointPropsMixin = CfnAccessPointPropsMixin;
// @ts-ignore TS6133
function flattenCfnAccessPointMixinProps(props) {
    const ret = {};
    if ((props.fileSystemId !== undefined))
        ret.fileSystemId = cdk.getRefProperty(props.fileSystemId?.fileSystemRef, 'fileSystemId') ?? cdk.ensureStringOrUndefined(props.fileSystemId, "fileSystemId", "efs.IFileSystemRef | string");
    return ret;
}
/**
 * The `AWS::EFS::FileSystem` resource creates a new, empty file system in Amazon Elastic File System ( Amazon EFS ).
 *
 * You must create a mount target ( [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) ) to mount your EFS file system on an Amazon EC2 or other AWS cloud compute resource.
 *
 * @cloudformationResource AWS::EFS::FileSystem
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-filesystem.html
 */
class CfnFileSystemPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_efs.CfnFileSystemPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["availabilityZoneName", "backupPolicy", "bypassPolicyLockoutSafetyCheck", "encrypted", "fileSystemPolicy", "fileSystemProtection", "fileSystemTags", "kmsKeyId", "lifecyclePolicies", "performanceMode", "provisionedThroughputInMibps", "replicationConfiguration", "throughputMode"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::EFS::FileSystem`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_efs_CfnFileSystemMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnFileSystemPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnFileSystemMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnFileSystem.isCfnFileSystem(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnFileSystemPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnFileSystemPropsMixin = CfnFileSystemPropsMixin;
// @ts-ignore TS6133
function flattenCfnFileSystemMixinProps(props) {
    const ret = {};
    if ((props.kmsKeyId !== undefined))
        ret.kmsKeyId = cdk.getRefProperty(props.kmsKeyId?.keyRef, 'keyArn') ?? cdk.ensureStringOrUndefined(props.kmsKeyId, "kmsKeyId", "kms.IKeyRef | string");
    return ret;
}
/**
 * The `AWS::EFS::MountTarget` resource is an Amazon EFS resource that creates a mount target for an EFS file system.
 *
 * You can then mount the file system on Amazon EC2 instances or other resources by using the mount target.
 *
 * @cloudformationResource AWS::EFS::MountTarget
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html
 */
class CfnMountTargetPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_efs.CfnMountTargetPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["fileSystemId", "ipAddress", "ipAddressType", "ipv6Address", "securityGroups", "subnetId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::EFS::MountTarget`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_efs_CfnMountTargetMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnMountTargetPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnMountTargetMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnMountTarget.isCfnMountTarget(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnMountTargetPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnMountTargetPropsMixin = CfnMountTargetPropsMixin;
// @ts-ignore TS6133
function flattenCfnMountTargetMixinProps(props) {
    const ret = {};
    if ((props.fileSystemId !== undefined))
        ret.fileSystemId = cdk.getRefProperty(props.fileSystemId?.fileSystemRef, 'fileSystemId') ?? cdk.ensureStringOrUndefined(props.fileSystemId, "fileSystemId", "efs.IFileSystemRef | string");
    if ((props.securityGroups !== undefined))
        ret.securityGroups = cdk.mapArrayInPlace(props.securityGroups, (item) => cdk.getRefProperty(item?.securityGroupRef, 'securityGroupId') ?? cdk.ensureStringOrUndefined(item, "securityGroups", "ec2.ISecurityGroupRef | string"));
    if ((props.subnetId !== undefined))
        ret.subnetId = cdk.getRefProperty(props.subnetId?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(props.subnetId, "subnetId", "ec2.ISubnetRef | string");
    return ret;
}
