"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.CfnTrustStoreRevocationPropsMixin = exports.CfnTrustStorePropsMixin = exports.CfnTargetGroupPropsMixin = exports.CfnLoadBalancerPropsMixin = exports.CfnListenerRulePropsMixin = exports.CfnListenerCertificatePropsMixin = exports.CfnListenerPropsMixin = 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-elasticloadbalancingv2"));
/**
 * Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
 *
 * @cloudformationResource AWS::ElasticLoadBalancingV2::Listener
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listener.html
 */
class CfnListenerPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticloadbalancingv2.CfnListenerPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["alpnPolicy", "certificates", "defaultActions", "listenerAttributes", "loadBalancerArn", "mutualAuthentication", "port", "protocol", "sslPolicy"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticLoadBalancingV2::Listener`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticloadbalancingv2_CfnListenerMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnListenerPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnListenerMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnListener.isCfnListener(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnListenerPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnListenerPropsMixin = CfnListenerPropsMixin;
// @ts-ignore TS6133
function flattenCfnListenerPropsMixinAuthenticateCognitoConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        authenticationRequestExtraParams: (!props.authenticationRequestExtraParams ? undefined : props.authenticationRequestExtraParams),
        onUnauthenticatedRequest: (!props.onUnauthenticatedRequest ? undefined : props.onUnauthenticatedRequest),
        scope: (!props.scope ? undefined : props.scope),
        sessionCookieName: (!props.sessionCookieName ? undefined : props.sessionCookieName),
        sessionTimeout: (!props.sessionTimeout ? undefined : props.sessionTimeout),
        userPoolArn: (!props.userPoolArn ? undefined : cdk.getRefProperty(props.userPoolArn?.userPoolRef, 'userPoolArn') ?? cdk.ensureStringOrUndefined(props.userPoolArn, "userPoolArn", "cognito.IUserPoolRef | string")),
        userPoolClientId: (!props.userPoolClientId ? undefined : cdk.getRefProperty(props.userPoolClientId?.userPoolClientRef, 'userPoolId') ?? cdk.getRefProperty(props.userPoolClientId?.userPoolClientRef, 'clientId') ?? cdk.ensureStringOrUndefined(props.userPoolClientId, "userPoolClientId", "cognito.IUserPoolClientRef | string")),
        userPoolDomain: (!props.userPoolDomain ? undefined : props.userPoolDomain)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerPropsMixinTargetGroupTupleProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        targetGroupArn: (!props.targetGroupArn ? undefined : cdk.getRefProperty(props.targetGroupArn?.targetGroupRef, 'targetGroupArn') ?? cdk.ensureStringOrUndefined(props.targetGroupArn, "targetGroupArn", "elasticloadbalancingv2.ITargetGroupRef | string")),
        weight: (!props.weight ? undefined : props.weight)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerPropsMixinForwardConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        targetGroups: (!props.targetGroups ? undefined : (cdk.isResolvableObject(props.targetGroups) ? props.targetGroups : (!props.targetGroups ? undefined : cdk.mapArrayInPlace(props.targetGroups, (item) => flattenCfnListenerPropsMixinTargetGroupTupleProperty(item))))),
        targetGroupStickinessConfig: (!props.targetGroupStickinessConfig ? undefined : props.targetGroupStickinessConfig)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerPropsMixinActionProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        authenticateCognitoConfig: (!props.authenticateCognitoConfig ? undefined : (!props.authenticateCognitoConfig ? undefined : flattenCfnListenerPropsMixinAuthenticateCognitoConfigProperty(props.authenticateCognitoConfig))),
        authenticateOidcConfig: (!props.authenticateOidcConfig ? undefined : props.authenticateOidcConfig),
        fixedResponseConfig: (!props.fixedResponseConfig ? undefined : props.fixedResponseConfig),
        forwardConfig: (!props.forwardConfig ? undefined : (!props.forwardConfig ? undefined : flattenCfnListenerPropsMixinForwardConfigProperty(props.forwardConfig))),
        jwtValidationConfig: (!props.jwtValidationConfig ? undefined : props.jwtValidationConfig),
        order: (!props.order ? undefined : props.order),
        redirectConfig: (!props.redirectConfig ? undefined : props.redirectConfig),
        targetGroupArn: (!props.targetGroupArn ? undefined : cdk.getRefProperty(props.targetGroupArn?.targetGroupRef, 'targetGroupArn') ?? cdk.ensureStringOrUndefined(props.targetGroupArn, "targetGroupArn", "elasticloadbalancingv2.ITargetGroupRef | string")),
        type: (!props.type ? undefined : props.type)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerPropsMixinCertificateProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        certificateArn: (!props.certificateArn ? undefined : cdk.getRefProperty(props.certificateArn?.serverCertificateRef, 'serverCertificateArn') ?? cdk.getRefProperty(props.certificateArn?.certificateRef, 'certificateId') ?? cdk.ensureStringOrUndefined(props.certificateArn, "certificateArn", "certificatemanager.ICertificateRef | iam.IServerCertificateRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnListenerMixinProps(props) {
    const ret = {};
    if ((props.certificates !== undefined))
        ret.certificates = (cdk.isResolvableObject(props.certificates) ? props.certificates : cdk.mapArrayInPlace(props.certificates, (item) => flattenCfnListenerPropsMixinCertificateProperty(item)));
    if ((props.defaultActions !== undefined))
        ret.defaultActions = (cdk.isResolvableObject(props.defaultActions) ? props.defaultActions : cdk.mapArrayInPlace(props.defaultActions, (item) => flattenCfnListenerPropsMixinActionProperty(item)));
    if ((props.loadBalancerArn !== undefined))
        ret.loadBalancerArn = cdk.getRefProperty(props.loadBalancerArn?.loadBalancerRef, 'loadBalancerArn') ?? cdk.ensureStringOrUndefined(props.loadBalancerArn, "loadBalancerArn", "elasticloadbalancingv2.ILoadBalancerRef | string");
    return ret;
}
/**
 * Specifies an SSL server certificate to add to the certificate list for an HTTPS or TLS listener.
 *
 * @cloudformationResource AWS::ElasticLoadBalancingV2::ListenerCertificate
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenercertificate.html
 */
class CfnListenerCertificatePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticloadbalancingv2.CfnListenerCertificatePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["certificates", "listenerArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticLoadBalancingV2::ListenerCertificate`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticloadbalancingv2_CfnListenerCertificateMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnListenerCertificatePropsMixin);
            }
            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.CfnListenerCertificate.isCfnListenerCertificate(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnListenerCertificatePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnListenerCertificatePropsMixin = CfnListenerCertificatePropsMixin;
/**
 * Specifies a listener rule.
 *
 * The listener must be associated with an Application Load Balancer. Each rule consists of a priority, one or more actions, and one or more conditions.
 *
 * For more information, see [Quotas for your Application Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) in the *User Guide for Application Load Balancers* .
 *
 * @cloudformationResource AWS::ElasticLoadBalancingV2::ListenerRule
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html
 */
class CfnListenerRulePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticloadbalancingv2.CfnListenerRulePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["actions", "conditions", "listenerArn", "priority", "transforms"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticLoadBalancingV2::ListenerRule`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticloadbalancingv2_CfnListenerRuleMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnListenerRulePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnListenerRuleMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnListenerRule.isCfnListenerRule(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnListenerRulePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnListenerRulePropsMixin = CfnListenerRulePropsMixin;
// @ts-ignore TS6133
function flattenCfnListenerRulePropsMixinAuthenticateCognitoConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        authenticationRequestExtraParams: (!props.authenticationRequestExtraParams ? undefined : props.authenticationRequestExtraParams),
        onUnauthenticatedRequest: (!props.onUnauthenticatedRequest ? undefined : props.onUnauthenticatedRequest),
        scope: (!props.scope ? undefined : props.scope),
        sessionCookieName: (!props.sessionCookieName ? undefined : props.sessionCookieName),
        sessionTimeout: (!props.sessionTimeout ? undefined : props.sessionTimeout),
        userPoolArn: (!props.userPoolArn ? undefined : cdk.getRefProperty(props.userPoolArn?.userPoolRef, 'userPoolArn') ?? cdk.ensureStringOrUndefined(props.userPoolArn, "userPoolArn", "cognito.IUserPoolRef | string")),
        userPoolClientId: (!props.userPoolClientId ? undefined : cdk.getRefProperty(props.userPoolClientId?.userPoolClientRef, 'clientId') ?? cdk.ensureStringOrUndefined(props.userPoolClientId, "userPoolClientId", "cognito.IUserPoolClientRef | string")),
        userPoolDomain: (!props.userPoolDomain ? undefined : props.userPoolDomain)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerRulePropsMixinTargetGroupTupleProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        targetGroupArn: (!props.targetGroupArn ? undefined : cdk.getRefProperty(props.targetGroupArn?.targetGroupRef, 'targetGroupArn') ?? cdk.ensureStringOrUndefined(props.targetGroupArn, "targetGroupArn", "elasticloadbalancingv2.ITargetGroupRef | string")),
        weight: (!props.weight ? undefined : props.weight)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerRulePropsMixinForwardConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        targetGroups: (!props.targetGroups ? undefined : (cdk.isResolvableObject(props.targetGroups) ? props.targetGroups : (!props.targetGroups ? undefined : cdk.mapArrayInPlace(props.targetGroups, (item) => flattenCfnListenerRulePropsMixinTargetGroupTupleProperty(item))))),
        targetGroupStickinessConfig: (!props.targetGroupStickinessConfig ? undefined : props.targetGroupStickinessConfig)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerRulePropsMixinActionProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        authenticateCognitoConfig: (!props.authenticateCognitoConfig ? undefined : (!props.authenticateCognitoConfig ? undefined : flattenCfnListenerRulePropsMixinAuthenticateCognitoConfigProperty(props.authenticateCognitoConfig))),
        authenticateOidcConfig: (!props.authenticateOidcConfig ? undefined : props.authenticateOidcConfig),
        fixedResponseConfig: (!props.fixedResponseConfig ? undefined : props.fixedResponseConfig),
        forwardConfig: (!props.forwardConfig ? undefined : (!props.forwardConfig ? undefined : flattenCfnListenerRulePropsMixinForwardConfigProperty(props.forwardConfig))),
        jwtValidationConfig: (!props.jwtValidationConfig ? undefined : props.jwtValidationConfig),
        order: (!props.order ? undefined : props.order),
        redirectConfig: (!props.redirectConfig ? undefined : props.redirectConfig),
        targetGroupArn: (!props.targetGroupArn ? undefined : cdk.getRefProperty(props.targetGroupArn?.targetGroupRef, 'targetGroupArn') ?? cdk.ensureStringOrUndefined(props.targetGroupArn, "targetGroupArn", "elasticloadbalancingv2.ITargetGroupRef | string")),
        type: (!props.type ? undefined : props.type)
    };
}
// @ts-ignore TS6133
function flattenCfnListenerRuleMixinProps(props) {
    const ret = {};
    if ((props.actions !== undefined))
        ret.actions = (cdk.isResolvableObject(props.actions) ? props.actions : cdk.mapArrayInPlace(props.actions, (item) => flattenCfnListenerRulePropsMixinActionProperty(item)));
    if ((props.listenerArn !== undefined))
        ret.listenerArn = cdk.getRefProperty(props.listenerArn?.listenerRef, 'listenerArn') ?? cdk.ensureStringOrUndefined(props.listenerArn, "listenerArn", "elasticloadbalancingv2.IListenerRef | string");
    return ret;
}
/**
 * Specifies an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.
 *
 * @cloudformationResource AWS::ElasticLoadBalancingV2::LoadBalancer
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.html
 */
class CfnLoadBalancerPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticloadbalancingv2.CfnLoadBalancerPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["enableCapacityReservationProvisionStabilize", "enablePrefixForIpv6SourceNat", "enforceSecurityGroupInboundRulesOnPrivateLinkTraffic", "ipAddressType", "ipv4IpamPoolId", "loadBalancerAttributes", "minimumLoadBalancerCapacity", "name", "scheme", "securityGroups", "subnetMappings", "subnets", "tags", "type"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticLoadBalancingV2::LoadBalancer`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticloadbalancingv2_CfnLoadBalancerMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnLoadBalancerPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnLoadBalancerMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnLoadBalancer.isCfnLoadBalancer(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnLoadBalancerPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnLoadBalancerPropsMixin = CfnLoadBalancerPropsMixin;
// @ts-ignore TS6133
function flattenCfnLoadBalancerPropsMixinLoadBalancerAttributeProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        key: (!props.key ? undefined : props.key),
        value: (!props.value ? undefined : cdk.getRefProperty(props.value?.bucketRef, 'bucketName') ?? cdk.ensureStringOrUndefined(props.value, "value", "s3.IBucketRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnLoadBalancerPropsMixinSubnetMappingProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        allocationId: (!props.allocationId ? undefined : props.allocationId),
        iPv6Address: (!props.iPv6Address ? undefined : props.iPv6Address),
        privateIPv4Address: (!props.privateIPv4Address ? undefined : props.privateIPv4Address),
        sourceNatIpv6Prefix: (!props.sourceNatIpv6Prefix ? undefined : props.sourceNatIpv6Prefix),
        subnetId: (!props.subnetId ? undefined : cdk.getRefProperty(props.subnetId?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(props.subnetId, "subnetId", "ec2.ISubnetRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnLoadBalancerMixinProps(props) {
    const ret = {};
    if ((props.loadBalancerAttributes !== undefined))
        ret.loadBalancerAttributes = (cdk.isResolvableObject(props.loadBalancerAttributes) ? props.loadBalancerAttributes : cdk.mapArrayInPlace(props.loadBalancerAttributes, (item) => flattenCfnLoadBalancerPropsMixinLoadBalancerAttributeProperty(item)));
    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.subnetMappings !== undefined))
        ret.subnetMappings = (cdk.isResolvableObject(props.subnetMappings) ? props.subnetMappings : cdk.mapArrayInPlace(props.subnetMappings, (item) => flattenCfnLoadBalancerPropsMixinSubnetMappingProperty(item)));
    if ((props.subnets !== undefined))
        ret.subnets = cdk.mapArrayInPlace(props.subnets, (item) => cdk.getRefProperty(item?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(item, "subnets", "ec2.ISubnetRef | string"));
    return ret;
}
/**
 * Specifies a target group for an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.
 *
 * Before you register a Lambda function as a target, you must create a `AWS::Lambda::Permission` resource that grants the Elastic Load Balancing service principal permission to invoke the Lambda function.
 *
 * @cloudformationResource AWS::ElasticLoadBalancingV2::TargetGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html
 */
class CfnTargetGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticloadbalancingv2.CfnTargetGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["healthCheckEnabled", "healthCheckIntervalSeconds", "healthCheckPath", "healthCheckPort", "healthCheckProtocol", "healthCheckTimeoutSeconds", "healthyThresholdCount", "ipAddressType", "matcher", "name", "port", "protocol", "protocolVersion", "tags", "targetControlPort", "targetGroupAttributes", "targets", "targetType", "unhealthyThresholdCount", "vpcId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticLoadBalancingV2::TargetGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticloadbalancingv2_CfnTargetGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnTargetGroupPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnTargetGroupMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnTargetGroup.isCfnTargetGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnTargetGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnTargetGroupPropsMixin = CfnTargetGroupPropsMixin;
// @ts-ignore TS6133
function flattenCfnTargetGroupPropsMixinTargetDescriptionProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        availabilityZone: (!props.availabilityZone ? undefined : props.availabilityZone),
        id: (!props.id ? undefined : cdk.getRefProperty(props.id?.loadBalancerRef, 'loadBalancerArn') ?? cdk.getRefProperty(props.id?.functionRef, 'functionArn') ?? cdk.getRefProperty(props.id?.instanceRef, 'instanceId') ?? cdk.ensureStringOrUndefined(props.id, "id", "elasticloadbalancingv2.ILoadBalancerRef | ec2.IInstanceRef | lambda.IFunctionRef | string")),
        port: (!props.port ? undefined : props.port),
        quicServerId: (!props.quicServerId ? undefined : props.quicServerId)
    };
}
// @ts-ignore TS6133
function flattenCfnTargetGroupMixinProps(props) {
    const ret = {};
    if ((props.targets !== undefined))
        ret.targets = (cdk.isResolvableObject(props.targets) ? props.targets : cdk.mapArrayInPlace(props.targets, (item) => flattenCfnTargetGroupPropsMixinTargetDescriptionProperty(item)));
    if ((props.vpcId !== undefined))
        ret.vpcId = cdk.getRefProperty(props.vpcId?.vpcRef, 'vpcId') ?? cdk.ensureStringOrUndefined(props.vpcId, "vpcId", "ec2.IVPCRef | string");
    return ret;
}
/**
 * Creates a trust store.
 *
 * You must specify `CaCertificatesBundleS3Bucket` and `CaCertificatesBundleS3Key` . When you create a trust store, you must specify `Name` .
 *
 * @cloudformationResource AWS::ElasticLoadBalancingV2::TrustStore
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-truststore.html
 */
class CfnTrustStorePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticloadbalancingv2.CfnTrustStorePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["caCertificatesBundleS3Bucket", "caCertificatesBundleS3Key", "caCertificatesBundleS3ObjectVersion", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticLoadBalancingV2::TrustStore`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticloadbalancingv2_CfnTrustStoreMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnTrustStorePropsMixin);
            }
            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.CfnTrustStore.isCfnTrustStore(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnTrustStorePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnTrustStorePropsMixin = CfnTrustStorePropsMixin;
/**
 * Adds the specified revocation contents to the specified trust store.
 *
 * You must specify `TrustStoreArn` .
 *
 * @cloudformationResource AWS::ElasticLoadBalancingV2::TrustStoreRevocation
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-truststorerevocation.html
 */
class CfnTrustStoreRevocationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticloadbalancingv2.CfnTrustStoreRevocationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["revocationContents", "trustStoreArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticLoadBalancingV2::TrustStoreRevocation`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticloadbalancingv2_CfnTrustStoreRevocationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnTrustStoreRevocationPropsMixin);
            }
            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.CfnTrustStoreRevocation.isCfnTrustStoreRevocation(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnTrustStoreRevocationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnTrustStoreRevocationPropsMixin = CfnTrustStoreRevocationPropsMixin;
