"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.CfnDomainPropsMixin = exports.CfnBranchPropsMixin = exports.CfnAppPropsMixin = 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-amplify"));
/**
 * The AWS::Amplify::App resource specifies Apps in Amplify Hosting.
 *
 * An App is a collection of branches.
 *
 * @cloudformationResource AWS::Amplify::App
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-app.html
 */
class CfnAppPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_amplify.CfnAppPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["accessToken", "autoBranchCreationConfig", "basicAuthConfig", "buildSpec", "cacheConfig", "computeRoleArn", "customHeaders", "customRules", "description", "enableBranchAutoDeletion", "environmentVariables", "iamServiceRole", "jobConfig", "name", "oauthToken", "platform", "repository", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Amplify::App`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_amplify_CfnAppMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAppPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnAppMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnApp.isCfnApp(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAppPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAppPropsMixin = CfnAppPropsMixin;
// @ts-ignore TS6133
function flattenCfnAppMixinProps(props) {
    const ret = {};
    if ((props.iamServiceRole !== undefined))
        ret.iamServiceRole = cdk.getRefProperty(props.iamServiceRole?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.iamServiceRole, "iamServiceRole", "iam.IRoleRef | string");
    return ret;
}
/**
 * The AWS::Amplify::Branch resource specifies a new branch within an app.
 *
 * @cloudformationResource AWS::Amplify::Branch
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html
 */
class CfnBranchPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_amplify.CfnBranchPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["appId", "backend", "basicAuthConfig", "branchName", "buildSpec", "computeRoleArn", "description", "enableAutoBuild", "enablePerformanceMode", "enablePullRequestPreview", "enableSkewProtection", "environmentVariables", "framework", "pullRequestEnvironmentName", "stage", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Amplify::Branch`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_amplify_CfnBranchMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnBranchPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnBranchMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnBranch.isCfnBranch(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnBranchPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnBranchPropsMixin = CfnBranchPropsMixin;
// @ts-ignore TS6133
function flattenCfnBranchMixinProps(props) {
    const ret = {};
    if ((props.appId !== undefined))
        ret.appId = props.appId;
    return ret;
}
/**
 * Specifies the AWS::Amplify::Domain resource that enables you to connect a custom domain to your app.
 *
 * @cloudformationResource AWS::Amplify::Domain
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-domain.html
 */
class CfnDomainPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_amplify.CfnDomainPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["appId", "autoSubDomainCreationPatterns", "autoSubDomainIamRole", "certificateSettings", "domainName", "enableAutoSubDomain", "subDomainSettings"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Amplify::Domain`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_amplify_CfnDomainMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnDomainPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnDomainMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnDomain.isCfnDomain(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnDomainPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnDomainPropsMixin = CfnDomainPropsMixin;
// @ts-ignore TS6133
function flattenCfnDomainMixinProps(props) {
    const ret = {};
    if ((props.appId !== undefined))
        ret.appId = props.appId;
    if ((props.autoSubDomainIamRole !== undefined))
        ret.autoSubDomainIamRole = cdk.getRefProperty(props.autoSubDomainIamRole?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.autoSubDomainIamRole, "autoSubDomainIamRole", "iam.IRoleRef | string");
    return ret;
}
