"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.CfnResourcePolicyPropsMixin = exports.CfnBotVersionPropsMixin = exports.CfnBotAliasPropsMixin = exports.CfnBotPropsMixin = 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-lex"));
/**
 * > Amazon Lex V2 is the only supported version in CloudFormation .
 *
 * Specifies an Amazon Lex conversational bot.
 *
 * You must configure an intent based on the `AMAZON.FallbackIntent` built-in intent. If you don't add one, creating the bot will fail.
 *
 * @cloudformationResource AWS::Lex::Bot
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lex-bot.html
 */
class CfnBotPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_lex.CfnBotPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoBuildBotLocales", "botFileS3Location", "botLocales", "botTags", "dataPrivacy", "description", "errorLogSettings", "idleSessionTtlInSeconds", "name", "replication", "roleArn", "testBotAliasSettings", "testBotAliasTags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Lex::Bot`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_lex_CfnBotMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnBotPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnBotMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnBot.isCfnBot(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnBotPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnBotPropsMixin = CfnBotPropsMixin;
// @ts-ignore TS6133
function flattenCfnBotMixinProps(props) {
    const ret = {};
    if ((props.roleArn !== undefined))
        ret.roleArn = cdk.getRefProperty(props.roleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.roleArn, "roleArn", "iam.IRoleRef | string");
    return ret;
}
/**
 * > Amazon Lex V2 is the only supported version in CloudFormation .
 *
 * Specifies an alias for the specified version of a bot. Use an alias to enable you to change the version of a bot without updating applications that use the bot.
 *
 * For example, you can specify an alias called "PROD" that your applications use to call the Amazon Lex bot.
 *
 * @cloudformationResource AWS::Lex::BotAlias
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lex-botalias.html
 */
class CfnBotAliasPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_lex.CfnBotAliasPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["botAliasLocaleSettings", "botAliasName", "botAliasTags", "botId", "botVersion", "conversationLogSettings", "description", "sentimentAnalysisSettings"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Lex::BotAlias`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_lex_CfnBotAliasMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnBotAliasPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnBotAliasMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnBotAlias.isCfnBotAlias(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnBotAliasPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnBotAliasPropsMixin = CfnBotAliasPropsMixin;
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinLambdaCodeHookProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        codeHookInterfaceVersion: (!props.codeHookInterfaceVersion ? undefined : props.codeHookInterfaceVersion),
        lambdaArn: (!props.lambdaArn ? undefined : cdk.getRefProperty(props.lambdaArn?.functionRef, 'functionArn') ?? cdk.ensureStringOrUndefined(props.lambdaArn, "lambdaArn", "lambda.IFunctionRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinCodeHookSpecificationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        lambdaCodeHook: (!props.lambdaCodeHook ? undefined : flattenCfnBotAliasPropsMixinLambdaCodeHookProperty(props.lambdaCodeHook))
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinBotAliasLocaleSettingsProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        codeHookSpecification: (!props.codeHookSpecification ? undefined : (!props.codeHookSpecification ? undefined : flattenCfnBotAliasPropsMixinCodeHookSpecificationProperty(props.codeHookSpecification))),
        enabled: (!props.enabled ? undefined : props.enabled)
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinBotAliasLocaleSettingsItemProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        botAliasLocaleSetting: (!props.botAliasLocaleSetting ? undefined : flattenCfnBotAliasPropsMixinBotAliasLocaleSettingsProperty(props.botAliasLocaleSetting)),
        localeId: (!props.localeId ? undefined : props.localeId)
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinCloudWatchLogGroupLogDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        cloudWatchLogGroupArn: (!props.cloudWatchLogGroupArn ? undefined : cdk.getRefProperty(props.cloudWatchLogGroupArn?.logGroupRef, 'logGroupArn') ?? cdk.ensureStringOrUndefined(props.cloudWatchLogGroupArn, "cloudWatchLogGroupArn", "logs.ILogGroupRef | string")),
        logPrefix: (!props.logPrefix ? undefined : props.logPrefix)
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinTextLogDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        cloudWatch: (!props.cloudWatch ? undefined : flattenCfnBotAliasPropsMixinCloudWatchLogGroupLogDestinationProperty(props.cloudWatch))
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinTextLogSettingProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        destination: (!props.destination ? undefined : flattenCfnBotAliasPropsMixinTextLogDestinationProperty(props.destination)),
        enabled: (!props.enabled ? undefined : props.enabled)
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinS3BucketLogDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        kmsKeyArn: (!props.kmsKeyArn ? undefined : props.kmsKeyArn),
        logPrefix: (!props.logPrefix ? undefined : props.logPrefix),
        s3BucketArn: (!props.s3BucketArn ? undefined : cdk.getRefProperty(props.s3BucketArn?.bucketRef, 'bucketArn') ?? cdk.ensureStringOrUndefined(props.s3BucketArn, "s3BucketArn", "s3.IBucketRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinAudioLogDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        s3Bucket: (!props.s3Bucket ? undefined : flattenCfnBotAliasPropsMixinS3BucketLogDestinationProperty(props.s3Bucket))
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinAudioLogSettingProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        destination: (!props.destination ? undefined : flattenCfnBotAliasPropsMixinAudioLogDestinationProperty(props.destination)),
        enabled: (!props.enabled ? undefined : props.enabled)
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasPropsMixinConversationLogSettingsProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        audioLogSettings: (!props.audioLogSettings ? undefined : (cdk.isResolvableObject(props.audioLogSettings) ? props.audioLogSettings : (!props.audioLogSettings ? undefined : cdk.mapArrayInPlace(props.audioLogSettings, (item) => flattenCfnBotAliasPropsMixinAudioLogSettingProperty(item))))),
        textLogSettings: (!props.textLogSettings ? undefined : (cdk.isResolvableObject(props.textLogSettings) ? props.textLogSettings : (!props.textLogSettings ? undefined : cdk.mapArrayInPlace(props.textLogSettings, (item) => flattenCfnBotAliasPropsMixinTextLogSettingProperty(item)))))
    };
}
// @ts-ignore TS6133
function flattenCfnBotAliasMixinProps(props) {
    const ret = {};
    if ((props.botAliasLocaleSettings !== undefined))
        ret.botAliasLocaleSettings = (cdk.isResolvableObject(props.botAliasLocaleSettings) ? props.botAliasLocaleSettings : cdk.mapArrayInPlace(props.botAliasLocaleSettings, (item) => flattenCfnBotAliasPropsMixinBotAliasLocaleSettingsItemProperty(item)));
    if ((props.conversationLogSettings !== undefined))
        ret.conversationLogSettings = flattenCfnBotAliasPropsMixinConversationLogSettingsProperty(props.conversationLogSettings);
    return ret;
}
/**
 * > Amazon Lex V2 is the only supported version in CloudFormation .
 *
 * Specifies a new version of the bot based on the `DRAFT` version. If the `DRAFT` version of this resource hasn't changed since you created the last version, Amazon Lex doesn't create a new version, it returns the last created version.
 *
 * When you specify the first version of a bot, Amazon Lex sets the version to 1. Subsequent versions increment by 1.
 *
 * @cloudformationResource AWS::Lex::BotVersion
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lex-botversion.html
 */
class CfnBotVersionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_lex.CfnBotVersionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["botId", "botVersionLocaleSpecification", "description"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Lex::BotVersion`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_lex_CfnBotVersionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnBotVersionPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnBotVersionMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnBotVersion.isCfnBotVersion(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnBotVersionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnBotVersionPropsMixin = CfnBotVersionPropsMixin;
// @ts-ignore TS6133
function flattenCfnBotVersionMixinProps(props) {
    const ret = {};
    if ((props.botId !== undefined))
        ret.botId = cdk.getRefProperty(props.botId?.botRef, 'botId') ?? cdk.ensureStringOrUndefined(props.botId, "botId", "lex.IBotRef | string");
    return ret;
}
/**
 * > Amazon Lex V2 is the only supported version in CloudFormation .
 *
 * Specifies a new resource policy with the specified policy statements.
 *
 * @cloudformationResource AWS::Lex::ResourcePolicy
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lex-resourcepolicy.html
 */
class CfnResourcePolicyPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_lex.CfnResourcePolicyPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["policy", "resourceArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Lex::ResourcePolicy`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_lex_CfnResourcePolicyMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnResourcePolicyPropsMixin);
            }
            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.CfnResourcePolicy.isCfnResourcePolicy(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnResourcePolicyPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnResourcePolicyPropsMixin = CfnResourcePolicyPropsMixin;
