"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.CfnCostCategoryPropsMixin = exports.CfnAnomalySubscriptionPropsMixin = exports.CfnAnomalyMonitorPropsMixin = 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-ce"));
/**
 * The `AWS::CE::AnomalyMonitor` resource is a Cost Explorer resource type that continuously inspects your account's cost data for anomalies, based on `MonitorType` and `MonitorSpecification` .
 *
 * The content consists of detailed metadata and the current status of the monitor object.
 *
 * @cloudformationResource AWS::CE::AnomalyMonitor
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ce-anomalymonitor.html
 */
class CfnAnomalyMonitorPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ce.CfnAnomalyMonitorPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["monitorDimension", "monitorName", "monitorSpecification", "monitorType", "resourceTags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::CE::AnomalyMonitor`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ce_CfnAnomalyMonitorMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAnomalyMonitorPropsMixin);
            }
            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.CfnAnomalyMonitor.isCfnAnomalyMonitor(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAnomalyMonitorPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAnomalyMonitorPropsMixin = CfnAnomalyMonitorPropsMixin;
/**
 * The `AWS::CE::AnomalySubscription` resource (also referred to as an alert subscription) is a Cost Explorer resource type that sends notifications about specific anomalies that meet an alerting criteria defined by you.
 *
 * You can specify the frequency of the alerts and the subscribers to notify.
 *
 * Anomaly subscriptions can be associated with one or more [`AWS::CE::AnomalyMonitor`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ce-anomalymonitor.html) resources, and they only send notifications about anomalies detected by those associated monitors. You can also configure a threshold to further control which anomalies are included in the notifications.
 *
 * Anomalies that don’t exceed the chosen threshold and therefore don’t trigger notifications from an anomaly subscription will still be available on the console and from the [`GetAnomalies`](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetAnomalies.html) API.
 *
 * @cloudformationResource AWS::CE::AnomalySubscription
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ce-anomalysubscription.html
 */
class CfnAnomalySubscriptionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ce.CfnAnomalySubscriptionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["frequency", "monitorArnList", "resourceTags", "subscribers", "subscriptionName", "threshold", "thresholdExpression"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::CE::AnomalySubscription`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ce_CfnAnomalySubscriptionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAnomalySubscriptionPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnAnomalySubscriptionMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnAnomalySubscription.isCfnAnomalySubscription(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAnomalySubscriptionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAnomalySubscriptionPropsMixin = CfnAnomalySubscriptionPropsMixin;
// @ts-ignore TS6133
function flattenCfnAnomalySubscriptionPropsMixinSubscriberProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        address: (!props.address ? undefined : cdk.getRefProperty(props.address?.topicRef, 'topicArn') ?? cdk.ensureStringOrUndefined(props.address, "address", "sns.ITopicRef | string")),
        status: (!props.status ? undefined : props.status),
        type: (!props.type ? undefined : props.type)
    };
}
// @ts-ignore TS6133
function flattenCfnAnomalySubscriptionMixinProps(props) {
    const ret = {};
    if ((props.monitorArnList !== undefined))
        ret.monitorArnList = cdk.mapArrayInPlace(props.monitorArnList, (item) => cdk.getRefProperty(item?.anomalyMonitorRef, 'monitorArn') ?? cdk.ensureStringOrUndefined(item, "monitorArnList", "ce.IAnomalyMonitorRef | string"));
    if ((props.subscribers !== undefined))
        ret.subscribers = (cdk.isResolvableObject(props.subscribers) ? props.subscribers : cdk.mapArrayInPlace(props.subscribers, (item) => flattenCfnAnomalySubscriptionPropsMixinSubscriberProperty(item)));
    return ret;
}
/**
 * The `AWS::CE::CostCategory` resource creates groupings of cost that you can use across products in the Billing and Cost Management console, such as Cost Explorer and AWS Budgets.
 *
 * For more information, see [Managing Your Costs with Cost Categories](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-cost-categories.html) in the *Billing and Cost Management User Guide* .
 *
 * @cloudformationResource AWS::CE::CostCategory
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ce-costcategory.html
 */
class CfnCostCategoryPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ce.CfnCostCategoryPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["defaultValue", "name", "rules", "ruleVersion", "splitChargeRules", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::CE::CostCategory`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ce_CfnCostCategoryMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnCostCategoryPropsMixin);
            }
            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.CfnCostCategory.isCfnCostCategory(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnCostCategoryPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnCostCategoryPropsMixin = CfnCostCategoryPropsMixin;
