"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.CfnServerlessCachePropsMixin = exports.CfnUserGroupPropsMixin = exports.CfnUserPropsMixin = exports.CfnSubnetGroupPropsMixin = exports.CfnSecurityGroupIngressPropsMixin = exports.CfnSecurityGroupPropsMixin = exports.CfnReplicationGroupPropsMixin = exports.CfnParameterGroupPropsMixin = exports.CfnGlobalReplicationGroupPropsMixin = exports.CfnCacheClusterPropsMixin = 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-elasticache"));
/**
 * The `AWS::ElastiCache::CacheCluster` type creates an Amazon ElastiCache cache cluster.
 *
 * @cloudformationResource AWS::ElastiCache::CacheCluster
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-cachecluster.html
 */
class CfnCacheClusterPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnCacheClusterPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoMinorVersionUpgrade", "azMode", "cacheNodeType", "cacheParameterGroupName", "cacheSecurityGroupNames", "cacheSubnetGroupName", "clusterName", "engine", "engineVersion", "ipDiscovery", "logDeliveryConfigurations", "networkType", "notificationTopicArn", "numCacheNodes", "port", "preferredAvailabilityZone", "preferredAvailabilityZones", "preferredMaintenanceWindow", "snapshotArns", "snapshotName", "snapshotRetentionLimit", "snapshotWindow", "tags", "transitEncryptionEnabled", "vpcSecurityGroupIds"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::CacheCluster`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnCacheClusterMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnCacheClusterPropsMixin);
            }
            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.CfnCacheCluster.isCfnCacheCluster(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnCacheClusterPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnCacheClusterPropsMixin = CfnCacheClusterPropsMixin;
/**
 * Consists of a primary cluster that accepts writes and an associated secondary cluster that resides in a different Amazon region.
 *
 * The secondary cluster accepts only reads. The primary cluster automatically replicates updates to the secondary cluster.
 *
 * - The *GlobalReplicationGroupIdSuffix* represents the name of the Global datastore, which is what you use to associate a secondary cluster.
 *
 * @cloudformationResource AWS::ElastiCache::GlobalReplicationGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-globalreplicationgroup.html
 */
class CfnGlobalReplicationGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnGlobalReplicationGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["automaticFailoverEnabled", "cacheNodeType", "cacheParameterGroupName", "engine", "engineVersion", "globalNodeGroupCount", "globalReplicationGroupDescription", "globalReplicationGroupIdSuffix", "members", "regionalConfigurations"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::GlobalReplicationGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnGlobalReplicationGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnGlobalReplicationGroupPropsMixin);
            }
            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.CfnGlobalReplicationGroup.isCfnGlobalReplicationGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnGlobalReplicationGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnGlobalReplicationGroupPropsMixin = CfnGlobalReplicationGroupPropsMixin;
/**
 * The `AWS::ElastiCache::ParameterGroup` type creates a new cache parameter group.
 *
 * Cache parameter groups control the parameters for a cache cluster.
 *
 * @cloudformationResource AWS::ElastiCache::ParameterGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-parametergroup.html
 */
class CfnParameterGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnParameterGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["cacheParameterGroupFamily", "description", "properties", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::ParameterGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnParameterGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnParameterGroupPropsMixin);
            }
            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.CfnParameterGroup.isCfnParameterGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnParameterGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnParameterGroupPropsMixin = CfnParameterGroupPropsMixin;
/**
 * The `AWS::ElastiCache::ReplicationGroup` resource creates an Amazon ElastiCache (Valkey or Redis OSS) replication group.
 *
 * A Valkey or Redis OSS (cluster mode disabled) replication group is a collection of cache clusters, where one of the clusters is a primary read-write cluster and the others are read-only replicas.
 *
 * A Valkey or Redis OSS (cluster mode enabled) cluster is comprised of from 1 to 90 shards (API/CLI: node groups). Each shard has a primary node and up to 5 read-only replica nodes. The configuration can range from 90 shards and 0 replicas to 15 shards and 5 replicas, which is the maximum number or replicas allowed.
 *
 * The node or shard limit can be increased to a maximum of 500 per cluster if the engine version is Valkey 7.2 or higher, or Redis OSS 5.0.6 or higher. For example, you can choose to configure a 500 node cluster that ranges between 83 shards (one primary and 5 replicas per shard) and 500 shards (single primary and no replicas). Make sure there are enough available IP addresses to accommodate the increase. Common pitfalls include the subnets in the subnet group have too small a CIDR range or the subnets are shared and heavily used by other clusters. For more information, see [Creating a Subnet Group](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SubnetGroups.Creating.html) . For versions below 5.0.6, the limit is 250 per cluster.
 *
 * To request a limit increase, see [Amazon Service Limits](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) and choose the limit type *Nodes per cluster per instance type* .
 *
 * @cloudformationResource AWS::ElastiCache::ReplicationGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-replicationgroup.html
 */
class CfnReplicationGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnReplicationGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["atRestEncryptionEnabled", "authToken", "automaticFailoverEnabled", "autoMinorVersionUpgrade", "cacheNodeType", "cacheParameterGroupName", "cacheSecurityGroupNames", "cacheSubnetGroupName", "clusterMode", "dataTieringEnabled", "engine", "engineVersion", "globalReplicationGroupId", "ipDiscovery", "kmsKeyId", "logDeliveryConfigurations", "multiAzEnabled", "networkType", "nodeGroupConfiguration", "notificationTopicArn", "numCacheClusters", "numNodeGroups", "port", "preferredCacheClusterAZs", "preferredMaintenanceWindow", "primaryClusterId", "replicasPerNodeGroup", "replicationGroupDescription", "replicationGroupId", "securityGroupIds", "snapshotArns", "snapshotName", "snapshotRetentionLimit", "snapshottingClusterId", "snapshotWindow", "tags", "transitEncryptionEnabled", "transitEncryptionMode", "userGroupIds"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::ReplicationGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnReplicationGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnReplicationGroupPropsMixin);
            }
            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.CfnReplicationGroup.isCfnReplicationGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnReplicationGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnReplicationGroupPropsMixin = CfnReplicationGroupPropsMixin;
/**
 * The `AWS::ElastiCache::SecurityGroup` resource creates a cache security group.
 *
 * For more information about cache security groups, go to [CacheSecurityGroups](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/VPCs.html) in the *Amazon ElastiCache User Guide* or go to [CreateCacheSecurityGroup](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheSecurityGroup.html) in the *Amazon ElastiCache API Reference Guide* .
 *
 * For more information, see [CreateCacheSubnetGroup](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheSubnetGroup.html) .
 *
 * @cloudformationResource AWS::ElastiCache::SecurityGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-securitygroup.html
 */
class CfnSecurityGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnSecurityGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::SecurityGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnSecurityGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnSecurityGroupPropsMixin);
            }
            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.CfnSecurityGroup.isCfnSecurityGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnSecurityGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnSecurityGroupPropsMixin = CfnSecurityGroupPropsMixin;
/**
 * The AWS::ElastiCache::SecurityGroupIngress type authorizes ingress to a cache security group from hosts in specified Amazon EC2 security groups.
 *
 * For more information about ElastiCache security group ingress, go to [AuthorizeCacheSecurityGroupIngress](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_AuthorizeCacheSecurityGroupIngress.html) in the *Amazon ElastiCache API Reference Guide* .
 *
 * > Updates are not supported.
 *
 * @cloudformationResource AWS::ElastiCache::SecurityGroupIngress
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-securitygroupingress.html
 */
class CfnSecurityGroupIngressPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnSecurityGroupIngressPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["cacheSecurityGroupName", "ec2SecurityGroupName", "ec2SecurityGroupOwnerId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::SecurityGroupIngress`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnSecurityGroupIngressMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnSecurityGroupIngressPropsMixin);
            }
            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.CfnSecurityGroupIngress.isCfnSecurityGroupIngress(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnSecurityGroupIngressPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnSecurityGroupIngressPropsMixin = CfnSecurityGroupIngressPropsMixin;
/**
 * Creates a cache subnet group.
 *
 * For more information about cache subnet groups, go to Cache Subnet Groups in the *Amazon ElastiCache User Guide* or go to [CreateCacheSubnetGroup](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheSubnetGroup.html) in the *Amazon ElastiCache API Reference Guide* .
 *
 * @cloudformationResource AWS::ElastiCache::SubnetGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-subnetgroup.html
 */
class CfnSubnetGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnSubnetGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["cacheSubnetGroupName", "description", "subnetIds", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::SubnetGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnSubnetGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnSubnetGroupPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnSubnetGroupMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnSubnetGroup.isCfnSubnetGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnSubnetGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnSubnetGroupPropsMixin = CfnSubnetGroupPropsMixin;
// @ts-ignore TS6133
function flattenCfnSubnetGroupMixinProps(props) {
    const ret = {};
    if ((props.subnetIds !== undefined))
        ret.subnetIds = cdk.mapArrayInPlace(props.subnetIds, (item) => cdk.getRefProperty(item?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(item, "subnetIds", "ec2.ISubnetRef | string"));
    return ret;
}
/**
 * For Valkey 7.2 and onwards, or Redis OSS engine version 6.0 and onwards: Creates user. For more information, see [Using Role Based Access Control (RBAC)](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.RBAC.html) .
 *
 * @cloudformationResource AWS::ElastiCache::User
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-user.html
 */
class CfnUserPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnUserPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["accessString", "authenticationMode", "engine", "noPasswordRequired", "passwords", "tags", "userId", "userName"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::User`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnUserMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnUserPropsMixin);
            }
            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.CfnUser.isCfnUser(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnUserPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnUserPropsMixin = CfnUserPropsMixin;
/**
 * For Valkey 7.2 and onwards, or Redis OSS 6.0 and onwards: Creates a user group. For more information, see [Using Role Based Access Control (RBAC)](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.RBAC.html).
 *
 * @cloudformationResource AWS::ElastiCache::UserGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-usergroup.html
 */
class CfnUserGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnUserGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["engine", "tags", "userGroupId", "userIds"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::UserGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnUserGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnUserGroupPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnUserGroupMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnUserGroup.isCfnUserGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnUserGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnUserGroupPropsMixin = CfnUserGroupPropsMixin;
// @ts-ignore TS6133
function flattenCfnUserGroupMixinProps(props) {
    const ret = {};
    if ((props.userIds !== undefined))
        ret.userIds = props.userIds;
    return ret;
}
/**
 * The resource representing a serverless cache.
 *
 * @cloudformationResource AWS::ElastiCache::ServerlessCache
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-serverlesscache.html
 */
class CfnServerlessCachePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticache.CfnServerlessCachePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["cacheUsageLimits", "dailySnapshotTime", "description", "endpoint", "engine", "finalSnapshotName", "kmsKeyId", "majorEngineVersion", "networkType", "readerEndpoint", "securityGroupIds", "serverlessCacheName", "snapshotArnsToRestore", "snapshotRetentionLimit", "subnetIds", "tags", "userGroupId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElastiCache::ServerlessCache`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticache_CfnServerlessCacheMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnServerlessCachePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnServerlessCacheMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnServerlessCache.isCfnServerlessCache(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnServerlessCachePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnServerlessCachePropsMixin = CfnServerlessCachePropsMixin;
// @ts-ignore TS6133
function flattenCfnServerlessCacheMixinProps(props) {
    const ret = {};
    if ((props.kmsKeyId !== undefined))
        ret.kmsKeyId = cdk.getRefProperty(props.kmsKeyId?.keyRef, 'keyId') ?? cdk.ensureStringOrUndefined(props.kmsKeyId, "kmsKeyId", "kms.IKeyRef | string");
    if ((props.securityGroupIds !== undefined))
        ret.securityGroupIds = cdk.mapArrayInPlace(props.securityGroupIds, (item) => cdk.getRefProperty(item?.securityGroupRef, 'securityGroupId') ?? cdk.ensureStringOrUndefined(item, "securityGroupIds", "ec2.ISecurityGroupRef | string"));
    if ((props.subnetIds !== undefined))
        ret.subnetIds = cdk.mapArrayInPlace(props.subnetIds, (item) => cdk.getRefProperty(item?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(item, "subnetIds", "ec2.ISubnetRef | string"));
    if ((props.userGroupId !== undefined))
        ret.userGroupId = cdk.getRefProperty(props.userGroupId?.userGroupRef, 'userGroupId') ?? cdk.ensureStringOrUndefined(props.userGroupId, "userGroupId", "elasticache.IUserGroupRef | string");
    return ret;
}
