"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.CfnSegmentPropsMixin = exports.CfnProjectPropsMixin = exports.CfnLaunchPropsMixin = exports.CfnFeaturePropsMixin = exports.CfnExperimentPropsMixin = 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-evidently"));
/**
 * Creates or updates an Evidently *experiment* .
 *
 * Before you create an experiment, you must create the feature to use for the experiment.
 *
 * An experiment helps you make feature design decisions based on evidence and data. An experiment can test as many as five variations at once. Evidently collects experiment data and analyzes it by statistical methods, and provides clear recommendations about which variations perform better.
 *
 * @cloudformationResource AWS::Evidently::Experiment
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-evidently-experiment.html
 */
class CfnExperimentPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_evidently.CfnExperimentPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "metricGoals", "name", "onlineAbConfig", "project", "randomizationSalt", "removeSegment", "runningStatus", "samplingRate", "segment", "tags", "treatments"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Evidently::Experiment`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_evidently_CfnExperimentMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnExperimentPropsMixin);
            }
            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.CfnExperiment.isCfnExperiment(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnExperimentPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnExperimentPropsMixin = CfnExperimentPropsMixin;
/**
 * Creates or updates an Evidently *feature* that you want to launch or test.
 *
 * You can define up to five variations of a feature, and use these variations in your launches and experiments. A feature must be created in a project. For information about creating a project, see [CreateProject](https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_CreateProject.html) .
 *
 * @cloudformationResource AWS::Evidently::Feature
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-evidently-feature.html
 */
class CfnFeaturePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_evidently.CfnFeaturePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["defaultVariation", "description", "entityOverrides", "evaluationStrategy", "name", "project", "tags", "variations"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Evidently::Feature`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_evidently_CfnFeatureMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnFeaturePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnFeatureMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnFeature.isCfnFeature(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnFeaturePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnFeaturePropsMixin = CfnFeaturePropsMixin;
// @ts-ignore TS6133
function flattenCfnFeatureMixinProps(props) {
    const ret = {};
    if ((props.project !== undefined))
        ret.project = cdk.getRefProperty(props.project?.projectRef, 'projectArn') ?? cdk.ensureStringOrUndefined(props.project, "project", "evidently.IProjectRef | string");
    return ret;
}
/**
 * Creates or updates a *launch* of a given feature.
 *
 * Before you create a launch, you must create the feature to use for the launch.
 *
 * You can use a launch to safely validate new features by serving them to a specified percentage of your users while you roll out the feature. You can monitor the performance of the new feature to help you decide when to ramp up traffic to more users. This helps you reduce risk and identify unintended consequences before you fully launch the feature.
 *
 * @cloudformationResource AWS::Evidently::Launch
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-evidently-launch.html
 */
class CfnLaunchPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_evidently.CfnLaunchPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "executionStatus", "groups", "metricMonitors", "name", "project", "randomizationSalt", "scheduledSplitsConfig", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Evidently::Launch`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_evidently_CfnLaunchMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnLaunchPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnLaunchMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnLaunch.isCfnLaunch(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnLaunchPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnLaunchPropsMixin = CfnLaunchPropsMixin;
// @ts-ignore TS6133
function flattenCfnLaunchMixinProps(props) {
    const ret = {};
    if ((props.project !== undefined))
        ret.project = cdk.getRefProperty(props.project?.projectRef, 'projectArn') ?? cdk.ensureStringOrUndefined(props.project, "project", "evidently.IProjectRef | string");
    return ret;
}
/**
 * Creates a project, which is the logical object in Evidently that can contain features, launches, and experiments.
 *
 * Use projects to group similar features together.
 *
 * @cloudformationResource AWS::Evidently::Project
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-evidently-project.html
 */
class CfnProjectPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_evidently.CfnProjectPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["appConfigResource", "dataDelivery", "description", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Evidently::Project`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_evidently_CfnProjectMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnProjectPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnProjectMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnProject.isCfnProject(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnProjectPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnProjectPropsMixin = CfnProjectPropsMixin;
// @ts-ignore TS6133
function flattenCfnProjectPropsMixinS3DestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        bucketName: (!props.bucketName ? undefined : cdk.getRefProperty(props.bucketName?.bucketRef, 'bucketName') ?? cdk.ensureStringOrUndefined(props.bucketName, "bucketName", "s3.IBucketRef | string")),
        prefix: (!props.prefix ? undefined : props.prefix)
    };
}
// @ts-ignore TS6133
function flattenCfnProjectPropsMixinDataDeliveryObjectProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        logGroup: (!props.logGroup ? undefined : cdk.getRefProperty(props.logGroup?.logGroupRef, 'logGroupName') ?? cdk.ensureStringOrUndefined(props.logGroup, "logGroup", "logs.ILogGroupRef | string")),
        s3: (!props.s3 ? undefined : (!props.s3 ? undefined : flattenCfnProjectPropsMixinS3DestinationProperty(props.s3)))
    };
}
// @ts-ignore TS6133
function flattenCfnProjectPropsMixinAppConfigResourceObjectProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        applicationId: (!props.applicationId ? undefined : cdk.getRefProperty(props.applicationId?.applicationRef, 'applicationId') ?? cdk.ensureStringOrUndefined(props.applicationId, "applicationId", "appconfig.IApplicationRef | string")),
        environmentId: (!props.environmentId ? undefined : props.environmentId)
    };
}
// @ts-ignore TS6133
function flattenCfnProjectMixinProps(props) {
    const ret = {};
    if ((props.appConfigResource !== undefined))
        ret.appConfigResource = flattenCfnProjectPropsMixinAppConfigResourceObjectProperty(props.appConfigResource);
    if ((props.dataDelivery !== undefined))
        ret.dataDelivery = flattenCfnProjectPropsMixinDataDeliveryObjectProperty(props.dataDelivery);
    return ret;
}
/**
 * Creates or updates a *segment* of your audience.
 *
 * A segment is a portion of your audience that share one or more characteristics. Examples could be Chrome browser users, users in Europe, or Firefox browser users in Europe who also fit other criteria that your application collects, such as age.
 *
 * Using a segment in an experiment limits that experiment to evaluate only the users who match the segment criteria. Using one or more segments in a launch allow you to define different traffic splits for the different audience segments.
 *
 * For more information about segment pattern syntax, see [Segment rule pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html#CloudWatch-Evidently-segments-syntax) .
 *
 * The pattern that you define for a segment is matched against the value of `evaluationContext` , which is passed into Evidently in the [EvaluateFeature](https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_EvaluateFeature.html) operation, when Evidently assigns a feature variation to a user.
 *
 * @cloudformationResource AWS::Evidently::Segment
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-evidently-segment.html
 */
class CfnSegmentPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_evidently.CfnSegmentPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "name", "pattern", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Evidently::Segment`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_evidently_CfnSegmentMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnSegmentPropsMixin);
            }
            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.CfnSegment.isCfnSegment(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnSegmentPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnSegmentPropsMixin = CfnSegmentPropsMixin;
