"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.CfnEnvironmentPropsMixin = exports.CfnConfigurationTemplatePropsMixin = exports.CfnApplicationVersionPropsMixin = exports.CfnApplicationPropsMixin = 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-elasticbeanstalk"));
/**
 * Specify an AWS Elastic Beanstalk application by using the AWS::ElasticBeanstalk::Application resource in an AWS CloudFormation template.
 *
 * The AWS::ElasticBeanstalk::Application resource is an AWS Elastic Beanstalk Beanstalk resource type that specifies an Elastic Beanstalk application.
 *
 * @cloudformationResource AWS::ElasticBeanstalk::Application
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-application.html
 */
class CfnApplicationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticbeanstalk.CfnApplicationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["applicationName", "description", "resourceLifecycleConfig"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticBeanstalk::Application`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticbeanstalk_CfnApplicationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnApplicationPropsMixin);
            }
            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.CfnApplication.isCfnApplication(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnApplicationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnApplicationPropsMixin = CfnApplicationPropsMixin;
/**
 * Specify an AWS Elastic Beanstalk application version by using the AWS::ElasticBeanstalk::ApplicationVersion resource in an AWS CloudFormation template.
 *
 * The AWS::ElasticBeanstalk::ApplicationVersion resource is an AWS Elastic Beanstalk resource type that specifies an application version, an iteration of deployable code, for an Elastic Beanstalk application.
 *
 * > After you create an application version with a specified Amazon S3 bucket and key location, you can't change that Amazon S3 location. If you change the Amazon S3 location, an attempt to launch an environment from the application version will fail.
 *
 * @cloudformationResource AWS::ElasticBeanstalk::ApplicationVersion
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-applicationversion.html
 */
class CfnApplicationVersionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticbeanstalk.CfnApplicationVersionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["applicationName", "description", "sourceBundle"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticBeanstalk::ApplicationVersion`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticbeanstalk_CfnApplicationVersionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnApplicationVersionPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnApplicationVersionMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnApplicationVersion.isCfnApplicationVersion(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnApplicationVersionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnApplicationVersionPropsMixin = CfnApplicationVersionPropsMixin;
// @ts-ignore TS6133
function flattenCfnApplicationVersionMixinProps(props) {
    const ret = {};
    if ((props.applicationName !== undefined))
        ret.applicationName = cdk.getRefProperty(props.applicationName?.applicationRef, 'applicationName') ?? cdk.ensureStringOrUndefined(props.applicationName, "applicationName", "elasticbeanstalk.IApplicationRef | string");
    return ret;
}
/**
 * Specify an AWS Elastic Beanstalk configuration template by using the AWS::ElasticBeanstalk::ConfigurationTemplate resource in an AWS CloudFormation template.
 *
 * The AWS::ElasticBeanstalk::ConfigurationTemplate resource is an AWS Elastic Beanstalk resource type that specifies an Elastic Beanstalk configuration template, associated with a specific Elastic Beanstalk application. You define application configuration settings in a configuration template. You can then use the configuration template to deploy different versions of the application with the same configuration settings.
 *
 * > The Elastic Beanstalk console and documentation often refer to configuration templates as *saved configurations* . When you set configuration options in a saved configuration (configuration template), Elastic Beanstalk applies them with a particular precedence as part of applying options from multiple sources. For more information, see [Configuration Options](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html) in the *AWS Elastic Beanstalk Developer Guide* .
 *
 * @cloudformationResource AWS::ElasticBeanstalk::ConfigurationTemplate
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html
 */
class CfnConfigurationTemplatePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticbeanstalk.CfnConfigurationTemplatePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["applicationName", "description", "environmentId", "optionSettings", "platformArn", "solutionStackName", "sourceConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticBeanstalk::ConfigurationTemplate`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticbeanstalk_CfnConfigurationTemplateMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnConfigurationTemplatePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnConfigurationTemplateMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnConfigurationTemplate.isCfnConfigurationTemplate(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnConfigurationTemplatePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnConfigurationTemplatePropsMixin = CfnConfigurationTemplatePropsMixin;
// @ts-ignore TS6133
function flattenCfnConfigurationTemplatePropsMixinConfigurationOptionSettingProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        namespace: (!props.namespace ? undefined : props.namespace),
        optionName: (!props.optionName ? undefined : props.optionName),
        resourceName: (!props.resourceName ? undefined : props.resourceName),
        value: (!props.value ? undefined : cdk.getRefProperty(props.value?.instanceProfileRef, 'instanceProfileName') ?? cdk.getRefProperty(props.value?.securityGroupRef, 'securityGroupId') ?? cdk.ensureStringOrUndefined(props.value, "value", "iam.IInstanceProfileRef | ec2.ISecurityGroupRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnConfigurationTemplateMixinProps(props) {
    const ret = {};
    if ((props.applicationName !== undefined))
        ret.applicationName = cdk.getRefProperty(props.applicationName?.applicationRef, 'applicationName') ?? cdk.ensureStringOrUndefined(props.applicationName, "applicationName", "elasticbeanstalk.IApplicationRef | string");
    if ((props.optionSettings !== undefined))
        ret.optionSettings = (cdk.isResolvableObject(props.optionSettings) ? props.optionSettings : cdk.mapArrayInPlace(props.optionSettings, (item) => flattenCfnConfigurationTemplatePropsMixinConfigurationOptionSettingProperty(item)));
    return ret;
}
/**
 * Specify an AWS Elastic Beanstalk environment by using the AWS::ElasticBeanstalk::Environment resource in an AWS CloudFormation template.
 *
 * The AWS::ElasticBeanstalk::Environment resource is an AWS Elastic Beanstalk resource type that specifies an Elastic Beanstalk environment.
 *
 * @cloudformationResource AWS::ElasticBeanstalk::Environment
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-environment.html
 */
class CfnEnvironmentPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_elasticbeanstalk.CfnEnvironmentPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["applicationName", "cnamePrefix", "description", "environmentName", "operationsRole", "optionSettings", "platformArn", "solutionStackName", "tags", "templateName", "tier", "versionLabel"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ElasticBeanstalk::Environment`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_elasticbeanstalk_CfnEnvironmentMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnEnvironmentPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnEnvironmentMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnEnvironment.isCfnEnvironment(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnEnvironmentPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnEnvironmentPropsMixin = CfnEnvironmentPropsMixin;
// @ts-ignore TS6133
function flattenCfnEnvironmentMixinProps(props) {
    const ret = {};
    if ((props.applicationName !== undefined))
        ret.applicationName = cdk.getRefProperty(props.applicationName?.applicationRef, 'applicationName') ?? cdk.ensureStringOrUndefined(props.applicationName, "applicationName", "elasticbeanstalk.IApplicationRef | string");
    if ((props.templateName !== undefined))
        ret.templateName = cdk.getRefProperty(props.templateName?.configurationTemplateRef, 'templateName') ?? cdk.ensureStringOrUndefined(props.templateName, "templateName", "elasticbeanstalk.IConfigurationTemplateRef | string");
    return ret;
}
