"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.CfnResourceGroupPropsMixin = exports.CfnAssessmentTemplatePropsMixin = exports.CfnAssessmentTargetPropsMixin = 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-inspector"));
/**
 * The `AWS::Inspector::AssessmentTarget` resource is used to create Amazon Inspector assessment targets, which specify the Amazon EC2 instances that will be analyzed during an assessment run.
 *
 * @cloudformationResource AWS::Inspector::AssessmentTarget
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttarget.html
 */
class CfnAssessmentTargetPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_inspector.CfnAssessmentTargetPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["assessmentTargetName", "resourceGroupArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Inspector::AssessmentTarget`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_inspector_CfnAssessmentTargetMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAssessmentTargetPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnAssessmentTargetMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnAssessmentTarget.isCfnAssessmentTarget(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAssessmentTargetPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAssessmentTargetPropsMixin = CfnAssessmentTargetPropsMixin;
// @ts-ignore TS6133
function flattenCfnAssessmentTargetMixinProps(props) {
    const ret = {};
    if ((props.resourceGroupArn !== undefined))
        ret.resourceGroupArn = cdk.getRefProperty(props.resourceGroupArn?.resourceGroupRef, 'resourceGroupArn') ?? cdk.ensureStringOrUndefined(props.resourceGroupArn, "resourceGroupArn", "inspector.IResourceGroupRef | string");
    return ret;
}
/**
 * The `AWS::Inspector::AssessmentTemplate` resource creates an Amazon Inspector assessment template, which specifies the Inspector assessment targets that will be evaluated by an assessment run and its related configurations.
 *
 * @cloudformationResource AWS::Inspector::AssessmentTemplate
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html
 */
class CfnAssessmentTemplatePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_inspector.CfnAssessmentTemplatePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["assessmentTargetArn", "assessmentTemplateName", "durationInSeconds", "rulesPackageArns", "userAttributesForFindings"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Inspector::AssessmentTemplate`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_inspector_CfnAssessmentTemplateMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAssessmentTemplatePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnAssessmentTemplateMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnAssessmentTemplate.isCfnAssessmentTemplate(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAssessmentTemplatePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAssessmentTemplatePropsMixin = CfnAssessmentTemplatePropsMixin;
// @ts-ignore TS6133
function flattenCfnAssessmentTemplateMixinProps(props) {
    const ret = {};
    if ((props.assessmentTargetArn !== undefined))
        ret.assessmentTargetArn = cdk.getRefProperty(props.assessmentTargetArn?.assessmentTargetRef, 'assessmentTargetArn') ?? cdk.ensureStringOrUndefined(props.assessmentTargetArn, "assessmentTargetArn", "inspector.IAssessmentTargetRef | string");
    return ret;
}
/**
 * The `AWS::Inspector::ResourceGroup` resource is used to create Amazon Inspector resource groups.
 *
 * A resource group defines a set of tags that, when queried, identify the AWS resources that make up the assessment target.
 *
 * @cloudformationResource AWS::Inspector::ResourceGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-resourcegroup.html
 */
class CfnResourceGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_inspector.CfnResourceGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["resourceGroupTags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::Inspector::ResourceGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_inspector_CfnResourceGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnResourceGroupPropsMixin);
            }
            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.CfnResourceGroup.isCfnResourceGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnResourceGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnResourceGroupPropsMixin = CfnResourceGroupPropsMixin;
