"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.CfnSafetyRulePropsMixin = exports.CfnRoutingControlPropsMixin = exports.CfnControlPanelPropsMixin = exports.CfnClusterPropsMixin = 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-route53recoverycontrol"));
/**
 * Creates a cluster in Amazon Route 53 Application Recovery Controller.
 *
 * A cluster is a set of redundant Regional endpoints that you can run Route 53 ARC API calls against to update or get the state of one or more routing controls.
 *
 * @cloudformationResource AWS::Route53RecoveryControl::Cluster
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-cluster.html
 */
class CfnClusterPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_route53recoverycontrol.CfnClusterPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["name", "networkType", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Route53RecoveryControl::Cluster`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_route53recoverycontrol_CfnClusterMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnClusterPropsMixin);
            }
            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.CfnCluster.isCfnCluster(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnClusterPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnClusterPropsMixin = CfnClusterPropsMixin;
/**
 * Creates a new control panel in Amazon Route 53 Application Recovery Controller.
 *
 * A control panel represents a group of routing controls that can be changed together in a single transaction. You can use a control panel to centrally view the operational status of applications across your organization, and trigger multi-app failovers in a single transaction, for example, to fail over from one AWS Region (cell) to another.
 *
 * @cloudformationResource AWS::Route53RecoveryControl::ControlPanel
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-controlpanel.html
 */
class CfnControlPanelPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_route53recoverycontrol.CfnControlPanelPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["clusterArn", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Route53RecoveryControl::ControlPanel`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_route53recoverycontrol_CfnControlPanelMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnControlPanelPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnControlPanelMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnControlPanel.isCfnControlPanel(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnControlPanelPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnControlPanelPropsMixin = CfnControlPanelPropsMixin;
// @ts-ignore TS6133
function flattenCfnControlPanelMixinProps(props) {
    const ret = {};
    if ((props.clusterArn !== undefined))
        ret.clusterArn = cdk.getRefProperty(props.clusterArn?.clusterRef, 'clusterArn') ?? cdk.ensureStringOrUndefined(props.clusterArn, "clusterArn", "route53recoverycontrol.IClusterRef | string");
    return ret;
}
/**
 * Creates a routing control in Amazon Route 53 Application Recovery Controller.
 *
 * Routing control states are maintained on the highly reliable cluster data plane.
 *
 * To get or update the state of the routing control, you must specify a cluster endpoint, which is an endpoint URL and an AWS Region. For more information, see [Code examples](https://docs.aws.amazon.com/r53recovery/latest/dg/service_code_examples.html) in the Amazon Route 53 Application Recovery Controller Developer Guide.
 *
 * @cloudformationResource AWS::Route53RecoveryControl::RoutingControl
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-routingcontrol.html
 */
class CfnRoutingControlPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_route53recoverycontrol.CfnRoutingControlPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["clusterArn", "controlPanelArn", "name"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Route53RecoveryControl::RoutingControl`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_route53recoverycontrol_CfnRoutingControlMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnRoutingControlPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnRoutingControlMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnRoutingControl.isCfnRoutingControl(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnRoutingControlPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnRoutingControlPropsMixin = CfnRoutingControlPropsMixin;
// @ts-ignore TS6133
function flattenCfnRoutingControlMixinProps(props) {
    const ret = {};
    if ((props.clusterArn !== undefined))
        ret.clusterArn = cdk.getRefProperty(props.clusterArn?.clusterRef, 'clusterArn') ?? cdk.ensureStringOrUndefined(props.clusterArn, "clusterArn", "route53recoverycontrol.IClusterRef | string");
    if ((props.controlPanelArn !== undefined))
        ret.controlPanelArn = cdk.getRefProperty(props.controlPanelArn?.controlPanelRef, 'controlPanelArn') ?? cdk.ensureStringOrUndefined(props.controlPanelArn, "controlPanelArn", "route53recoverycontrol.IControlPanelRef | string");
    return ret;
}
/**
 * Creates a safety rule in a control panel in Amazon Route 53 Application Recovery Controller.
 *
 * Safety rules in Amazon Route 53 Application Recovery Controller let you add safeguards around changing routing control states, and enabling and disabling routing controls, to help prevent unwanted outcomes. Note that the name of a safety rule must be unique within a control panel.
 *
 * There are two types of safety rules in Route 53 ARC: assertion rules and gating rules.
 *
 * Assertion rule: An assertion rule enforces that, when you change a routing control state, certain criteria are met. For example, the criteria might be that at least one routing control state is `On` after the transaction completes so that traffic continues to be directed to at least one cell for the application. This prevents a fail-open scenario.
 *
 * Gating rule: A gating rule lets you configure a gating routing control as an overall on-off switch for a group of routing controls. Or, you can configure more complex gating scenarios, for example, by configuring multiple gating routing controls.
 *
 * For more information, see [Safety rules](https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.safety-rules.html) in the Amazon Route 53 Application Recovery Controller Developer Guide.
 *
 * @cloudformationResource AWS::Route53RecoveryControl::SafetyRule
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html
 */
class CfnSafetyRulePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_route53recoverycontrol.CfnSafetyRulePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["assertionRule", "controlPanelArn", "gatingRule", "name", "ruleConfig", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Route53RecoveryControl::SafetyRule`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_route53recoverycontrol_CfnSafetyRuleMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnSafetyRulePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnSafetyRuleMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnSafetyRule.isCfnSafetyRule(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnSafetyRulePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnSafetyRulePropsMixin = CfnSafetyRulePropsMixin;
// @ts-ignore TS6133
function flattenCfnSafetyRulePropsMixinAssertionRuleProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        assertedControls: (!props.assertedControls ? undefined : cdk.mapArrayInPlace(props.assertedControls, (item) => cdk.getRefProperty(item?.routingControlRef, 'routingControlArn') ?? cdk.ensureStringOrUndefined(item, "assertedControls", "route53recoverycontrol.IRoutingControlRef | string"))),
        waitPeriodMs: (!props.waitPeriodMs ? undefined : props.waitPeriodMs)
    };
}
// @ts-ignore TS6133
function flattenCfnSafetyRuleMixinProps(props) {
    const ret = {};
    if ((props.assertionRule !== undefined))
        ret.assertionRule = flattenCfnSafetyRulePropsMixinAssertionRuleProperty(props.assertionRule);
    if ((props.controlPanelArn !== undefined))
        ret.controlPanelArn = cdk.getRefProperty(props.controlPanelArn?.controlPanelRef, 'controlPanelArn') ?? cdk.ensureStringOrUndefined(props.controlPanelArn, "controlPanelArn", "route53recoverycontrol.IControlPanelRef | string");
    return ret;
}
