"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.CfnRulePropsMixin = exports.CfnEventBusPolicyPropsMixin = exports.CfnEventBusPropsMixin = exports.CfnEndpointPropsMixin = exports.CfnConnectionPropsMixin = exports.CfnArchivePropsMixin = exports.CfnApiDestinationPropsMixin = void 0;
/* eslint-disable @stylistic/max-len, eol-last */
const cdk = __importStar(require("aws-cdk-lib/core"));
const service = __importStar(require("aws-cdk-lib/aws-events"));
/**
 * Creates an API destination, which is an HTTP invocation endpoint configured as a target for events.
 *
 * When using ApiDesinations with OAuth authentication we recommend these best practices:
 *
 * - Create a secret in Secrets Manager with your OAuth credentials.
 * - Reference that secret in your CloudFormation template for `AWS::Events::Connection` using CloudFormation dynamic reference syntax. For more information, see [Secrets Manager secrets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#dynamic-references-secretsmanager) .
 *
 * When the Connection resource is created the secret will be passed to EventBridge and stored in the customer account using “Service Linked Secrets,” effectively creating two secrets. This will minimize the cost because the original secret is only accessed when a CloudFormation template is created or updated, not every time an event is sent to the ApiDestination. The secret stored in the customer account by EventBridge is the one used for each event sent to the ApiDestination and AWS is responsible for the fees.
 *
 * > The secret stored in the customer account by EventBridge can’t be updated directly, only when a CloudFormation template is updated.
 *
 * For examples of CloudFormation templates that use secrets, see [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-connection.html#aws-resource-events-connection--examples) .
 *
 * @cloudformationResource AWS::Events::ApiDestination
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-apidestination.html
 */
class CfnApiDestinationPropsMixin extends cdk.Mixin {
    static CFN_PROPERTY_KEYS = ["connectionArn", "description", "httpMethod", "invocationEndpoint", "invocationRateLimitPerSecond", "name"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Events::ApiDestination`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        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.CfnApiDestination.isCfnApiDestination(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnApiDestinationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnApiDestinationPropsMixin = CfnApiDestinationPropsMixin;
/**
 * Creates an archive of events with the specified settings.
 *
 * When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect. If you do not specify a pattern to filter events sent to the archive, all events are sent to the archive except replayed events. Replayed events are not sent to an archive.
 *
 * > If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.
 * >
 * > For more information, see [Encrypting archives](https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html) in the *Amazon EventBridge User Guide* .
 *
 * @cloudformationResource AWS::Events::Archive
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-archive.html
 */
class CfnArchivePropsMixin extends cdk.Mixin {
    static CFN_PROPERTY_KEYS = ["archiveName", "description", "eventPattern", "kmsKeyIdentifier", "retentionDays", "sourceArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Events::Archive`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        this.props = {
            ...props,
            ...flattenCfnArchiveMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnArchive.isCfnArchive(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnArchivePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnArchivePropsMixin = CfnArchivePropsMixin;
// @ts-ignore TS6133
function flattenCfnArchiveMixinProps(props) {
    const ret = {};
    if ((props.sourceArn !== undefined))
        ret.sourceArn = cdk.getRefProperty(props.sourceArn?.eventBusRef, 'eventBusArn') ?? cdk.ensureStringOrUndefined(props.sourceArn, "sourceArn", "events.IEventBusRef | string");
    return ret;
}
/**
 * Creates a connection.
 *
 * A connection defines the authorization type and credentials to use for authorization with an API destination HTTP endpoint.
 *
 * For more information, see [Connections for endpoint targets](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-target-connection.html) in the *Amazon EventBridge User Guide* .
 *
 * @cloudformationResource AWS::Events::Connection
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-connection.html
 */
class CfnConnectionPropsMixin extends cdk.Mixin {
    static CFN_PROPERTY_KEYS = ["authorizationType", "authParameters", "description", "invocationConnectivityParameters", "kmsKeyIdentifier", "name"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Events::Connection`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        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.CfnConnection.isCfnConnection(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnConnectionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnConnectionPropsMixin = CfnConnectionPropsMixin;
/**
 * A global endpoint used to improve your application's availability by making it regional-fault tolerant.
 *
 * For more information about global endpoints, see [Making applications Regional-fault tolerant with global endpoints and event replication](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) in the **Amazon EventBridge User Guide** .
 *
 * @cloudformationResource AWS::Events::Endpoint
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-endpoint.html
 */
class CfnEndpointPropsMixin extends cdk.Mixin {
    static CFN_PROPERTY_KEYS = ["description", "eventBuses", "name", "replicationConfig", "roleArn", "routingConfig"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Events::Endpoint`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        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.CfnEndpoint.isCfnEndpoint(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnEndpointPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnEndpointPropsMixin = CfnEndpointPropsMixin;
/**
 * Specifies an event bus within your account.
 *
 * This can be a custom event bus which you can use to receive events from your custom applications and services, or it can be a partner event bus which can be matched to a partner event source.
 *
 * > As an aid to help you jumpstart developing CloudFormation templates, the EventBridge console enables you to create templates from the existing event buses in your account. For more information, see [Generating CloudFormation templates from an EventBridge event bus](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-generate-event-bus-template.html) in the *Amazon EventBridge User Guide* .
 *
 * @cloudformationResource AWS::Events::EventBus
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html
 */
class CfnEventBusPropsMixin extends cdk.Mixin {
    static CFN_PROPERTY_KEYS = ["deadLetterConfig", "description", "eventSourceName", "kmsKeyIdentifier", "logConfig", "name", "policy", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Events::EventBus`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        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.CfnEventBus.isCfnEventBus(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnEventBusPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnEventBusPropsMixin = CfnEventBusPropsMixin;
/**
 * Running `PutPermission` permits the specified AWS account or AWS organization to put events to the specified *event bus* .
 *
 * Amazon EventBridge rules in your account are triggered by these events arriving to an event bus in your account.
 *
 * For another account to send events to your account, that external account must have an EventBridge rule with your account's event bus as a target.
 *
 * To enable multiple AWS accounts to put events to your event bus, run `PutPermission` once for each of these accounts. Or, if all the accounts are members of the same AWS organization, you can run `PutPermission` once specifying `Principal` as "*" and specifying the AWS organization ID in `Condition` , to grant permissions to all accounts in that organization.
 *
 * If you grant permissions using an organization, then accounts in that organization must specify a `RoleArn` with proper permissions when they use `PutTarget` to add your account's event bus as a target. For more information, see [Sending and Receiving Events Between AWS Accounts](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the *Amazon EventBridge User Guide* .
 *
 * The permission policy on the event bus cannot exceed 10 KB in size.
 *
 * @cloudformationResource AWS::Events::EventBusPolicy
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbuspolicy.html
 */
class CfnEventBusPolicyPropsMixin extends cdk.Mixin {
    static CFN_PROPERTY_KEYS = ["action", "condition", "eventBusName", "principal", "statement", "statementId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Events::EventBusPolicy`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        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.CfnEventBusPolicy.isCfnEventBusPolicy(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnEventBusPolicyPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnEventBusPolicyPropsMixin = CfnEventBusPolicyPropsMixin;
/**
 * Creates or updates the specified rule.
 *
 * Rules are enabled by default, or based on value of the state. You can disable a rule using [DisableRule](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_DisableRule.html) .
 *
 * A single rule watches for events from a single event bus. Events generated by AWS services go to your account's default event bus. Events generated by SaaS partner services or applications go to the matching partner event bus. If you have custom applications or services, you can specify whether their events go to your default event bus or a custom event bus that you have created. For more information, see [CreateEventBus](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_CreateEventBus.html) .
 *
 * If you are updating an existing rule, the rule is replaced with what you specify in this `PutRule` command. If you omit arguments in `PutRule` , the old values for those arguments are not kept. Instead, they are replaced with null values.
 *
 * When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Allow a short period of time for changes to take effect.
 *
 * A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule triggers on matching events as well as on a schedule.
 *
 * Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.
 *
 * In EventBridge, it is possible to create rules that lead to infinite loops, where a rule is fired repeatedly. For example, a rule might detect that ACLs have changed on an S3 bucket, and trigger software to change them to the desired state. If the rule is not written carefully, the subsequent change to the ACLs fires the rule again, creating an infinite loop.
 *
 * To prevent this, write the rules so that the triggered actions do not re-fire the same rule. For example, your rule could fire only if ACLs are found to be in a bad state, instead of after any change.
 *
 * An infinite loop can quickly cause higher than expected charges. We recommend that you use budgeting, which alerts you when charges exceed your specified limit. For more information, see [Managing Your Costs with Budgets](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-managing-costs.html) .
 *
 * > As an aid to help you jumpstart developing CloudFormation templates, the EventBridge console enables you to create templates from the existing rules in your account. For more information, see [Generating CloudFormation templates from an EventBridge rule](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-generate-template.html) in the *Amazon EventBridge User Guide* .
 *
 * @cloudformationResource AWS::Events::Rule
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html
 */
class CfnRulePropsMixin extends cdk.Mixin {
    static CFN_PROPERTY_KEYS = ["description", "eventBusName", "eventPattern", "name", "roleArn", "scheduleExpression", "state", "tags", "targets"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Events::Rule`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        this.props = {
            ...props,
            ...flattenCfnRuleMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnRule.isCfnRule(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnRulePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnRulePropsMixin = CfnRulePropsMixin;
// @ts-ignore TS6133
function flattenCfnRulePropsMixinDeadLetterConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        arn: (!props.arn ? undefined : cdk.getRefProperty(props.arn?.queueRef, 'queueArn') ?? cdk.ensureStringOrUndefined(props.arn, "arn", "sqs.IQueueRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnRulePropsMixinAwsVpcConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        assignPublicIp: (!props.assignPublicIp ? undefined : props.assignPublicIp),
        securityGroups: (!props.securityGroups ? undefined : cdk.mapArrayInPlace(props.securityGroups, (item) => cdk.getRefProperty(item?.securityGroupRef, 'securityGroupId') ?? cdk.ensureStringOrUndefined(item, "securityGroups", "ec2.ISecurityGroupRef | string"))),
        subnets: (!props.subnets ? undefined : cdk.mapArrayInPlace(props.subnets, (item) => cdk.getRefProperty(item?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(item, "subnets", "ec2.ISubnetRef | string")))
    };
}
// @ts-ignore TS6133
function flattenCfnRulePropsMixinNetworkConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        awsVpcConfiguration: (!props.awsVpcConfiguration ? undefined : (!props.awsVpcConfiguration ? undefined : flattenCfnRulePropsMixinAwsVpcConfigurationProperty(props.awsVpcConfiguration)))
    };
}
// @ts-ignore TS6133
function flattenCfnRulePropsMixinEcsParametersProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        capacityProviderStrategy: (!props.capacityProviderStrategy ? undefined : props.capacityProviderStrategy),
        enableEcsManagedTags: (!props.enableEcsManagedTags ? undefined : props.enableEcsManagedTags),
        enableExecuteCommand: (!props.enableExecuteCommand ? undefined : props.enableExecuteCommand),
        group: (!props.group ? undefined : props.group),
        launchType: (!props.launchType ? undefined : props.launchType),
        networkConfiguration: (!props.networkConfiguration ? undefined : (!props.networkConfiguration ? undefined : flattenCfnRulePropsMixinNetworkConfigurationProperty(props.networkConfiguration))),
        placementConstraints: (!props.placementConstraints ? undefined : props.placementConstraints),
        placementStrategies: (!props.placementStrategies ? undefined : props.placementStrategies),
        platformVersion: (!props.platformVersion ? undefined : props.platformVersion),
        propagateTags: (!props.propagateTags ? undefined : props.propagateTags),
        referenceId: (!props.referenceId ? undefined : props.referenceId),
        tagList: (!props.tagList ? undefined : props.tagList),
        taskCount: (!props.taskCount ? undefined : props.taskCount),
        taskDefinitionArn: (!props.taskDefinitionArn ? undefined : cdk.getRefProperty(props.taskDefinitionArn?.taskDefinitionRef, 'taskDefinitionArn') ?? cdk.ensureStringOrUndefined(props.taskDefinitionArn, "taskDefinitionArn", "ecs.ITaskDefinitionRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnRulePropsMixinRunCommandTargetProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        key: (!props.key ? undefined : props.key),
        values: (!props.values ? undefined : cdk.mapArrayInPlace(props.values, (item) => cdk.getRefProperty(item?.instanceRef, 'instanceId') ?? cdk.ensureStringOrUndefined(item, "values", "ec2.IInstanceRef | string")))
    };
}
// @ts-ignore TS6133
function flattenCfnRulePropsMixinRunCommandParametersProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        runCommandTargets: (!props.runCommandTargets ? undefined : (cdk.isResolvableObject(props.runCommandTargets) ? props.runCommandTargets : cdk.mapArrayInPlace(props.runCommandTargets, (item) => flattenCfnRulePropsMixinRunCommandTargetProperty(item))))
    };
}
// @ts-ignore TS6133
function flattenCfnRulePropsMixinTargetProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        appSyncParameters: (!props.appSyncParameters ? undefined : props.appSyncParameters),
        arn: (!props.arn ? undefined : cdk.getRefProperty(props.arn?.functionRef, 'functionArn') ?? cdk.getRefProperty(props.arn?.topicRef, 'topicArn') ?? cdk.getRefProperty(props.arn?.stateMachineRef, 'stateMachineArn') ?? cdk.getRefProperty(props.arn?.queueRef, 'queueArn') ?? cdk.getRefProperty(props.arn?.clusterRef, 'clusterArn') ?? cdk.getRefProperty(props.arn?.versionRef, 'functionArn') ?? cdk.getRefProperty(props.arn?.logGroupRef, 'logGroupArn') ?? cdk.getRefProperty(props.arn?.eventBusRef, 'eventBusArn') ?? cdk.getRefProperty(props.arn?.assessmentTemplateRef, 'assessmentTemplateArn') ?? cdk.getRefProperty(props.arn?.deliveryStreamRef, 'deliveryStreamArn') ?? cdk.getRefProperty(props.arn?.jobQueueRef, 'jobQueueArn') ?? cdk.getRefProperty(props.arn?.streamRef, 'streamArn') ?? cdk.ensureStringOrUndefined(props.arn, "arn", "lambda.IFunctionRef | sns.ITopicRef | stepfunctions.IStateMachineRef | sqs.IQueueRef | ecs.IClusterRef | lambda.IVersionRef | logs.ILogGroupRef | events.IEventBusRef | inspector.IAssessmentTemplateRef | kinesisfirehose.IDeliveryStreamRef | batch.IJobQueueRef | kinesis.IStreamRef | string")),
        batchParameters: (!props.batchParameters ? undefined : props.batchParameters),
        deadLetterConfig: (!props.deadLetterConfig ? undefined : (!props.deadLetterConfig ? undefined : flattenCfnRulePropsMixinDeadLetterConfigProperty(props.deadLetterConfig))),
        ecsParameters: (!props.ecsParameters ? undefined : (!props.ecsParameters ? undefined : flattenCfnRulePropsMixinEcsParametersProperty(props.ecsParameters))),
        httpParameters: (!props.httpParameters ? undefined : props.httpParameters),
        id: (!props.id ? undefined : props.id),
        input: (!props.input ? undefined : props.input),
        inputPath: (!props.inputPath ? undefined : props.inputPath),
        inputTransformer: (!props.inputTransformer ? undefined : props.inputTransformer),
        kinesisParameters: (!props.kinesisParameters ? undefined : props.kinesisParameters),
        redshiftDataParameters: (!props.redshiftDataParameters ? undefined : props.redshiftDataParameters),
        retryPolicy: (!props.retryPolicy ? undefined : props.retryPolicy),
        roleArn: (!props.roleArn ? undefined : cdk.getRefProperty(props.roleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.roleArn, "roleArn", "iam.IRoleRef | string")),
        runCommandParameters: (!props.runCommandParameters ? undefined : (!props.runCommandParameters ? undefined : flattenCfnRulePropsMixinRunCommandParametersProperty(props.runCommandParameters))),
        sageMakerPipelineParameters: (!props.sageMakerPipelineParameters ? undefined : props.sageMakerPipelineParameters),
        sqsParameters: (!props.sqsParameters ? undefined : props.sqsParameters)
    };
}
// @ts-ignore TS6133
function flattenCfnRuleMixinProps(props) {
    const ret = {};
    if ((props.eventBusName !== undefined))
        ret.eventBusName = cdk.getRefProperty(props.eventBusName?.eventBusRef, 'eventBusArn') ?? cdk.getRefProperty(props.eventBusName?.eventBusRef, 'eventBusName') ?? cdk.ensureStringOrUndefined(props.eventBusName, "eventBusName", "events.IEventBusRef | string");
    if ((props.roleArn !== undefined))
        ret.roleArn = cdk.getRefProperty(props.roleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.roleArn, "roleArn", "iam.IRoleRef | string");
    if ((props.targets !== undefined))
        ret.targets = (cdk.isResolvableObject(props.targets) ? props.targets : cdk.mapArrayInPlace(props.targets, (item) => flattenCfnRulePropsMixinTargetProperty(item)));
    return ret;
}
