"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.CfnStorageLensGroupPropsMixin = exports.CfnAccessGrantsLocationPropsMixin = exports.CfnAccessGrantsInstancePropsMixin = exports.CfnAccessGrantPropsMixin = exports.CfnStorageLensPropsMixin = exports.CfnMultiRegionAccessPointPolicyPropsMixin = exports.CfnMultiRegionAccessPointPropsMixin = exports.CfnBucketPolicyPropsMixin = exports.CfnBucketPropsMixin = exports.CfnAccessPointPropsMixin = 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-s3"));
/**
 * The AWS::S3::AccessPoint resource is an Amazon S3 resource type that you can use to access buckets.
 *
 * @cloudformationResource AWS::S3::AccessPoint
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html
 */
class CfnAccessPointPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnAccessPointPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["bucket", "bucketAccountId", "name", "policy", "publicAccessBlockConfiguration", "tags", "vpcConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::AccessPoint`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnAccessPointMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAccessPointPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnAccessPointMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnAccessPoint.isCfnAccessPoint(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAccessPointPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAccessPointPropsMixin = CfnAccessPointPropsMixin;
// @ts-ignore TS6133
function flattenCfnAccessPointPropsMixinVpcConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        vpcId: (!props.vpcId ? undefined : cdk.getRefProperty(props.vpcId?.vpcRef, 'vpcId') ?? cdk.ensureStringOrUndefined(props.vpcId, "vpcId", "ec2.IVPCRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnAccessPointMixinProps(props) {
    const ret = {};
    if ((props.bucket !== undefined))
        ret.bucket = cdk.getRefProperty(props.bucket?.bucketRef, 'bucketName') ?? cdk.ensureStringOrUndefined(props.bucket, "bucket", "s3.IBucketRef | string");
    if ((props.vpcConfiguration !== undefined))
        ret.vpcConfiguration = flattenCfnAccessPointPropsMixinVpcConfigurationProperty(props.vpcConfiguration);
    return ret;
}
/**
 * The `AWS::S3::Bucket` resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.
 *
 * To control how AWS CloudFormation handles the bucket when the stack is deleted, you can set a deletion policy for your bucket. You can choose to *retain* the bucket or to *delete* the bucket. For more information, see [DeletionPolicy Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) .
 *
 * > You can only delete empty buckets. Deletion fails for buckets that have contents.
 *
 * @cloudformationResource AWS::S3::Bucket
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html
 */
class CfnBucketPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnBucketPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["abacStatus", "accelerateConfiguration", "accessControl", "analyticsConfigurations", "bucketEncryption", "bucketName", "bucketNamePrefix", "bucketNamespace", "corsConfiguration", "intelligentTieringConfigurations", "inventoryConfigurations", "lifecycleConfiguration", "loggingConfiguration", "metadataConfiguration", "metadataTableConfiguration", "metricsConfigurations", "notificationConfiguration", "objectLockConfiguration", "objectLockEnabled", "ownershipControls", "publicAccessBlockConfiguration", "replicationConfiguration", "tags", "versioningConfiguration", "websiteConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::Bucket`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnBucketMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnBucketPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnBucketMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnBucket.isCfnBucket(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnBucketPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnBucketPropsMixin = CfnBucketPropsMixin;
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        bucketAccountId: (!props.bucketAccountId ? undefined : props.bucketAccountId),
        bucketArn: (!props.bucketArn ? undefined : cdk.getRefProperty(props.bucketArn?.bucketRef, 'bucketArn') ?? cdk.ensureStringOrUndefined(props.bucketArn, "bucketArn", "s3.IBucketRef | string")),
        format: (!props.format ? undefined : props.format),
        prefix: (!props.prefix ? undefined : props.prefix)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinDataExportProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        destination: (!props.destination ? undefined : flattenCfnBucketPropsMixinDestinationProperty(props.destination)),
        outputSchemaVersion: (!props.outputSchemaVersion ? undefined : props.outputSchemaVersion)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinStorageClassAnalysisProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        dataExport: (!props.dataExport ? undefined : (!props.dataExport ? undefined : flattenCfnBucketPropsMixinDataExportProperty(props.dataExport)))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinAnalyticsConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        id: (!props.id ? undefined : props.id),
        prefix: (!props.prefix ? undefined : props.prefix),
        storageClassAnalysis: (!props.storageClassAnalysis ? undefined : flattenCfnBucketPropsMixinStorageClassAnalysisProperty(props.storageClassAnalysis)),
        tagFilters: (!props.tagFilters ? undefined : props.tagFilters)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinServerSideEncryptionByDefaultProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        kmsMasterKeyId: (!props.kmsMasterKeyId ? undefined : cdk.getRefProperty(props.kmsMasterKeyId?.keyRef, 'keyArn') ?? cdk.getRefProperty(props.kmsMasterKeyId?.keyRef, 'keyId') ?? cdk.getRefProperty(props.kmsMasterKeyId?.aliasRef, 'aliasName') ?? cdk.ensureStringOrUndefined(props.kmsMasterKeyId, "kmsMasterKeyId", "kms.IKeyRef | kms.IAliasRef | string")),
        sseAlgorithm: (!props.sseAlgorithm ? undefined : props.sseAlgorithm)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinServerSideEncryptionRuleProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        blockedEncryptionTypes: (!props.blockedEncryptionTypes ? undefined : props.blockedEncryptionTypes),
        bucketKeyEnabled: (!props.bucketKeyEnabled ? undefined : props.bucketKeyEnabled),
        serverSideEncryptionByDefault: (!props.serverSideEncryptionByDefault ? undefined : (!props.serverSideEncryptionByDefault ? undefined : flattenCfnBucketPropsMixinServerSideEncryptionByDefaultProperty(props.serverSideEncryptionByDefault)))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinBucketEncryptionProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        serverSideEncryptionConfiguration: (!props.serverSideEncryptionConfiguration ? undefined : (cdk.isResolvableObject(props.serverSideEncryptionConfiguration) ? props.serverSideEncryptionConfiguration : cdk.mapArrayInPlace(props.serverSideEncryptionConfiguration, (item) => flattenCfnBucketPropsMixinServerSideEncryptionRuleProperty(item))))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinInventoryConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        destination: (!props.destination ? undefined : flattenCfnBucketPropsMixinDestinationProperty(props.destination)),
        enabled: (!props.enabled ? undefined : props.enabled),
        id: (!props.id ? undefined : props.id),
        includedObjectVersions: (!props.includedObjectVersions ? undefined : props.includedObjectVersions),
        optionalFields: (!props.optionalFields ? undefined : props.optionalFields),
        prefix: (!props.prefix ? undefined : props.prefix),
        scheduleFrequency: (!props.scheduleFrequency ? undefined : props.scheduleFrequency)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinLoggingConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        destinationBucketName: (!props.destinationBucketName ? undefined : cdk.getRefProperty(props.destinationBucketName?.bucketRef, 'bucketName') ?? cdk.ensureStringOrUndefined(props.destinationBucketName, "destinationBucketName", "s3.IBucketRef | string")),
        logFilePrefix: (!props.logFilePrefix ? undefined : props.logFilePrefix),
        targetObjectKeyFormat: (!props.targetObjectKeyFormat ? undefined : props.targetObjectKeyFormat)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinLambdaConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        event: (!props.event ? undefined : props.event),
        filter: (!props.filter ? undefined : props.filter),
        function: (!props.function ? undefined : cdk.getRefProperty(props.function?.functionRef, 'functionArn') ?? cdk.ensureStringOrUndefined(props.function, "function", "lambda.IFunctionRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinQueueConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        event: (!props.event ? undefined : props.event),
        filter: (!props.filter ? undefined : props.filter),
        queue: (!props.queue ? undefined : cdk.getRefProperty(props.queue?.queueRef, 'queueArn') ?? cdk.ensureStringOrUndefined(props.queue, "queue", "sqs.IQueueRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinTopicConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        event: (!props.event ? undefined : props.event),
        filter: (!props.filter ? undefined : props.filter),
        topic: (!props.topic ? undefined : cdk.getRefProperty(props.topic?.topicRef, 'topicArn') ?? cdk.ensureStringOrUndefined(props.topic, "topic", "sns.ITopicRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinNotificationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        eventBridgeConfiguration: (!props.eventBridgeConfiguration ? undefined : props.eventBridgeConfiguration),
        lambdaConfigurations: (!props.lambdaConfigurations ? undefined : (cdk.isResolvableObject(props.lambdaConfigurations) ? props.lambdaConfigurations : (!props.lambdaConfigurations ? undefined : cdk.mapArrayInPlace(props.lambdaConfigurations, (item) => flattenCfnBucketPropsMixinLambdaConfigurationProperty(item))))),
        queueConfigurations: (!props.queueConfigurations ? undefined : (cdk.isResolvableObject(props.queueConfigurations) ? props.queueConfigurations : (!props.queueConfigurations ? undefined : cdk.mapArrayInPlace(props.queueConfigurations, (item) => flattenCfnBucketPropsMixinQueueConfigurationProperty(item))))),
        topicConfigurations: (!props.topicConfigurations ? undefined : (cdk.isResolvableObject(props.topicConfigurations) ? props.topicConfigurations : (!props.topicConfigurations ? undefined : cdk.mapArrayInPlace(props.topicConfigurations, (item) => flattenCfnBucketPropsMixinTopicConfigurationProperty(item)))))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinEncryptionConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        replicaKmsKeyId: (!props.replicaKmsKeyId ? undefined : cdk.getRefProperty(props.replicaKmsKeyId?.keyRef, 'keyArn') ?? cdk.ensureStringOrUndefined(props.replicaKmsKeyId, "replicaKmsKeyId", "kms.IKeyRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinReplicationDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        accessControlTranslation: (!props.accessControlTranslation ? undefined : props.accessControlTranslation),
        account: (!props.account ? undefined : props.account),
        bucket: (!props.bucket ? undefined : cdk.getRefProperty(props.bucket?.bucketRef, 'bucketArn') ?? cdk.ensureStringOrUndefined(props.bucket, "bucket", "s3.IBucketRef | string")),
        encryptionConfiguration: (!props.encryptionConfiguration ? undefined : (!props.encryptionConfiguration ? undefined : flattenCfnBucketPropsMixinEncryptionConfigurationProperty(props.encryptionConfiguration))),
        metrics: (!props.metrics ? undefined : props.metrics),
        replicationTime: (!props.replicationTime ? undefined : props.replicationTime),
        storageClass: (!props.storageClass ? undefined : props.storageClass)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinReplicationRuleProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        deleteMarkerReplication: (!props.deleteMarkerReplication ? undefined : props.deleteMarkerReplication),
        destination: (!props.destination ? undefined : flattenCfnBucketPropsMixinReplicationDestinationProperty(props.destination)),
        filter: (!props.filter ? undefined : props.filter),
        id: (!props.id ? undefined : props.id),
        prefix: (!props.prefix ? undefined : props.prefix),
        priority: (!props.priority ? undefined : props.priority),
        sourceSelectionCriteria: (!props.sourceSelectionCriteria ? undefined : props.sourceSelectionCriteria),
        status: (!props.status ? undefined : props.status)
    };
}
// @ts-ignore TS6133
function flattenCfnBucketPropsMixinReplicationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        role: (!props.role ? undefined : cdk.getRefProperty(props.role?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.role, "role", "iam.IRoleRef | string")),
        rules: (!props.rules ? undefined : (cdk.isResolvableObject(props.rules) ? props.rules : cdk.mapArrayInPlace(props.rules, (item) => flattenCfnBucketPropsMixinReplicationRuleProperty(item))))
    };
}
// @ts-ignore TS6133
function flattenCfnBucketMixinProps(props) {
    const ret = {};
    if ((props.analyticsConfigurations !== undefined))
        ret.analyticsConfigurations = (cdk.isResolvableObject(props.analyticsConfigurations) ? props.analyticsConfigurations : cdk.mapArrayInPlace(props.analyticsConfigurations, (item) => flattenCfnBucketPropsMixinAnalyticsConfigurationProperty(item)));
    if ((props.bucketEncryption !== undefined))
        ret.bucketEncryption = flattenCfnBucketPropsMixinBucketEncryptionProperty(props.bucketEncryption);
    if ((props.inventoryConfigurations !== undefined))
        ret.inventoryConfigurations = (cdk.isResolvableObject(props.inventoryConfigurations) ? props.inventoryConfigurations : cdk.mapArrayInPlace(props.inventoryConfigurations, (item) => flattenCfnBucketPropsMixinInventoryConfigurationProperty(item)));
    if ((props.loggingConfiguration !== undefined))
        ret.loggingConfiguration = flattenCfnBucketPropsMixinLoggingConfigurationProperty(props.loggingConfiguration);
    if ((props.notificationConfiguration !== undefined))
        ret.notificationConfiguration = flattenCfnBucketPropsMixinNotificationConfigurationProperty(props.notificationConfiguration);
    if ((props.replicationConfiguration !== undefined))
        ret.replicationConfiguration = flattenCfnBucketPropsMixinReplicationConfigurationProperty(props.replicationConfiguration);
    return ret;
}
/**
 * Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
 *
 * If you are using an identity other than the root user of the AWS account that owns the bucket, the calling identity must have the `PutBucketPolicy` permissions on the specified bucket and belong to the bucket owner's account in order to use this operation.
 *
 * If you don't have `PutBucketPolicy` permissions, Amazon S3 returns a `403 Access Denied` error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a `405 Method Not Allowed` error.
 *
 * > As a security precaution, the root user of the AWS account that owns a bucket can always use this operation, even if the policy explicitly denies the root user the ability to perform this action.
 *
 * When using the `AWS::S3::BucketPolicy` resource, you can create, update, and delete bucket policies for S3 buckets located in Regions that are different from the stack's Region. However, the CloudFormation stacks should be deployed in the US East (N. Virginia) or `us-east-1` Region. This cross-region bucket policy modification functionality is supported for backward compatibility with existing workflows.
 *
 * > If the [DeletionPolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) is not specified or set to `Delete` , the bucket policy will be removed when the stack is deleted. If set to `Retain` , the bucket policy will be preserved even after the stack is deleted.
 *
 * For example, a CloudFormation stack in `us-east-1` can use the `AWS::S3::BucketPolicy` resource to manage the bucket policy for an S3 bucket in `us-west-2` . The retention or removal of the bucket policy during the stack deletion is determined by the `DeletionPolicy` attribute specified in the stack template.
 *
 * For more information, see [Bucket policy examples](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html) .
 *
 * The following operations are related to `PutBucketPolicy` :
 *
 * - [CreateBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html)
 * - [DeleteBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html)
 *
 * @cloudformationResource AWS::S3::BucketPolicy
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucketpolicy.html
 */
class CfnBucketPolicyPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnBucketPolicyPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["bucket", "policyDocument"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::BucketPolicy`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnBucketPolicyMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnBucketPolicyPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnBucketPolicyMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnBucketPolicy.isCfnBucketPolicy(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnBucketPolicyPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnBucketPolicyPropsMixin = CfnBucketPolicyPropsMixin;
// @ts-ignore TS6133
function flattenCfnBucketPolicyMixinProps(props) {
    const ret = {};
    if ((props.bucket !== undefined))
        ret.bucket = cdk.getRefProperty(props.bucket?.bucketRef, 'bucketName') ?? cdk.ensureStringOrUndefined(props.bucket, "bucket", "s3.IBucketRef | string");
    return ret;
}
/**
 * The `AWS::S3::MultiRegionAccessPoint` resource creates an Amazon S3 Multi-Region Access Point.
 *
 * To learn more about Multi-Region Access Points, see [Multi-Region Access Points in Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/MultiRegionAccessPoints.html) in the in the *Amazon S3 User Guide* .
 *
 * @cloudformationResource AWS::S3::MultiRegionAccessPoint
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-multiregionaccesspoint.html
 */
class CfnMultiRegionAccessPointPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnMultiRegionAccessPointPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["name", "publicAccessBlockConfiguration", "regions"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::MultiRegionAccessPoint`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnMultiRegionAccessPointMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnMultiRegionAccessPointPropsMixin);
            }
            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.CfnMultiRegionAccessPoint.isCfnMultiRegionAccessPoint(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnMultiRegionAccessPointPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnMultiRegionAccessPointPropsMixin = CfnMultiRegionAccessPointPropsMixin;
/**
 * Applies an Amazon S3 access policy to an Amazon S3 Multi-Region Access Point.
 *
 * It is not possible to delete an access policy for a Multi-Region Access Point from the CloudFormation template. When you attempt to delete the policy, CloudFormation updates the policy using `DeletionPolicy:Retain` and `UpdateReplacePolicy:Retain` . CloudFormation updates the policy to only allow access to the account that created the bucket.
 *
 * @cloudformationResource AWS::S3::MultiRegionAccessPointPolicy
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-multiregionaccesspointpolicy.html
 */
class CfnMultiRegionAccessPointPolicyPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnMultiRegionAccessPointPolicyPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["mrapName", "policy"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::MultiRegionAccessPointPolicy`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnMultiRegionAccessPointPolicyMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnMultiRegionAccessPointPolicyPropsMixin);
            }
            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.CfnMultiRegionAccessPointPolicy.isCfnMultiRegionAccessPointPolicy(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnMultiRegionAccessPointPolicyPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnMultiRegionAccessPointPolicyPropsMixin = CfnMultiRegionAccessPointPolicyPropsMixin;
/**
 * The AWS::S3::StorageLens resource creates an Amazon S3 Storage Lens configuration.
 *
 * @cloudformationResource AWS::S3::StorageLens
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html
 */
class CfnStorageLensPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnStorageLensPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["storageLensConfiguration", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::StorageLens`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnStorageLensMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnStorageLensPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnStorageLensMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnStorageLens.isCfnStorageLens(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnStorageLensPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnStorageLensPropsMixin = CfnStorageLensPropsMixin;
// @ts-ignore TS6133
function flattenCfnStorageLensPropsMixinS3BucketDestinationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        accountId: (!props.accountId ? undefined : props.accountId),
        arn: (!props.arn ? undefined : cdk.getRefProperty(props.arn?.bucketRef, 'bucketArn') ?? cdk.ensureStringOrUndefined(props.arn, "arn", "s3.IBucketRef | string")),
        encryption: (!props.encryption ? undefined : props.encryption),
        format: (!props.format ? undefined : props.format),
        outputSchemaVersion: (!props.outputSchemaVersion ? undefined : props.outputSchemaVersion),
        prefix: (!props.prefix ? undefined : props.prefix)
    };
}
// @ts-ignore TS6133
function flattenCfnStorageLensPropsMixinDataExportProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        cloudWatchMetrics: (!props.cloudWatchMetrics ? undefined : props.cloudWatchMetrics),
        s3BucketDestination: (!props.s3BucketDestination ? undefined : (!props.s3BucketDestination ? undefined : flattenCfnStorageLensPropsMixinS3BucketDestinationProperty(props.s3BucketDestination))),
        storageLensTableDestination: (!props.storageLensTableDestination ? undefined : props.storageLensTableDestination)
    };
}
// @ts-ignore TS6133
function flattenCfnStorageLensPropsMixinStorageLensExpandedPrefixesDataExportProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        s3BucketDestination: (!props.s3BucketDestination ? undefined : (!props.s3BucketDestination ? undefined : flattenCfnStorageLensPropsMixinS3BucketDestinationProperty(props.s3BucketDestination))),
        storageLensTableDestination: (!props.storageLensTableDestination ? undefined : props.storageLensTableDestination)
    };
}
// @ts-ignore TS6133
function flattenCfnStorageLensPropsMixinStorageLensConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        accountLevel: (!props.accountLevel ? undefined : props.accountLevel),
        awsOrg: (!props.awsOrg ? undefined : props.awsOrg),
        dataExport: (!props.dataExport ? undefined : (!props.dataExport ? undefined : flattenCfnStorageLensPropsMixinDataExportProperty(props.dataExport))),
        exclude: (!props.exclude ? undefined : props.exclude),
        expandedPrefixesDataExport: (!props.expandedPrefixesDataExport ? undefined : (!props.expandedPrefixesDataExport ? undefined : flattenCfnStorageLensPropsMixinStorageLensExpandedPrefixesDataExportProperty(props.expandedPrefixesDataExport))),
        id: (!props.id ? undefined : props.id),
        include: (!props.include ? undefined : props.include),
        isEnabled: (!props.isEnabled ? undefined : props.isEnabled),
        prefixDelimiter: (!props.prefixDelimiter ? undefined : props.prefixDelimiter),
        storageLensArn: (!props.storageLensArn ? undefined : props.storageLensArn)
    };
}
// @ts-ignore TS6133
function flattenCfnStorageLensMixinProps(props) {
    const ret = {};
    if ((props.storageLensConfiguration !== undefined))
        ret.storageLensConfiguration = flattenCfnStorageLensPropsMixinStorageLensConfigurationProperty(props.storageLensConfiguration);
    return ret;
}
/**
 * The `AWS::S3::AccessGrant` resource creates an access grant that gives a grantee access to your S3 data.
 *
 * The grantee can be an IAM user or role or a directory user, or group. Before you can create a grant, you must have an S3 Access Grants instance in the same Region as the S3 data. You can create an S3 Access Grants instance using the [AWS::S3::AccessGrantsInstance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accessgrantsinstance.html) . You must also have registered at least one S3 data location in your S3 Access Grants instance using [AWS::S3::AccessGrantsLocation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accessgrantslocation.html) .
 *
 * - **Permissions** - You must have the `s3:CreateAccessGrant` permission to use this resource.
 * - **Additional Permissions** - For any directory identity - `sso:DescribeInstance` and `sso:DescribeApplication`
 *
 * For directory users - `identitystore:DescribeUser`
 *
 * For directory groups - `identitystore:DescribeGroup`
 *
 * @cloudformationResource AWS::S3::AccessGrant
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accessgrant.html
 */
class CfnAccessGrantPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnAccessGrantPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["accessGrantsLocationConfiguration", "accessGrantsLocationId", "applicationArn", "grantee", "permission", "s3PrefixType", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::AccessGrant`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnAccessGrantMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAccessGrantPropsMixin);
            }
            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.CfnAccessGrant.isCfnAccessGrant(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAccessGrantPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAccessGrantPropsMixin = CfnAccessGrantPropsMixin;
/**
 * The `AWS::S3::AccessGrantInstance` resource creates an S3 Access Grants instance, which serves as a logical grouping for access grants.
 *
 * You can create one S3 Access Grants instance per Region per account.
 *
 * - **Permissions** - You must have the `s3:CreateAccessGrantsInstance` permission to use this resource.
 * - **Additional Permissions** - To associate an IAM Identity Center instance with your S3 Access Grants instance, you must also have the `sso:DescribeInstance` , `sso:CreateApplication` , `sso:PutApplicationGrant` , and `sso:PutApplicationAuthenticationMethod` permissions.
 *
 * @cloudformationResource AWS::S3::AccessGrantsInstance
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accessgrantsinstance.html
 */
class CfnAccessGrantsInstancePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnAccessGrantsInstancePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["identityCenterArn", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::AccessGrantsInstance`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnAccessGrantsInstanceMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAccessGrantsInstancePropsMixin);
            }
            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.CfnAccessGrantsInstance.isCfnAccessGrantsInstance(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAccessGrantsInstancePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAccessGrantsInstancePropsMixin = CfnAccessGrantsInstancePropsMixin;
/**
 * The `AWS::S3::AccessGrantsLocation` resource creates the S3 data location that you would like to register in your S3 Access Grants instance.
 *
 * Your S3 data must be in the same Region as your S3 Access Grants instance. The location can be one of the following:
 *
 * - The default S3 location `s3://`
 * - A bucket - `S3://<bucket-name>`
 * - A bucket and prefix - `S3://<bucket-name>/<prefix>`
 *
 * When you register a location, you must include the IAM role that has permission to manage the S3 location that you are registering. Give S3 Access Grants permission to assume this role [using a policy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-location.html) . S3 Access Grants assumes this role to manage access to the location and to vend temporary credentials to grantees or client applications.
 *
 * - **Permissions** - You must have the `s3:CreateAccessGrantsLocation` permission to use this resource.
 * - **Additional Permissions** - You must also have the following permission for the specified IAM role: `iam:PassRole`
 *
 * @cloudformationResource AWS::S3::AccessGrantsLocation
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accessgrantslocation.html
 */
class CfnAccessGrantsLocationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnAccessGrantsLocationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["iamRoleArn", "locationScope", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::AccessGrantsLocation`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnAccessGrantsLocationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAccessGrantsLocationPropsMixin);
            }
            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.CfnAccessGrantsLocation.isCfnAccessGrantsLocation(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAccessGrantsLocationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAccessGrantsLocationPropsMixin = CfnAccessGrantsLocationPropsMixin;
/**
 * The `AWS::S3::StorageLensGroup` resource creates an S3 Storage Lens group.
 *
 * A Storage Lens group is a custom grouping of objects that include filters for prefixes, suffixes, object tags, object size, or object age. You can create an S3 Storage Lens group that includes a single filter or multiple filter conditions. To specify multiple filter conditions, you use `AND` or `OR` logical operators. For more information about S3 Storage Lens groups, see [Working with S3 Storage Lens groups](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups-overview.html) .
 *
 * @cloudformationResource AWS::S3::StorageLensGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelensgroup.html
 */
class CfnStorageLensGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_s3.CfnStorageLensGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["filter", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::S3::StorageLensGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_s3_CfnStorageLensGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnStorageLensGroupPropsMixin);
            }
            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.CfnStorageLensGroup.isCfnStorageLensGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnStorageLensGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnStorageLensGroupPropsMixin = CfnStorageLensGroupPropsMixin;
