"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.CfnResourceCollectionPropsMixin = exports.CfnNotificationChannelPropsMixin = exports.CfnLogAnomalyDetectionIntegrationPropsMixin = 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-devopsguru"));
/**
 * Information about the integration of DevOps Guru with CloudWatch log groups for log anomaly detection.
 *
 * @cloudformationResource AWS::DevOpsGuru::LogAnomalyDetectionIntegration
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-devopsguru-loganomalydetectionintegration.html
 */
class CfnLogAnomalyDetectionIntegrationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_devopsguru.CfnLogAnomalyDetectionIntegrationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = [];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::DevOpsGuru::LogAnomalyDetectionIntegration`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_devopsguru_CfnLogAnomalyDetectionIntegrationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnLogAnomalyDetectionIntegrationPropsMixin);
            }
            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.CfnLogAnomalyDetectionIntegration.isCfnLogAnomalyDetectionIntegration(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnLogAnomalyDetectionIntegrationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnLogAnomalyDetectionIntegrationPropsMixin = CfnLogAnomalyDetectionIntegrationPropsMixin;
/**
 * Adds a notification channel to DevOps Guru.
 *
 * A notification channel is used to notify you about important DevOps Guru events, such as when an insight is generated.
 *
 * If you use an Amazon SNS topic in another account, you must attach a policy to it that grants DevOps Guru permission to send it notifications. DevOps Guru adds the required policy on your behalf to send notifications using Amazon SNS in your account. DevOps Guru only supports standard SNS topics. For more information, see [Permissions for Amazon SNS topics](https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-required-permissions.html) .
 *
 * If you use an Amazon SNS topic that is encrypted by an AWS Key Management Service customer-managed key (CMK), then you must add permissions to the CMK. For more information, see [Permissions for AWS KMS–encrypted Amazon SNS topics](https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-kms-permissions.html) .
 *
 * @cloudformationResource AWS::DevOpsGuru::NotificationChannel
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-devopsguru-notificationchannel.html
 */
class CfnNotificationChannelPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_devopsguru.CfnNotificationChannelPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["config"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::DevOpsGuru::NotificationChannel`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_devopsguru_CfnNotificationChannelMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnNotificationChannelPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnNotificationChannelMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnNotificationChannel.isCfnNotificationChannel(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnNotificationChannelPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnNotificationChannelPropsMixin = CfnNotificationChannelPropsMixin;
// @ts-ignore TS6133
function flattenCfnNotificationChannelPropsMixinSnsChannelConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        topicArn: (!props.topicArn ? undefined : cdk.getRefProperty(props.topicArn?.topicRef, 'topicArn') ?? cdk.ensureStringOrUndefined(props.topicArn, "topicArn", "sns.ITopicRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnNotificationChannelPropsMixinNotificationChannelConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        filters: (!props.filters ? undefined : props.filters),
        sns: (!props.sns ? undefined : (!props.sns ? undefined : flattenCfnNotificationChannelPropsMixinSnsChannelConfigProperty(props.sns)))
    };
}
// @ts-ignore TS6133
function flattenCfnNotificationChannelMixinProps(props) {
    const ret = {};
    if ((props.config !== undefined))
        ret.config = flattenCfnNotificationChannelPropsMixinNotificationChannelConfigProperty(props.config);
    return ret;
}
/**
 * A collection of AWS resources supported by DevOps Guru.
 *
 * The one type of AWS resource collection supported is AWS CloudFormation stacks. DevOps Guru can be configured to analyze only the AWS resources that are defined in the stacks.
 *
 * @cloudformationResource AWS::DevOpsGuru::ResourceCollection
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-devopsguru-resourcecollection.html
 */
class CfnResourceCollectionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_devopsguru.CfnResourceCollectionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["resourceCollectionFilter"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::DevOpsGuru::ResourceCollection`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_devopsguru_CfnResourceCollectionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnResourceCollectionPropsMixin);
            }
            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.CfnResourceCollection.isCfnResourceCollection(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnResourceCollectionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnResourceCollectionPropsMixin = CfnResourceCollectionPropsMixin;
