"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.CfnPipelinePropsMixin = exports.CfnDatastorePropsMixin = exports.CfnDatasetPropsMixin = exports.CfnChannelPropsMixin = 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-iotanalytics"));
/**
 * The AWS::IoTAnalytics::Channel resource collects data from an MQTT topic and archives the raw, unprocessed messages before publishing the data to a pipeline.
 *
 * For more information, see [How to Use](https://docs.aws.amazon.com/iotanalytics/latest/userguide/welcome.html#aws-iot-analytics-how) in the *User Guide* .
 *
 * @cloudformationResource AWS::IoTAnalytics::Channel
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotanalytics-channel.html
 */
class CfnChannelPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_iotanalytics.CfnChannelPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["channelName", "channelStorage", "retentionPeriod", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::IoTAnalytics::Channel`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_iotanalytics_CfnChannelMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnChannelPropsMixin);
            }
            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.CfnChannel.isCfnChannel(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnChannelPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnChannelPropsMixin = CfnChannelPropsMixin;
/**
 * The AWS::IoTAnalytics::Dataset resource stores data retrieved from a data store by applying a `queryAction` (an SQL query) or a `containerAction` (executing a containerized application).
 *
 * The data set can be populated manually by calling `CreateDatasetContent` or automatically according to a `trigger` you specify. For more information, see [How to Use](https://docs.aws.amazon.com/iotanalytics/latest/userguide/welcome.html#aws-iot-analytics-how) in the *User Guide* .
 *
 * @cloudformationResource AWS::IoTAnalytics::Dataset
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotanalytics-dataset.html
 */
class CfnDatasetPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_iotanalytics.CfnDatasetPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["actions", "contentDeliveryRules", "datasetName", "lateDataRules", "retentionPeriod", "tags", "triggers", "versioningConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::IoTAnalytics::Dataset`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_iotanalytics_CfnDatasetMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnDatasetPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnDatasetMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnDataset.isCfnDataset(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnDatasetPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnDatasetPropsMixin = CfnDatasetPropsMixin;
// @ts-ignore TS6133
function flattenCfnDatasetPropsMixinS3DestinationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        bucket: (!props.bucket ? undefined : cdk.getRefProperty(props.bucket?.bucketRef, 'bucketName') ?? cdk.ensureStringOrUndefined(props.bucket, "bucket", "s3.IBucketRef | string")),
        glueConfiguration: (!props.glueConfiguration ? undefined : props.glueConfiguration),
        key: (!props.key ? undefined : props.key),
        roleArn: (!props.roleArn ? undefined : cdk.getRefProperty(props.roleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.roleArn, "roleArn", "iam.IRoleRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnDatasetPropsMixinDatasetContentDeliveryRuleDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        iotEventsDestinationConfiguration: (!props.iotEventsDestinationConfiguration ? undefined : props.iotEventsDestinationConfiguration),
        s3DestinationConfiguration: (!props.s3DestinationConfiguration ? undefined : (!props.s3DestinationConfiguration ? undefined : flattenCfnDatasetPropsMixinS3DestinationConfigurationProperty(props.s3DestinationConfiguration)))
    };
}
// @ts-ignore TS6133
function flattenCfnDatasetPropsMixinDatasetContentDeliveryRuleProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        destination: (!props.destination ? undefined : flattenCfnDatasetPropsMixinDatasetContentDeliveryRuleDestinationProperty(props.destination)),
        entryName: (!props.entryName ? undefined : props.entryName)
    };
}
// @ts-ignore TS6133
function flattenCfnDatasetMixinProps(props) {
    const ret = {};
    if ((props.contentDeliveryRules !== undefined))
        ret.contentDeliveryRules = (cdk.isResolvableObject(props.contentDeliveryRules) ? props.contentDeliveryRules : cdk.mapArrayInPlace(props.contentDeliveryRules, (item) => flattenCfnDatasetPropsMixinDatasetContentDeliveryRuleProperty(item)));
    return ret;
}
/**
 * AWS::IoTAnalytics::Datastore resource is a repository for messages.
 *
 * For more information, see [How to Use](https://docs.aws.amazon.com/iotanalytics/latest/userguide/welcome.html#aws-iot-analytics-how) in the *User Guide* .
 *
 * @cloudformationResource AWS::IoTAnalytics::Datastore
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotanalytics-datastore.html
 */
class CfnDatastorePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_iotanalytics.CfnDatastorePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["datastoreName", "datastorePartitions", "datastoreStorage", "fileFormatConfiguration", "retentionPeriod", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::IoTAnalytics::Datastore`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_iotanalytics_CfnDatastoreMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnDatastorePropsMixin);
            }
            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.CfnDatastore.isCfnDatastore(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnDatastorePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnDatastorePropsMixin = CfnDatastorePropsMixin;
/**
 * The AWS::IoTAnalytics::Pipeline resource consumes messages from one or more channels and allows you to process the messages before storing them in a data store.
 *
 * You must specify both a `channel` and a `datastore` activity and, optionally, as many as 23 additional activities in the `pipelineActivities` array. For more information, see [How to Use](https://docs.aws.amazon.com/iotanalytics/latest/userguide/welcome.html#aws-iot-analytics-how) in the *User Guide* .
 *
 * @cloudformationResource AWS::IoTAnalytics::Pipeline
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotanalytics-pipeline.html
 */
class CfnPipelinePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_iotanalytics.CfnPipelinePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["pipelineActivities", "pipelineName", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::IoTAnalytics::Pipeline`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_iotanalytics_CfnPipelineMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnPipelinePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnPipelineMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnPipeline.isCfnPipeline(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnPipelinePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnPipelinePropsMixin = CfnPipelinePropsMixin;
// @ts-ignore TS6133
function flattenCfnPipelinePropsMixinLambdaProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        batchSize: (!props.batchSize ? undefined : props.batchSize),
        lambdaName: (!props.lambdaName ? undefined : cdk.getRefProperty(props.lambdaName?.functionRef, 'functionName') ?? cdk.ensureStringOrUndefined(props.lambdaName, "lambdaName", "lambda.IFunctionRef | string")),
        name: (!props.name ? undefined : props.name),
        next: (!props.next ? undefined : props.next)
    };
}
// @ts-ignore TS6133
function flattenCfnPipelinePropsMixinActivityProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        addAttributes: (!props.addAttributes ? undefined : props.addAttributes),
        channel: (!props.channel ? undefined : props.channel),
        datastore: (!props.datastore ? undefined : props.datastore),
        deviceRegistryEnrich: (!props.deviceRegistryEnrich ? undefined : props.deviceRegistryEnrich),
        deviceShadowEnrich: (!props.deviceShadowEnrich ? undefined : props.deviceShadowEnrich),
        filter: (!props.filter ? undefined : props.filter),
        lambda: (!props.lambda ? undefined : (!props.lambda ? undefined : flattenCfnPipelinePropsMixinLambdaProperty(props.lambda))),
        math: (!props.math ? undefined : props.math),
        removeAttributes: (!props.removeAttributes ? undefined : props.removeAttributes),
        selectAttributes: (!props.selectAttributes ? undefined : props.selectAttributes)
    };
}
// @ts-ignore TS6133
function flattenCfnPipelineMixinProps(props) {
    const ret = {};
    if ((props.pipelineActivities !== undefined))
        ret.pipelineActivities = (cdk.isResolvableObject(props.pipelineActivities) ? props.pipelineActivities : cdk.mapArrayInPlace(props.pipelineActivities, (item) => flattenCfnPipelinePropsMixinActivityProperty(item)));
    return ret;
}
