"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.CfnWorkGroupPropsMixin = exports.CfnPreparedStatementPropsMixin = exports.CfnNamedQueryPropsMixin = exports.CfnDataCatalogPropsMixin = exports.CfnCapacityReservationPropsMixin = 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-athena"));
/**
 * Specifies a capacity reservation with the provided name and number of requested data processing units.
 *
 * @cloudformationResource AWS::Athena::CapacityReservation
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-capacityreservation.html
 */
class CfnCapacityReservationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_athena.CfnCapacityReservationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["capacityAssignmentConfiguration", "name", "tags", "targetDpus"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Athena::CapacityReservation`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_athena_CfnCapacityReservationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnCapacityReservationPropsMixin);
            }
            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.CfnCapacityReservation.isCfnCapacityReservation(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnCapacityReservationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnCapacityReservationPropsMixin = CfnCapacityReservationPropsMixin;
/**
 * The AWS::Athena::DataCatalog resource specifies an Amazon Athena data catalog, which contains a name, description, type, parameters, and tags.
 *
 * For more information, see [DataCatalog](https://docs.aws.amazon.com/athena/latest/APIReference/API_DataCatalog.html) in the *Amazon Athena API Reference* .
 *
 * @cloudformationResource AWS::Athena::DataCatalog
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-datacatalog.html
 */
class CfnDataCatalogPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_athena.CfnDataCatalogPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["connectionType", "description", "error", "name", "parameters", "status", "tags", "type"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Athena::DataCatalog`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_athena_CfnDataCatalogMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnDataCatalogPropsMixin);
            }
            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.CfnDataCatalog.isCfnDataCatalog(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnDataCatalogPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnDataCatalogPropsMixin = CfnDataCatalogPropsMixin;
/**
 * The `AWS::Athena::NamedQuery` resource specifies an Amazon Athena saved query, where `QueryString` contains the SQL query statements that make up the query.
 *
 * @cloudformationResource AWS::Athena::NamedQuery
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-namedquery.html
 */
class CfnNamedQueryPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_athena.CfnNamedQueryPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["database", "description", "name", "queryString", "workGroup"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Athena::NamedQuery`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_athena_CfnNamedQueryMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnNamedQueryPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnNamedQueryMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnNamedQuery.isCfnNamedQuery(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnNamedQueryPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnNamedQueryPropsMixin = CfnNamedQueryPropsMixin;
// @ts-ignore TS6133
function flattenCfnNamedQueryMixinProps(props) {
    const ret = {};
    if ((props.database !== undefined))
        ret.database = props.database;
    if ((props.workGroup !== undefined))
        ret.workGroup = cdk.getRefProperty(props.workGroup?.workGroupRef, 'workGroupName') ?? cdk.ensureStringOrUndefined(props.workGroup, "workGroup", "athena.IWorkGroupRef | string");
    return ret;
}
/**
 * Specifies a prepared statement for use with SQL queries in Athena.
 *
 * @cloudformationResource AWS::Athena::PreparedStatement
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-preparedstatement.html
 */
class CfnPreparedStatementPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_athena.CfnPreparedStatementPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "queryStatement", "statementName", "workGroup"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Athena::PreparedStatement`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_athena_CfnPreparedStatementMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnPreparedStatementPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnPreparedStatementMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnPreparedStatement.isCfnPreparedStatement(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnPreparedStatementPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnPreparedStatementPropsMixin = CfnPreparedStatementPropsMixin;
// @ts-ignore TS6133
function flattenCfnPreparedStatementMixinProps(props) {
    const ret = {};
    if ((props.workGroup !== undefined))
        ret.workGroup = cdk.getRefProperty(props.workGroup?.workGroupRef, 'workGroupName') ?? cdk.ensureStringOrUndefined(props.workGroup, "workGroup", "athena.IWorkGroupRef | string");
    return ret;
}
/**
 * The AWS::Athena::WorkGroup resource specifies an Amazon Athena workgroup, which contains a name, description, creation time, state, and other configuration, listed under `WorkGroupConfiguration` .
 *
 * Each workgroup enables you to isolate queries for you or your group from other queries in the same account. For more information, see [CreateWorkGroup](https://docs.aws.amazon.com/athena/latest/APIReference/API_CreateWorkGroup.html) in the *Amazon Athena API Reference* .
 *
 * @cloudformationResource AWS::Athena::WorkGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-workgroup.html
 */
class CfnWorkGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_athena.CfnWorkGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "name", "recursiveDeleteOption", "state", "tags", "workGroupConfiguration", "workGroupConfigurationUpdates"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Athena::WorkGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_athena_CfnWorkGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnWorkGroupPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnWorkGroupMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnWorkGroup.isCfnWorkGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnWorkGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnWorkGroupPropsMixin = CfnWorkGroupPropsMixin;
// @ts-ignore TS6133
function flattenCfnWorkGroupPropsMixinEncryptionConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        encryptionOption: (!props.encryptionOption ? undefined : props.encryptionOption),
        kmsKey: (!props.kmsKey ? undefined : cdk.getRefProperty(props.kmsKey?.keyRef, 'keyArn') ?? cdk.getRefProperty(props.kmsKey?.keyRef, 'keyId') ?? cdk.ensureStringOrUndefined(props.kmsKey, "kmsKey", "kms.IKeyRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnWorkGroupPropsMixinResultConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        aclConfiguration: (!props.aclConfiguration ? undefined : props.aclConfiguration),
        encryptionConfiguration: (!props.encryptionConfiguration ? undefined : (!props.encryptionConfiguration ? undefined : flattenCfnWorkGroupPropsMixinEncryptionConfigurationProperty(props.encryptionConfiguration))),
        expectedBucketOwner: (!props.expectedBucketOwner ? undefined : props.expectedBucketOwner),
        outputLocation: (!props.outputLocation ? undefined : props.outputLocation)
    };
}
// @ts-ignore TS6133
function flattenCfnWorkGroupPropsMixinCustomerContentEncryptionConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        kmsKey: (!props.kmsKey ? undefined : cdk.getRefProperty(props.kmsKey?.keyRef, 'keyArn') ?? cdk.getRefProperty(props.kmsKey?.keyRef, 'keyId') ?? cdk.ensureStringOrUndefined(props.kmsKey, "kmsKey", "kms.IKeyRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnWorkGroupPropsMixinWorkGroupConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        additionalConfiguration: (!props.additionalConfiguration ? undefined : props.additionalConfiguration),
        bytesScannedCutoffPerQuery: (!props.bytesScannedCutoffPerQuery ? undefined : props.bytesScannedCutoffPerQuery),
        customerContentEncryptionConfiguration: (!props.customerContentEncryptionConfiguration ? undefined : (!props.customerContentEncryptionConfiguration ? undefined : flattenCfnWorkGroupPropsMixinCustomerContentEncryptionConfigurationProperty(props.customerContentEncryptionConfiguration))),
        enforceWorkGroupConfiguration: (!props.enforceWorkGroupConfiguration ? undefined : props.enforceWorkGroupConfiguration),
        engineConfiguration: (!props.engineConfiguration ? undefined : props.engineConfiguration),
        engineVersion: (!props.engineVersion ? undefined : props.engineVersion),
        executionRole: (!props.executionRole ? undefined : cdk.getRefProperty(props.executionRole?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.executionRole, "executionRole", "iam.IRoleRef | string")),
        managedQueryResultsConfiguration: (!props.managedQueryResultsConfiguration ? undefined : props.managedQueryResultsConfiguration),
        monitoringConfiguration: (!props.monitoringConfiguration ? undefined : props.monitoringConfiguration),
        publishCloudWatchMetricsEnabled: (!props.publishCloudWatchMetricsEnabled ? undefined : props.publishCloudWatchMetricsEnabled),
        requesterPaysEnabled: (!props.requesterPaysEnabled ? undefined : props.requesterPaysEnabled),
        resultConfiguration: (!props.resultConfiguration ? undefined : (!props.resultConfiguration ? undefined : flattenCfnWorkGroupPropsMixinResultConfigurationProperty(props.resultConfiguration)))
    };
}
// @ts-ignore TS6133
function flattenCfnWorkGroupPropsMixinResultConfigurationUpdatesProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        aclConfiguration: (!props.aclConfiguration ? undefined : props.aclConfiguration),
        encryptionConfiguration: (!props.encryptionConfiguration ? undefined : (!props.encryptionConfiguration ? undefined : flattenCfnWorkGroupPropsMixinEncryptionConfigurationProperty(props.encryptionConfiguration))),
        expectedBucketOwner: (!props.expectedBucketOwner ? undefined : props.expectedBucketOwner),
        outputLocation: (!props.outputLocation ? undefined : props.outputLocation),
        removeAclConfiguration: (!props.removeAclConfiguration ? undefined : props.removeAclConfiguration),
        removeEncryptionConfiguration: (!props.removeEncryptionConfiguration ? undefined : props.removeEncryptionConfiguration),
        removeExpectedBucketOwner: (!props.removeExpectedBucketOwner ? undefined : props.removeExpectedBucketOwner),
        removeOutputLocation: (!props.removeOutputLocation ? undefined : props.removeOutputLocation)
    };
}
// @ts-ignore TS6133
function flattenCfnWorkGroupPropsMixinWorkGroupConfigurationUpdatesProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        additionalConfiguration: (!props.additionalConfiguration ? undefined : props.additionalConfiguration),
        bytesScannedCutoffPerQuery: (!props.bytesScannedCutoffPerQuery ? undefined : props.bytesScannedCutoffPerQuery),
        customerContentEncryptionConfiguration: (!props.customerContentEncryptionConfiguration ? undefined : (!props.customerContentEncryptionConfiguration ? undefined : flattenCfnWorkGroupPropsMixinCustomerContentEncryptionConfigurationProperty(props.customerContentEncryptionConfiguration))),
        enforceWorkGroupConfiguration: (!props.enforceWorkGroupConfiguration ? undefined : props.enforceWorkGroupConfiguration),
        engineConfiguration: (!props.engineConfiguration ? undefined : props.engineConfiguration),
        engineVersion: (!props.engineVersion ? undefined : props.engineVersion),
        executionRole: (!props.executionRole ? undefined : cdk.getRefProperty(props.executionRole?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.executionRole, "executionRole", "iam.IRoleRef | string")),
        managedQueryResultsConfiguration: (!props.managedQueryResultsConfiguration ? undefined : props.managedQueryResultsConfiguration),
        monitoringConfiguration: (!props.monitoringConfiguration ? undefined : props.monitoringConfiguration),
        publishCloudWatchMetricsEnabled: (!props.publishCloudWatchMetricsEnabled ? undefined : props.publishCloudWatchMetricsEnabled),
        removeBytesScannedCutoffPerQuery: (!props.removeBytesScannedCutoffPerQuery ? undefined : props.removeBytesScannedCutoffPerQuery),
        removeCustomerContentEncryptionConfiguration: (!props.removeCustomerContentEncryptionConfiguration ? undefined : props.removeCustomerContentEncryptionConfiguration),
        requesterPaysEnabled: (!props.requesterPaysEnabled ? undefined : props.requesterPaysEnabled),
        resultConfigurationUpdates: (!props.resultConfigurationUpdates ? undefined : (!props.resultConfigurationUpdates ? undefined : flattenCfnWorkGroupPropsMixinResultConfigurationUpdatesProperty(props.resultConfigurationUpdates)))
    };
}
// @ts-ignore TS6133
function flattenCfnWorkGroupMixinProps(props) {
    const ret = {};
    if ((props.workGroupConfiguration !== undefined))
        ret.workGroupConfiguration = flattenCfnWorkGroupPropsMixinWorkGroupConfigurationProperty(props.workGroupConfiguration);
    if ((props.workGroupConfigurationUpdates !== undefined))
        ret.workGroupConfigurationUpdates = flattenCfnWorkGroupPropsMixinWorkGroupConfigurationUpdatesProperty(props.workGroupConfigurationUpdates);
    return ret;
}
