"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.CfnInfluxDBInstancePropsMixin = exports.CfnInfluxDBClusterPropsMixin = exports.CfnTablePropsMixin = exports.CfnScheduledQueryPropsMixin = exports.CfnDatabasePropsMixin = 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-timestream"));
/**
 * Creates a new Timestream database.
 *
 * If the AWS  key is not specified, the database will be encrypted with a Timestream managed AWS  key located in your account. Refer to [AWS managed AWS  keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) for more info. [Service quotas apply](https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html) . See [code sample](https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.create-db.html) for details.
 *
 * @cloudformationResource AWS::Timestream::Database
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-database.html
 */
class CfnDatabasePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_timestream.CfnDatabasePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["databaseName", "kmsKeyId", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Timestream::Database`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_timestream_CfnDatabaseMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnDatabasePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnDatabaseMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnDatabase.isCfnDatabase(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnDatabasePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnDatabasePropsMixin = CfnDatabasePropsMixin;
// @ts-ignore TS6133
function flattenCfnDatabaseMixinProps(props) {
    const ret = {};
    if ((props.kmsKeyId !== undefined))
        ret.kmsKeyId = cdk.getRefProperty(props.kmsKeyId?.keyRef, 'keyId') ?? cdk.ensureStringOrUndefined(props.kmsKeyId, "kmsKeyId", "kms.IKeyRef | string");
    return ret;
}
/**
 * Create a scheduled query that will be run on your behalf at the configured schedule.
 *
 * Timestream assumes the execution role provided as part of the `ScheduledQueryExecutionRoleArn` parameter to run the query. You can use the `NotificationConfiguration` parameter to configure notification for your scheduled query operations.
 *
 * @cloudformationResource AWS::Timestream::ScheduledQuery
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html
 */
class CfnScheduledQueryPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_timestream.CfnScheduledQueryPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["clientToken", "errorReportConfiguration", "kmsKeyId", "notificationConfiguration", "queryString", "scheduleConfiguration", "scheduledQueryExecutionRoleArn", "scheduledQueryName", "tags", "targetConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Timestream::ScheduledQuery`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_timestream_CfnScheduledQueryMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnScheduledQueryPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnScheduledQueryMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnScheduledQuery.isCfnScheduledQuery(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnScheduledQueryPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnScheduledQueryPropsMixin = CfnScheduledQueryPropsMixin;
// @ts-ignore TS6133
function flattenCfnScheduledQueryPropsMixinS3ConfigurationProperty(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")),
        encryptionOption: (!props.encryptionOption ? undefined : props.encryptionOption),
        objectKeyPrefix: (!props.objectKeyPrefix ? undefined : props.objectKeyPrefix)
    };
}
// @ts-ignore TS6133
function flattenCfnScheduledQueryPropsMixinErrorReportConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        s3Configuration: (!props.s3Configuration ? undefined : flattenCfnScheduledQueryPropsMixinS3ConfigurationProperty(props.s3Configuration))
    };
}
// @ts-ignore TS6133
function flattenCfnScheduledQueryPropsMixinSnsConfigurationProperty(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 flattenCfnScheduledQueryPropsMixinNotificationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        snsConfiguration: (!props.snsConfiguration ? undefined : flattenCfnScheduledQueryPropsMixinSnsConfigurationProperty(props.snsConfiguration))
    };
}
// @ts-ignore TS6133
function flattenCfnScheduledQueryMixinProps(props) {
    const ret = {};
    if ((props.errorReportConfiguration !== undefined))
        ret.errorReportConfiguration = flattenCfnScheduledQueryPropsMixinErrorReportConfigurationProperty(props.errorReportConfiguration);
    if ((props.kmsKeyId !== undefined))
        ret.kmsKeyId = cdk.getRefProperty(props.kmsKeyId?.keyRef, 'keyId') ?? cdk.ensureStringOrUndefined(props.kmsKeyId, "kmsKeyId", "kms.IKeyRef | string");
    if ((props.notificationConfiguration !== undefined))
        ret.notificationConfiguration = flattenCfnScheduledQueryPropsMixinNotificationConfigurationProperty(props.notificationConfiguration);
    if ((props.scheduledQueryExecutionRoleArn !== undefined))
        ret.scheduledQueryExecutionRoleArn = cdk.getRefProperty(props.scheduledQueryExecutionRoleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.scheduledQueryExecutionRoleArn, "scheduledQueryExecutionRoleArn", "iam.IRoleRef | string");
    return ret;
}
/**
 * The CreateTable operation adds a new table to an existing database in your account.
 *
 * In an AWS account, table names must be at least unique within each Region if they are in the same database. You may have identical table names in the same Region if the tables are in separate databases. While creating the table, you must specify the table name, database name, and the retention properties. [Service quotas apply](https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html) . See [code sample](https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.create-table.html) for details.
 *
 * @cloudformationResource AWS::Timestream::Table
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-table.html
 */
class CfnTablePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_timestream.CfnTablePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["databaseName", "magneticStoreWriteProperties", "retentionProperties", "schema", "tableName", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Timestream::Table`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_timestream_CfnTableMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnTablePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnTableMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnTable.isCfnTable(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnTablePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnTablePropsMixin = CfnTablePropsMixin;
// @ts-ignore TS6133
function flattenCfnTablePropsMixinS3ConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        bucketName: (!props.bucketName ? undefined : props.bucketName),
        encryptionOption: (!props.encryptionOption ? undefined : props.encryptionOption),
        kmsKeyId: (!props.kmsKeyId ? undefined : cdk.getRefProperty(props.kmsKeyId?.keyRef, 'keyId') ?? cdk.ensureStringOrUndefined(props.kmsKeyId, "kmsKeyId", "kms.IKeyRef | string")),
        objectKeyPrefix: (!props.objectKeyPrefix ? undefined : props.objectKeyPrefix)
    };
}
// @ts-ignore TS6133
function flattenCfnTablePropsMixinMagneticStoreRejectedDataLocationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        s3Configuration: (!props.s3Configuration ? undefined : (!props.s3Configuration ? undefined : flattenCfnTablePropsMixinS3ConfigurationProperty(props.s3Configuration)))
    };
}
// @ts-ignore TS6133
function flattenCfnTablePropsMixinMagneticStoreWritePropertiesProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        enableMagneticStoreWrites: (!props.enableMagneticStoreWrites ? undefined : props.enableMagneticStoreWrites),
        magneticStoreRejectedDataLocation: (!props.magneticStoreRejectedDataLocation ? undefined : (!props.magneticStoreRejectedDataLocation ? undefined : flattenCfnTablePropsMixinMagneticStoreRejectedDataLocationProperty(props.magneticStoreRejectedDataLocation)))
    };
}
// @ts-ignore TS6133
function flattenCfnTableMixinProps(props) {
    const ret = {};
    if ((props.databaseName !== undefined))
        ret.databaseName = cdk.getRefProperty(props.databaseName?.databaseRef, 'databaseName') ?? cdk.ensureStringOrUndefined(props.databaseName, "databaseName", "timestream.IDatabaseRef | string");
    return ret;
}
/**
 * The AWS::Timestream::InfluxDBCluster resource creates an InfluxDB cluster.
 *
 * @cloudformationResource AWS::Timestream::InfluxDBCluster
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-influxdbcluster.html
 */
class CfnInfluxDBClusterPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_timestream.CfnInfluxDBClusterPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["allocatedStorage", "bucket", "dbInstanceType", "dbParameterGroupIdentifier", "dbStorageType", "deploymentType", "failoverMode", "logDeliveryConfiguration", "maintenanceSchedule", "name", "networkType", "organization", "password", "port", "publiclyAccessible", "tags", "username", "vpcSecurityGroupIds", "vpcSubnetIds"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Timestream::InfluxDBCluster`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_timestream_CfnInfluxDBClusterMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnInfluxDBClusterPropsMixin);
            }
            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.CfnInfluxDBCluster.isCfnInfluxDBCluster(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnInfluxDBClusterPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnInfluxDBClusterPropsMixin = CfnInfluxDBClusterPropsMixin;
/**
 * A DB instance is an isolated database environment running in the cloud.
 *
 * It is the basic building block of Amazon Timestream for InfluxDB. A DB instance can contain multiple user-created databases (or organizations and buckets for the case of InfluxDb 2.x databases), and can be accessed using the same client tools and applications you might use to access a standalone self-managed InfluxDB instance.
 *
 * @cloudformationResource AWS::Timestream::InfluxDBInstance
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-influxdbinstance.html
 */
class CfnInfluxDBInstancePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_timestream.CfnInfluxDBInstancePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["allocatedStorage", "bucket", "dbInstanceType", "dbParameterGroupIdentifier", "dbStorageType", "deploymentType", "logDeliveryConfiguration", "maintenanceSchedule", "name", "networkType", "organization", "password", "port", "publiclyAccessible", "tags", "username", "vpcSecurityGroupIds", "vpcSubnetIds"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Timestream::InfluxDBInstance`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_timestream_CfnInfluxDBInstanceMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnInfluxDBInstancePropsMixin);
            }
            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.CfnInfluxDBInstance.isCfnInfluxDBInstance(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnInfluxDBInstancePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnInfluxDBInstancePropsMixin = CfnInfluxDBInstancePropsMixin;
