"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.CfnResponderGatewayPropsMixin = exports.CfnRequesterGatewayPropsMixin = exports.CfnOutboundExternalLinkPropsMixin = exports.CfnLinkPropsMixin = exports.CfnInboundExternalLinkPropsMixin = 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-rtbfabric"));
/**
 * Resource Type definition for AWS::RTBFabric::InboundExternalLink Resource Type.
 *
 * @cloudformationResource AWS::RTBFabric::InboundExternalLink
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rtbfabric-inboundexternallink.html
 */
class CfnInboundExternalLinkPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_rtbfabric.CfnInboundExternalLinkPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["gatewayId", "linkAttributes", "linkLogSettings", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RTBFabric::InboundExternalLink`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_rtbfabric_CfnInboundExternalLinkMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnInboundExternalLinkPropsMixin);
            }
            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.CfnInboundExternalLink.isCfnInboundExternalLink(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnInboundExternalLinkPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnInboundExternalLinkPropsMixin = CfnInboundExternalLinkPropsMixin;
/**
 * Creates a new link between gateways.
 *
 * Establishes a connection that allows gateways to communicate and exchange bid requests and responses.
 *
 * @cloudformationResource AWS::RTBFabric::Link
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rtbfabric-link.html
 */
class CfnLinkPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_rtbfabric.CfnLinkPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["gatewayId", "httpResponderAllowed", "linkAttributes", "linkLogSettings", "moduleConfigurationList", "peerGatewayId", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RTBFabric::Link`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_rtbfabric_CfnLinkMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnLinkPropsMixin);
            }
            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.CfnLink.isCfnLink(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnLinkPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnLinkPropsMixin = CfnLinkPropsMixin;
/**
 * Resource Type definition for AWS::RTBFabric::OutboundExternalLink Resource Type.
 *
 * @cloudformationResource AWS::RTBFabric::OutboundExternalLink
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rtbfabric-outboundexternallink.html
 */
class CfnOutboundExternalLinkPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_rtbfabric.CfnOutboundExternalLinkPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["gatewayId", "linkAttributes", "linkLogSettings", "publicEndpoint", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RTBFabric::OutboundExternalLink`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_rtbfabric_CfnOutboundExternalLinkMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnOutboundExternalLinkPropsMixin);
            }
            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.CfnOutboundExternalLink.isCfnOutboundExternalLink(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnOutboundExternalLinkPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnOutboundExternalLinkPropsMixin = CfnOutboundExternalLinkPropsMixin;
/**
 * Creates a requester gateway.
 *
 * @cloudformationResource AWS::RTBFabric::RequesterGateway
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rtbfabric-requestergateway.html
 */
class CfnRequesterGatewayPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_rtbfabric.CfnRequesterGatewayPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "securityGroupIds", "subnetIds", "tags", "vpcId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RTBFabric::RequesterGateway`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_rtbfabric_CfnRequesterGatewayMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnRequesterGatewayPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnRequesterGatewayMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnRequesterGateway.isCfnRequesterGateway(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnRequesterGatewayPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnRequesterGatewayPropsMixin = CfnRequesterGatewayPropsMixin;
// @ts-ignore TS6133
function flattenCfnRequesterGatewayMixinProps(props) {
    const ret = {};
    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.vpcId !== undefined))
        ret.vpcId = cdk.getRefProperty(props.vpcId?.vpcRef, 'vpcId') ?? cdk.ensureStringOrUndefined(props.vpcId, "vpcId", "ec2.IVPCRef | string");
    return ret;
}
/**
 * Creates a responder gateway.
 *
 * > A domain name or managed endpoint is required.
 *
 * @cloudformationResource AWS::RTBFabric::ResponderGateway
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rtbfabric-respondergateway.html
 */
class CfnResponderGatewayPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_rtbfabric.CfnResponderGatewayPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "domainName", "managedEndpointConfiguration", "port", "protocol", "securityGroupIds", "subnetIds", "tags", "trustStoreConfiguration", "vpcId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RTBFabric::ResponderGateway`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_rtbfabric_CfnResponderGatewayMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnResponderGatewayPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnResponderGatewayMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnResponderGateway.isCfnResponderGateway(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnResponderGatewayPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnResponderGatewayPropsMixin = CfnResponderGatewayPropsMixin;
// @ts-ignore TS6133
function flattenCfnResponderGatewayMixinProps(props) {
    const ret = {};
    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.vpcId !== undefined))
        ret.vpcId = cdk.getRefProperty(props.vpcId?.vpcRef, 'vpcId') ?? cdk.ensureStringOrUndefined(props.vpcId, "vpcId", "ec2.IVPCRef | string");
    return ret;
}
