"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.CfnStateMachineVersionPropsMixin = exports.CfnStateMachineAliasPropsMixin = exports.CfnStateMachinePropsMixin = exports.CfnActivityPropsMixin = 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-stepfunctions"));
/**
 * An activity is a task that you write in any programming language and host on any machine that has access to AWS Step Functions .
 *
 * Activities must poll Step Functions using the `GetActivityTask` API action and respond using `SendTask*` API actions. This function makes Step Functions aware of your activity and returns an identifier for use in a state machine and when polling from the activity.
 *
 * For information about creating an activity, see [Creating an Activity State Machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-creating-activity-state-machine.html) in the *AWS Step Functions Developer Guide* and [CreateActivity](https://docs.aws.amazon.com/step-functions/latest/apireference/API_CreateActivity.html) in the *AWS Step Functions API Reference* .
 *
 * @cloudformationResource AWS::StepFunctions::Activity
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-activity.html
 */
class CfnActivityPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_stepfunctions.CfnActivityPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["encryptionConfiguration", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::StepFunctions::Activity`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_stepfunctions_CfnActivityMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnActivityPropsMixin);
            }
            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.CfnActivity.isCfnActivity(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnActivityPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnActivityPropsMixin = CfnActivityPropsMixin;
/**
 * Provisions a state machine.
 *
 * A state machine consists of a collection of states that can do work ( `Task` states), determine to which states to transition next ( `Choice` states), stop an execution with an error ( `Fail` states), and so on. State machines are specified using a JSON-based, structured language.
 *
 * @cloudformationResource AWS::StepFunctions::StateMachine
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html
 */
class CfnStateMachinePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_stepfunctions.CfnStateMachinePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["definition", "definitionS3Location", "definitionString", "definitionSubstitutions", "encryptionConfiguration", "loggingConfiguration", "roleArn", "stateMachineName", "stateMachineType", "tags", "tracingConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::StepFunctions::StateMachine`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_stepfunctions_CfnStateMachineMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnStateMachinePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnStateMachineMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnStateMachine.isCfnStateMachine(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnStateMachinePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnStateMachinePropsMixin = CfnStateMachinePropsMixin;
// @ts-ignore TS6133
function flattenCfnStateMachinePropsMixinCloudWatchLogsLogGroupProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        logGroupArn: (!props.logGroupArn ? undefined : cdk.getRefProperty(props.logGroupArn?.logGroupRef, 'logGroupArn') ?? cdk.ensureStringOrUndefined(props.logGroupArn, "logGroupArn", "logs.ILogGroupRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnStateMachinePropsMixinLogDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        cloudWatchLogsLogGroup: (!props.cloudWatchLogsLogGroup ? undefined : (!props.cloudWatchLogsLogGroup ? undefined : flattenCfnStateMachinePropsMixinCloudWatchLogsLogGroupProperty(props.cloudWatchLogsLogGroup)))
    };
}
// @ts-ignore TS6133
function flattenCfnStateMachinePropsMixinLoggingConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        destinations: (!props.destinations ? undefined : (cdk.isResolvableObject(props.destinations) ? props.destinations : (!props.destinations ? undefined : cdk.mapArrayInPlace(props.destinations, (item) => flattenCfnStateMachinePropsMixinLogDestinationProperty(item))))),
        includeExecutionData: (!props.includeExecutionData ? undefined : props.includeExecutionData),
        level: (!props.level ? undefined : props.level)
    };
}
// @ts-ignore TS6133
function flattenCfnStateMachineMixinProps(props) {
    const ret = {};
    if ((props.definitionString !== undefined))
        ret.definitionString = cdk.getRefProperty(props.definitionString?.functionRef, 'functionArn') ?? cdk.getRefProperty(props.definitionString?.versionRef, 'functionArn') ?? cdk.getRefProperty(props.definitionString?.taskDefinitionRef, 'taskDefinitionArn') ?? cdk.getRefProperty(props.definitionString?.tableRef, 'tableArn') ?? cdk.getRefProperty(props.definitionString?.topicRef, 'topicArn') ?? cdk.getRefProperty(props.definitionString?.functionRef, 'functionName') ?? cdk.getRefProperty(props.definitionString?.tableRef, 'tableName') ?? cdk.getRefProperty(props.definitionString?.queueRef, 'queueUrl') ?? cdk.ensureStringOrUndefined(props.definitionString, "definitionString", "lambda.IFunctionRef | lambda.IVersionRef | ecs.ITaskDefinitionRef | dynamodb.ITableRef | sns.ITopicRef | sqs.IQueueRef | string");
    if ((props.loggingConfiguration !== undefined))
        ret.loggingConfiguration = flattenCfnStateMachinePropsMixinLoggingConfigurationProperty(props.loggingConfiguration);
    if ((props.roleArn !== undefined))
        ret.roleArn = cdk.getRefProperty(props.roleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.roleArn, "roleArn", "iam.IRoleRef | string");
    return ret;
}
/**
 * Represents a state machine [alias](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html) . An alias routes traffic to one or two versions of the same state machine.
 *
 * You can create up to 100 aliases for each state machine.
 *
 * @cloudformationResource AWS::StepFunctions::StateMachineAlias
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachinealias.html
 */
class CfnStateMachineAliasPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_stepfunctions.CfnStateMachineAliasPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["deploymentPreference", "description", "name", "routingConfiguration", "stateMachineArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::StepFunctions::StateMachineAlias`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_stepfunctions_CfnStateMachineAliasMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnStateMachineAliasPropsMixin);
            }
            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.CfnStateMachineAlias.isCfnStateMachineAlias(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnStateMachineAliasPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnStateMachineAliasPropsMixin = CfnStateMachineAliasPropsMixin;
/**
 * Represents a state machine [version](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html) . A published version uses the latest state machine [*revision*](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html) . A revision is an immutable, read-only snapshot of a state machine’s definition and configuration.
 *
 * You can publish up to 1000 versions for each state machine.
 *
 * > Before you delete a version, make sure that version's ARN isn't being referenced in any long-running workflows or application code outside of the stack.
 *
 * @cloudformationResource AWS::StepFunctions::StateMachineVersion
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html
 */
class CfnStateMachineVersionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_stepfunctions.CfnStateMachineVersionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "stateMachineArn", "stateMachineRevisionId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::StepFunctions::StateMachineVersion`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_stepfunctions_CfnStateMachineVersionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnStateMachineVersionPropsMixin);
            }
            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.CfnStateMachineVersion.isCfnStateMachineVersion(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnStateMachineVersionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnStateMachineVersionPropsMixin = CfnStateMachineVersionPropsMixin;
