"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.CfnRoomPropsMixin = exports.CfnLoggingConfigurationPropsMixin = 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-ivschat"));
/**
 * The `AWS::IVSChat::LoggingConfiguration` resource specifies an  logging configuration that allows clients to store and record sent messages.
 *
 * For more information, see [CreateLoggingConfiguration](https://docs.aws.amazon.com/ivs/latest/ChatAPIReference/API_CreateLoggingConfiguration.html) in the *Amazon Interactive Video Service Chat API Reference* .
 *
 * @cloudformationResource AWS::IVSChat::LoggingConfiguration
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ivschat-loggingconfiguration.html
 */
class CfnLoggingConfigurationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ivschat.CfnLoggingConfigurationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["destinationConfiguration", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::IVSChat::LoggingConfiguration`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ivschat_CfnLoggingConfigurationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnLoggingConfigurationPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnLoggingConfigurationMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnLoggingConfiguration.isCfnLoggingConfiguration(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnLoggingConfigurationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnLoggingConfigurationPropsMixin = CfnLoggingConfigurationPropsMixin;
// @ts-ignore TS6133
function flattenCfnLoggingConfigurationPropsMixinS3DestinationConfigurationProperty(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"))
    };
}
// @ts-ignore TS6133
function flattenCfnLoggingConfigurationPropsMixinFirehoseDestinationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        deliveryStreamName: (!props.deliveryStreamName ? undefined : cdk.getRefProperty(props.deliveryStreamName?.deliveryStreamRef, 'deliveryStreamName') ?? cdk.ensureStringOrUndefined(props.deliveryStreamName, "deliveryStreamName", "kinesisfirehose.IDeliveryStreamRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnLoggingConfigurationPropsMixinCloudWatchLogsDestinationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        logGroupName: (!props.logGroupName ? undefined : cdk.getRefProperty(props.logGroupName?.logGroupRef, 'logGroupName') ?? cdk.ensureStringOrUndefined(props.logGroupName, "logGroupName", "logs.ILogGroupRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnLoggingConfigurationPropsMixinDestinationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        cloudWatchLogs: (!props.cloudWatchLogs ? undefined : (!props.cloudWatchLogs ? undefined : flattenCfnLoggingConfigurationPropsMixinCloudWatchLogsDestinationConfigurationProperty(props.cloudWatchLogs))),
        firehose: (!props.firehose ? undefined : (!props.firehose ? undefined : flattenCfnLoggingConfigurationPropsMixinFirehoseDestinationConfigurationProperty(props.firehose))),
        s3: (!props.s3 ? undefined : (!props.s3 ? undefined : flattenCfnLoggingConfigurationPropsMixinS3DestinationConfigurationProperty(props.s3)))
    };
}
// @ts-ignore TS6133
function flattenCfnLoggingConfigurationMixinProps(props) {
    const ret = {};
    if ((props.destinationConfiguration !== undefined))
        ret.destinationConfiguration = flattenCfnLoggingConfigurationPropsMixinDestinationConfigurationProperty(props.destinationConfiguration);
    return ret;
}
/**
 * The `AWS::IVSChat::Room` resource specifies an  room that allows clients to connect and pass messages.
 *
 * For more information, see [CreateRoom](https://docs.aws.amazon.com/ivs/latest/ChatAPIReference/API_CreateRoom.html) in the *Amazon Interactive Video Service Chat API Reference* .
 *
 * @cloudformationResource AWS::IVSChat::Room
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ivschat-room.html
 */
class CfnRoomPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ivschat.CfnRoomPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["loggingConfigurationIdentifiers", "maximumMessageLength", "maximumMessageRatePerSecond", "messageReviewHandler", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::IVSChat::Room`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ivschat_CfnRoomMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnRoomPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnRoomMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnRoom.isCfnRoom(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnRoomPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnRoomPropsMixin = CfnRoomPropsMixin;
// @ts-ignore TS6133
function flattenCfnRoomPropsMixinMessageReviewHandlerProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        fallbackResult: (!props.fallbackResult ? undefined : props.fallbackResult),
        uri: (!props.uri ? undefined : cdk.getRefProperty(props.uri?.functionRef, 'functionArn') ?? cdk.ensureStringOrUndefined(props.uri, "uri", "lambda.IFunctionRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnRoomMixinProps(props) {
    const ret = {};
    if ((props.loggingConfigurationIdentifiers !== undefined))
        ret.loggingConfigurationIdentifiers = cdk.mapArrayInPlace(props.loggingConfigurationIdentifiers, (item) => cdk.getRefProperty(item?.loggingConfigurationRef, 'loggingConfigurationArn') ?? cdk.ensureStringOrUndefined(item, "loggingConfigurationIdentifiers", "ivschat.ILoggingConfigurationRef | string"));
    if ((props.messageReviewHandler !== undefined))
        ret.messageReviewHandler = flattenCfnRoomPropsMixinMessageReviewHandlerProperty(props.messageReviewHandler);
    return ret;
}
