"use strict";
// Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Generated from the AWS CloudFormation Resource Specification
// See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// @cfn2ts:meta@ {"generated":"2018-08-15T13:37:42.980Z","fingerprint":"ySN3oNIXK+5Gtois78EE2RES0VR23jz8G1YqJl96UMk="}
Object.defineProperty(exports, "__esModule", { value: true });
// tslint:disable:max-line-length | This is generated code - line lengths are difficult to control
const cdk = require("@aws-cdk/cdk");
var cloudformation;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``BucketResourceProps``
     *
     * @param properties the TypeScript properties of a ``BucketResourceProps``
     *
     * @returns the result of the validation.
     */
    function BucketResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('accelerateConfiguration', BucketResource_AccelerateConfigurationPropertyValidator)(properties.accelerateConfiguration));
        errors.collect(cdk.propertyValidator('accessControl', cdk.validateString)(properties.accessControl));
        errors.collect(cdk.propertyValidator('analyticsConfigurations', cdk.listValidator(BucketResource_AnalyticsConfigurationPropertyValidator))(properties.analyticsConfigurations));
        errors.collect(cdk.propertyValidator('bucketEncryption', BucketResource_BucketEncryptionPropertyValidator)(properties.bucketEncryption));
        errors.collect(cdk.propertyValidator('bucketName', cdk.validateString)(properties.bucketName));
        errors.collect(cdk.propertyValidator('corsConfiguration', BucketResource_CorsConfigurationPropertyValidator)(properties.corsConfiguration));
        errors.collect(cdk.propertyValidator('inventoryConfigurations', cdk.listValidator(BucketResource_InventoryConfigurationPropertyValidator))(properties.inventoryConfigurations));
        errors.collect(cdk.propertyValidator('lifecycleConfiguration', BucketResource_LifecycleConfigurationPropertyValidator)(properties.lifecycleConfiguration));
        errors.collect(cdk.propertyValidator('loggingConfiguration', BucketResource_LoggingConfigurationPropertyValidator)(properties.loggingConfiguration));
        errors.collect(cdk.propertyValidator('metricsConfigurations', cdk.listValidator(BucketResource_MetricsConfigurationPropertyValidator))(properties.metricsConfigurations));
        errors.collect(cdk.propertyValidator('notificationConfiguration', BucketResource_NotificationConfigurationPropertyValidator)(properties.notificationConfiguration));
        errors.collect(cdk.propertyValidator('replicationConfiguration', BucketResource_ReplicationConfigurationPropertyValidator)(properties.replicationConfiguration));
        errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateTag))(properties.tags));
        errors.collect(cdk.propertyValidator('versioningConfiguration', BucketResource_VersioningConfigurationPropertyValidator)(properties.versioningConfiguration));
        errors.collect(cdk.propertyValidator('websiteConfiguration', BucketResource_WebsiteConfigurationPropertyValidator)(properties.websiteConfiguration));
        return errors.wrap('supplied properties not correct for "BucketResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket`` resource
     *
     * @param properties the TypeScript properties of a ``BucketResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket`` resource.
     */
    function bucketResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResourcePropsValidator(properties).assertSuccess();
        return {
            AccelerateConfiguration: bucketResourceAccelerateConfigurationPropertyToCloudFormation(properties.accelerateConfiguration),
            AccessControl: cdk.stringToCloudFormation(properties.accessControl),
            AnalyticsConfigurations: cdk.listMapper(bucketResourceAnalyticsConfigurationPropertyToCloudFormation)(properties.analyticsConfigurations),
            BucketEncryption: bucketResourceBucketEncryptionPropertyToCloudFormation(properties.bucketEncryption),
            BucketName: cdk.stringToCloudFormation(properties.bucketName),
            CorsConfiguration: bucketResourceCorsConfigurationPropertyToCloudFormation(properties.corsConfiguration),
            InventoryConfigurations: cdk.listMapper(bucketResourceInventoryConfigurationPropertyToCloudFormation)(properties.inventoryConfigurations),
            LifecycleConfiguration: bucketResourceLifecycleConfigurationPropertyToCloudFormation(properties.lifecycleConfiguration),
            LoggingConfiguration: bucketResourceLoggingConfigurationPropertyToCloudFormation(properties.loggingConfiguration),
            MetricsConfigurations: cdk.listMapper(bucketResourceMetricsConfigurationPropertyToCloudFormation)(properties.metricsConfigurations),
            NotificationConfiguration: bucketResourceNotificationConfigurationPropertyToCloudFormation(properties.notificationConfiguration),
            ReplicationConfiguration: bucketResourceReplicationConfigurationPropertyToCloudFormation(properties.replicationConfiguration),
            Tags: cdk.listMapper(cdk.tagToCloudFormation)(properties.tags),
            VersioningConfiguration: bucketResourceVersioningConfigurationPropertyToCloudFormation(properties.versioningConfiguration),
            WebsiteConfiguration: bucketResourceWebsiteConfigurationPropertyToCloudFormation(properties.websiteConfiguration),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html
     */
    class BucketResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::S3::Bucket``.
         *
         * @param parent     the ``cdk.Construct`` this ``BucketResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``BucketResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: BucketResource.resourceTypeName, properties });
            this.bucketArn = new BucketArn(this.getAtt('Arn'));
            this.bucketDomainName = new BucketDomainName(this.getAtt('DomainName'));
            this.bucketDualStackDomainName = new BucketDualStackDomainName(this.getAtt('DualStackDomainName'));
            this.bucketWebsiteUrl = new BucketWebsiteUrl(this.getAtt('WebsiteURL'));
        }
        renderProperties() {
            return bucketResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    BucketResource.resourceTypeName = "AWS::S3::Bucket";
    cloudformation.BucketResource = BucketResource;
    /**
     * Determine whether the given properties match those of a ``AbortIncompleteMultipartUploadProperty``
     *
     * @param properties the TypeScript properties of a ``AbortIncompleteMultipartUploadProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_AbortIncompleteMultipartUploadPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('daysAfterInitiation', cdk.requiredValidator)(properties.daysAfterInitiation));
        errors.collect(cdk.propertyValidator('daysAfterInitiation', cdk.validateNumber)(properties.daysAfterInitiation));
        return errors.wrap('supplied properties not correct for "AbortIncompleteMultipartUploadProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.AbortIncompleteMultipartUpload`` resource
     *
     * @param properties the TypeScript properties of a ``AbortIncompleteMultipartUploadProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.AbortIncompleteMultipartUpload`` resource.
     */
    function bucketResourceAbortIncompleteMultipartUploadPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_AbortIncompleteMultipartUploadPropertyValidator(properties).assertSuccess();
        return {
            DaysAfterInitiation: cdk.numberToCloudFormation(properties.daysAfterInitiation),
        };
    }
    /**
     * Determine whether the given properties match those of a ``AccelerateConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``AccelerateConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_AccelerateConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('accelerationStatus', cdk.requiredValidator)(properties.accelerationStatus));
        errors.collect(cdk.propertyValidator('accelerationStatus', cdk.validateString)(properties.accelerationStatus));
        return errors.wrap('supplied properties not correct for "AccelerateConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.AccelerateConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``AccelerateConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.AccelerateConfiguration`` resource.
     */
    function bucketResourceAccelerateConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_AccelerateConfigurationPropertyValidator(properties).assertSuccess();
        return {
            AccelerationStatus: cdk.stringToCloudFormation(properties.accelerationStatus),
        };
    }
    /**
     * Determine whether the given properties match those of a ``AccessControlTranslationProperty``
     *
     * @param properties the TypeScript properties of a ``AccessControlTranslationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_AccessControlTranslationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('owner', cdk.requiredValidator)(properties.owner));
        errors.collect(cdk.propertyValidator('owner', cdk.validateString)(properties.owner));
        return errors.wrap('supplied properties not correct for "AccessControlTranslationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.AccessControlTranslation`` resource
     *
     * @param properties the TypeScript properties of a ``AccessControlTranslationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.AccessControlTranslation`` resource.
     */
    function bucketResourceAccessControlTranslationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_AccessControlTranslationPropertyValidator(properties).assertSuccess();
        return {
            Owner: cdk.stringToCloudFormation(properties.owner),
        };
    }
    /**
     * Determine whether the given properties match those of a ``AnalyticsConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``AnalyticsConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_AnalyticsConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
        errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
        errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
        errors.collect(cdk.propertyValidator('storageClassAnalysis', cdk.requiredValidator)(properties.storageClassAnalysis));
        errors.collect(cdk.propertyValidator('storageClassAnalysis', BucketResource_StorageClassAnalysisPropertyValidator)(properties.storageClassAnalysis));
        errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(BucketResource_TagFilterPropertyValidator))(properties.tagFilters));
        return errors.wrap('supplied properties not correct for "AnalyticsConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.AnalyticsConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``AnalyticsConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.AnalyticsConfiguration`` resource.
     */
    function bucketResourceAnalyticsConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_AnalyticsConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Id: cdk.stringToCloudFormation(properties.id),
            Prefix: cdk.stringToCloudFormation(properties.prefix),
            StorageClassAnalysis: bucketResourceStorageClassAnalysisPropertyToCloudFormation(properties.storageClassAnalysis),
            TagFilters: cdk.listMapper(bucketResourceTagFilterPropertyToCloudFormation)(properties.tagFilters),
        };
    }
    /**
     * Determine whether the given properties match those of a ``BucketEncryptionProperty``
     *
     * @param properties the TypeScript properties of a ``BucketEncryptionProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_BucketEncryptionPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('serverSideEncryptionConfiguration', cdk.requiredValidator)(properties.serverSideEncryptionConfiguration));
        errors.collect(cdk.propertyValidator('serverSideEncryptionConfiguration', cdk.listValidator(BucketResource_ServerSideEncryptionRulePropertyValidator))(properties.serverSideEncryptionConfiguration));
        return errors.wrap('supplied properties not correct for "BucketEncryptionProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.BucketEncryption`` resource
     *
     * @param properties the TypeScript properties of a ``BucketEncryptionProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.BucketEncryption`` resource.
     */
    function bucketResourceBucketEncryptionPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_BucketEncryptionPropertyValidator(properties).assertSuccess();
        return {
            ServerSideEncryptionConfiguration: cdk.listMapper(bucketResourceServerSideEncryptionRulePropertyToCloudFormation)(properties.serverSideEncryptionConfiguration),
        };
    }
    /**
     * Determine whether the given properties match those of a ``CorsConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``CorsConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_CorsConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('corsRules', cdk.requiredValidator)(properties.corsRules));
        errors.collect(cdk.propertyValidator('corsRules', cdk.listValidator(BucketResource_CorsRulePropertyValidator))(properties.corsRules));
        return errors.wrap('supplied properties not correct for "CorsConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.CorsConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``CorsConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.CorsConfiguration`` resource.
     */
    function bucketResourceCorsConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_CorsConfigurationPropertyValidator(properties).assertSuccess();
        return {
            CorsRules: cdk.listMapper(bucketResourceCorsRulePropertyToCloudFormation)(properties.corsRules),
        };
    }
    /**
     * Determine whether the given properties match those of a ``CorsRuleProperty``
     *
     * @param properties the TypeScript properties of a ``CorsRuleProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_CorsRulePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('allowedHeaders', cdk.listValidator(cdk.validateString))(properties.allowedHeaders));
        errors.collect(cdk.propertyValidator('allowedMethods', cdk.requiredValidator)(properties.allowedMethods));
        errors.collect(cdk.propertyValidator('allowedMethods', cdk.listValidator(cdk.validateString))(properties.allowedMethods));
        errors.collect(cdk.propertyValidator('allowedOrigins', cdk.requiredValidator)(properties.allowedOrigins));
        errors.collect(cdk.propertyValidator('allowedOrigins', cdk.listValidator(cdk.validateString))(properties.allowedOrigins));
        errors.collect(cdk.propertyValidator('exposedHeaders', cdk.listValidator(cdk.validateString))(properties.exposedHeaders));
        errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
        errors.collect(cdk.propertyValidator('maxAge', cdk.validateNumber)(properties.maxAge));
        return errors.wrap('supplied properties not correct for "CorsRuleProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.CorsRule`` resource
     *
     * @param properties the TypeScript properties of a ``CorsRuleProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.CorsRule`` resource.
     */
    function bucketResourceCorsRulePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_CorsRulePropertyValidator(properties).assertSuccess();
        return {
            AllowedHeaders: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedHeaders),
            AllowedMethods: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedMethods),
            AllowedOrigins: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedOrigins),
            ExposedHeaders: cdk.listMapper(cdk.stringToCloudFormation)(properties.exposedHeaders),
            Id: cdk.stringToCloudFormation(properties.id),
            MaxAge: cdk.numberToCloudFormation(properties.maxAge),
        };
    }
    /**
     * Determine whether the given properties match those of a ``DataExportProperty``
     *
     * @param properties the TypeScript properties of a ``DataExportProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_DataExportPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
        errors.collect(cdk.propertyValidator('destination', BucketResource_DestinationPropertyValidator)(properties.destination));
        errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.requiredValidator)(properties.outputSchemaVersion));
        errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.validateString)(properties.outputSchemaVersion));
        return errors.wrap('supplied properties not correct for "DataExportProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.DataExport`` resource
     *
     * @param properties the TypeScript properties of a ``DataExportProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.DataExport`` resource.
     */
    function bucketResourceDataExportPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_DataExportPropertyValidator(properties).assertSuccess();
        return {
            Destination: bucketResourceDestinationPropertyToCloudFormation(properties.destination),
            OutputSchemaVersion: cdk.stringToCloudFormation(properties.outputSchemaVersion),
        };
    }
    /**
     * Determine whether the given properties match those of a ``DestinationProperty``
     *
     * @param properties the TypeScript properties of a ``DestinationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_DestinationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('bucketAccountId', cdk.validateString)(properties.bucketAccountId));
        errors.collect(cdk.propertyValidator('bucketArn', cdk.requiredValidator)(properties.bucketArn));
        errors.collect(cdk.propertyValidator('bucketArn', cdk.validateString)(properties.bucketArn));
        errors.collect(cdk.propertyValidator('format', cdk.requiredValidator)(properties.format));
        errors.collect(cdk.propertyValidator('format', cdk.validateString)(properties.format));
        errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
        return errors.wrap('supplied properties not correct for "DestinationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.Destination`` resource
     *
     * @param properties the TypeScript properties of a ``DestinationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.Destination`` resource.
     */
    function bucketResourceDestinationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_DestinationPropertyValidator(properties).assertSuccess();
        return {
            BucketAccountId: cdk.stringToCloudFormation(properties.bucketAccountId),
            BucketArn: cdk.stringToCloudFormation(properties.bucketArn),
            Format: cdk.stringToCloudFormation(properties.format),
            Prefix: cdk.stringToCloudFormation(properties.prefix),
        };
    }
    /**
     * Determine whether the given properties match those of a ``EncryptionConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``EncryptionConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_EncryptionConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('replicaKmsKeyId', cdk.requiredValidator)(properties.replicaKmsKeyId));
        errors.collect(cdk.propertyValidator('replicaKmsKeyId', cdk.validateString)(properties.replicaKmsKeyId));
        return errors.wrap('supplied properties not correct for "EncryptionConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.EncryptionConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``EncryptionConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.EncryptionConfiguration`` resource.
     */
    function bucketResourceEncryptionConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_EncryptionConfigurationPropertyValidator(properties).assertSuccess();
        return {
            ReplicaKmsKeyID: cdk.stringToCloudFormation(properties.replicaKmsKeyId),
        };
    }
    /**
     * Determine whether the given properties match those of a ``FilterRuleProperty``
     *
     * @param properties the TypeScript properties of a ``FilterRuleProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_FilterRulePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));
        errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));
        errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));
        errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));
        return errors.wrap('supplied properties not correct for "FilterRuleProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.FilterRule`` resource
     *
     * @param properties the TypeScript properties of a ``FilterRuleProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.FilterRule`` resource.
     */
    function bucketResourceFilterRulePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_FilterRulePropertyValidator(properties).assertSuccess();
        return {
            Name: cdk.stringToCloudFormation(properties.name),
            Value: cdk.stringToCloudFormation(properties.value),
        };
    }
    /**
     * Determine whether the given properties match those of a ``InventoryConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``InventoryConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_InventoryConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
        errors.collect(cdk.propertyValidator('destination', BucketResource_DestinationPropertyValidator)(properties.destination));
        errors.collect(cdk.propertyValidator('enabled', cdk.requiredValidator)(properties.enabled));
        errors.collect(cdk.propertyValidator('enabled', cdk.validateBoolean)(properties.enabled));
        errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
        errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
        errors.collect(cdk.propertyValidator('includedObjectVersions', cdk.requiredValidator)(properties.includedObjectVersions));
        errors.collect(cdk.propertyValidator('includedObjectVersions', cdk.validateString)(properties.includedObjectVersions));
        errors.collect(cdk.propertyValidator('optionalFields', cdk.listValidator(cdk.validateString))(properties.optionalFields));
        errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
        errors.collect(cdk.propertyValidator('scheduleFrequency', cdk.requiredValidator)(properties.scheduleFrequency));
        errors.collect(cdk.propertyValidator('scheduleFrequency', cdk.validateString)(properties.scheduleFrequency));
        return errors.wrap('supplied properties not correct for "InventoryConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.InventoryConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``InventoryConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.InventoryConfiguration`` resource.
     */
    function bucketResourceInventoryConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_InventoryConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Destination: bucketResourceDestinationPropertyToCloudFormation(properties.destination),
            Enabled: cdk.booleanToCloudFormation(properties.enabled),
            Id: cdk.stringToCloudFormation(properties.id),
            IncludedObjectVersions: cdk.stringToCloudFormation(properties.includedObjectVersions),
            OptionalFields: cdk.listMapper(cdk.stringToCloudFormation)(properties.optionalFields),
            Prefix: cdk.stringToCloudFormation(properties.prefix),
            ScheduleFrequency: cdk.stringToCloudFormation(properties.scheduleFrequency),
        };
    }
    /**
     * Determine whether the given properties match those of a ``LambdaConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``LambdaConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_LambdaConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
        errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
        errors.collect(cdk.propertyValidator('filter', BucketResource_NotificationFilterPropertyValidator)(properties.filter));
        errors.collect(cdk.propertyValidator('function', cdk.requiredValidator)(properties.function));
        errors.collect(cdk.propertyValidator('function', cdk.validateString)(properties.function));
        return errors.wrap('supplied properties not correct for "LambdaConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.LambdaConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``LambdaConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.LambdaConfiguration`` resource.
     */
    function bucketResourceLambdaConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_LambdaConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Event: cdk.stringToCloudFormation(properties.event),
            Filter: bucketResourceNotificationFilterPropertyToCloudFormation(properties.filter),
            Function: cdk.stringToCloudFormation(properties.function),
        };
    }
    /**
     * Determine whether the given properties match those of a ``LifecycleConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``LifecycleConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_LifecycleConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
        errors.collect(cdk.propertyValidator('rules', cdk.listValidator(BucketResource_RulePropertyValidator))(properties.rules));
        return errors.wrap('supplied properties not correct for "LifecycleConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.LifecycleConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``LifecycleConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.LifecycleConfiguration`` resource.
     */
    function bucketResourceLifecycleConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_LifecycleConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Rules: cdk.listMapper(bucketResourceRulePropertyToCloudFormation)(properties.rules),
        };
    }
    /**
     * Determine whether the given properties match those of a ``LoggingConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``LoggingConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_LoggingConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('destinationBucketName', cdk.validateString)(properties.destinationBucketName));
        errors.collect(cdk.propertyValidator('logFilePrefix', cdk.validateString)(properties.logFilePrefix));
        return errors.wrap('supplied properties not correct for "LoggingConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.LoggingConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``LoggingConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.LoggingConfiguration`` resource.
     */
    function bucketResourceLoggingConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_LoggingConfigurationPropertyValidator(properties).assertSuccess();
        return {
            DestinationBucketName: cdk.stringToCloudFormation(properties.destinationBucketName),
            LogFilePrefix: cdk.stringToCloudFormation(properties.logFilePrefix),
        };
    }
    /**
     * Determine whether the given properties match those of a ``MetricsConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``MetricsConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_MetricsConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
        errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
        errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
        errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(BucketResource_TagFilterPropertyValidator))(properties.tagFilters));
        return errors.wrap('supplied properties not correct for "MetricsConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.MetricsConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``MetricsConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.MetricsConfiguration`` resource.
     */
    function bucketResourceMetricsConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_MetricsConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Id: cdk.stringToCloudFormation(properties.id),
            Prefix: cdk.stringToCloudFormation(properties.prefix),
            TagFilters: cdk.listMapper(bucketResourceTagFilterPropertyToCloudFormation)(properties.tagFilters),
        };
    }
    /**
     * Determine whether the given properties match those of a ``NoncurrentVersionTransitionProperty``
     *
     * @param properties the TypeScript properties of a ``NoncurrentVersionTransitionProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_NoncurrentVersionTransitionPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('storageClass', cdk.requiredValidator)(properties.storageClass));
        errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
        errors.collect(cdk.propertyValidator('transitionInDays', cdk.requiredValidator)(properties.transitionInDays));
        errors.collect(cdk.propertyValidator('transitionInDays', cdk.validateNumber)(properties.transitionInDays));
        return errors.wrap('supplied properties not correct for "NoncurrentVersionTransitionProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.NoncurrentVersionTransition`` resource
     *
     * @param properties the TypeScript properties of a ``NoncurrentVersionTransitionProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.NoncurrentVersionTransition`` resource.
     */
    function bucketResourceNoncurrentVersionTransitionPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_NoncurrentVersionTransitionPropertyValidator(properties).assertSuccess();
        return {
            StorageClass: cdk.stringToCloudFormation(properties.storageClass),
            TransitionInDays: cdk.numberToCloudFormation(properties.transitionInDays),
        };
    }
    /**
     * Determine whether the given properties match those of a ``NotificationConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``NotificationConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_NotificationConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('lambdaConfigurations', cdk.listValidator(BucketResource_LambdaConfigurationPropertyValidator))(properties.lambdaConfigurations));
        errors.collect(cdk.propertyValidator('queueConfigurations', cdk.listValidator(BucketResource_QueueConfigurationPropertyValidator))(properties.queueConfigurations));
        errors.collect(cdk.propertyValidator('topicConfigurations', cdk.listValidator(BucketResource_TopicConfigurationPropertyValidator))(properties.topicConfigurations));
        return errors.wrap('supplied properties not correct for "NotificationConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.NotificationConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``NotificationConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.NotificationConfiguration`` resource.
     */
    function bucketResourceNotificationConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_NotificationConfigurationPropertyValidator(properties).assertSuccess();
        return {
            LambdaConfigurations: cdk.listMapper(bucketResourceLambdaConfigurationPropertyToCloudFormation)(properties.lambdaConfigurations),
            QueueConfigurations: cdk.listMapper(bucketResourceQueueConfigurationPropertyToCloudFormation)(properties.queueConfigurations),
            TopicConfigurations: cdk.listMapper(bucketResourceTopicConfigurationPropertyToCloudFormation)(properties.topicConfigurations),
        };
    }
    /**
     * Determine whether the given properties match those of a ``NotificationFilterProperty``
     *
     * @param properties the TypeScript properties of a ``NotificationFilterProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_NotificationFilterPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('s3Key', cdk.requiredValidator)(properties.s3Key));
        errors.collect(cdk.propertyValidator('s3Key', BucketResource_S3KeyFilterPropertyValidator)(properties.s3Key));
        return errors.wrap('supplied properties not correct for "NotificationFilterProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.NotificationFilter`` resource
     *
     * @param properties the TypeScript properties of a ``NotificationFilterProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.NotificationFilter`` resource.
     */
    function bucketResourceNotificationFilterPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_NotificationFilterPropertyValidator(properties).assertSuccess();
        return {
            S3Key: bucketResourceS3KeyFilterPropertyToCloudFormation(properties.s3Key),
        };
    }
    /**
     * Determine whether the given properties match those of a ``QueueConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``QueueConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_QueueConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
        errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
        errors.collect(cdk.propertyValidator('filter', BucketResource_NotificationFilterPropertyValidator)(properties.filter));
        errors.collect(cdk.propertyValidator('queue', cdk.requiredValidator)(properties.queue));
        errors.collect(cdk.propertyValidator('queue', cdk.validateString)(properties.queue));
        return errors.wrap('supplied properties not correct for "QueueConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.QueueConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``QueueConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.QueueConfiguration`` resource.
     */
    function bucketResourceQueueConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_QueueConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Event: cdk.stringToCloudFormation(properties.event),
            Filter: bucketResourceNotificationFilterPropertyToCloudFormation(properties.filter),
            Queue: cdk.stringToCloudFormation(properties.queue),
        };
    }
    /**
     * Determine whether the given properties match those of a ``RedirectAllRequestsToProperty``
     *
     * @param properties the TypeScript properties of a ``RedirectAllRequestsToProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_RedirectAllRequestsToPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('hostName', cdk.requiredValidator)(properties.hostName));
        errors.collect(cdk.propertyValidator('hostName', cdk.validateString)(properties.hostName));
        errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));
        return errors.wrap('supplied properties not correct for "RedirectAllRequestsToProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.RedirectAllRequestsTo`` resource
     *
     * @param properties the TypeScript properties of a ``RedirectAllRequestsToProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.RedirectAllRequestsTo`` resource.
     */
    function bucketResourceRedirectAllRequestsToPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_RedirectAllRequestsToPropertyValidator(properties).assertSuccess();
        return {
            HostName: cdk.stringToCloudFormation(properties.hostName),
            Protocol: cdk.stringToCloudFormation(properties.protocol),
        };
    }
    /**
     * Determine whether the given properties match those of a ``RedirectRuleProperty``
     *
     * @param properties the TypeScript properties of a ``RedirectRuleProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_RedirectRulePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('hostName', cdk.validateString)(properties.hostName));
        errors.collect(cdk.propertyValidator('httpRedirectCode', cdk.validateString)(properties.httpRedirectCode));
        errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));
        errors.collect(cdk.propertyValidator('replaceKeyPrefixWith', cdk.validateString)(properties.replaceKeyPrefixWith));
        errors.collect(cdk.propertyValidator('replaceKeyWith', cdk.validateString)(properties.replaceKeyWith));
        return errors.wrap('supplied properties not correct for "RedirectRuleProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.RedirectRule`` resource
     *
     * @param properties the TypeScript properties of a ``RedirectRuleProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.RedirectRule`` resource.
     */
    function bucketResourceRedirectRulePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_RedirectRulePropertyValidator(properties).assertSuccess();
        return {
            HostName: cdk.stringToCloudFormation(properties.hostName),
            HttpRedirectCode: cdk.stringToCloudFormation(properties.httpRedirectCode),
            Protocol: cdk.stringToCloudFormation(properties.protocol),
            ReplaceKeyPrefixWith: cdk.stringToCloudFormation(properties.replaceKeyPrefixWith),
            ReplaceKeyWith: cdk.stringToCloudFormation(properties.replaceKeyWith),
        };
    }
    /**
     * Determine whether the given properties match those of a ``ReplicationConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``ReplicationConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_ReplicationConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('role', cdk.requiredValidator)(properties.role));
        errors.collect(cdk.propertyValidator('role', cdk.validateString)(properties.role));
        errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
        errors.collect(cdk.propertyValidator('rules', cdk.listValidator(BucketResource_ReplicationRulePropertyValidator))(properties.rules));
        return errors.wrap('supplied properties not correct for "ReplicationConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.ReplicationConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``ReplicationConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.ReplicationConfiguration`` resource.
     */
    function bucketResourceReplicationConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_ReplicationConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Role: cdk.stringToCloudFormation(properties.role),
            Rules: cdk.listMapper(bucketResourceReplicationRulePropertyToCloudFormation)(properties.rules),
        };
    }
    /**
     * Determine whether the given properties match those of a ``ReplicationDestinationProperty``
     *
     * @param properties the TypeScript properties of a ``ReplicationDestinationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_ReplicationDestinationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('accessControlTranslation', BucketResource_AccessControlTranslationPropertyValidator)(properties.accessControlTranslation));
        errors.collect(cdk.propertyValidator('account', cdk.validateString)(properties.account));
        errors.collect(cdk.propertyValidator('bucket', cdk.requiredValidator)(properties.bucket));
        errors.collect(cdk.propertyValidator('bucket', cdk.validateString)(properties.bucket));
        errors.collect(cdk.propertyValidator('encryptionConfiguration', BucketResource_EncryptionConfigurationPropertyValidator)(properties.encryptionConfiguration));
        errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
        return errors.wrap('supplied properties not correct for "ReplicationDestinationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.ReplicationDestination`` resource
     *
     * @param properties the TypeScript properties of a ``ReplicationDestinationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.ReplicationDestination`` resource.
     */
    function bucketResourceReplicationDestinationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_ReplicationDestinationPropertyValidator(properties).assertSuccess();
        return {
            AccessControlTranslation: bucketResourceAccessControlTranslationPropertyToCloudFormation(properties.accessControlTranslation),
            Account: cdk.stringToCloudFormation(properties.account),
            Bucket: cdk.stringToCloudFormation(properties.bucket),
            EncryptionConfiguration: bucketResourceEncryptionConfigurationPropertyToCloudFormation(properties.encryptionConfiguration),
            StorageClass: cdk.stringToCloudFormation(properties.storageClass),
        };
    }
    /**
     * Determine whether the given properties match those of a ``ReplicationRuleProperty``
     *
     * @param properties the TypeScript properties of a ``ReplicationRuleProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_ReplicationRulePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
        errors.collect(cdk.propertyValidator('destination', BucketResource_ReplicationDestinationPropertyValidator)(properties.destination));
        errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
        errors.collect(cdk.propertyValidator('prefix', cdk.requiredValidator)(properties.prefix));
        errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
        errors.collect(cdk.propertyValidator('sourceSelectionCriteria', BucketResource_SourceSelectionCriteriaPropertyValidator)(properties.sourceSelectionCriteria));
        errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
        errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
        return errors.wrap('supplied properties not correct for "ReplicationRuleProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.ReplicationRule`` resource
     *
     * @param properties the TypeScript properties of a ``ReplicationRuleProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.ReplicationRule`` resource.
     */
    function bucketResourceReplicationRulePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_ReplicationRulePropertyValidator(properties).assertSuccess();
        return {
            Destination: bucketResourceReplicationDestinationPropertyToCloudFormation(properties.destination),
            Id: cdk.stringToCloudFormation(properties.id),
            Prefix: cdk.stringToCloudFormation(properties.prefix),
            SourceSelectionCriteria: bucketResourceSourceSelectionCriteriaPropertyToCloudFormation(properties.sourceSelectionCriteria),
            Status: cdk.stringToCloudFormation(properties.status),
        };
    }
    /**
     * Determine whether the given properties match those of a ``RoutingRuleProperty``
     *
     * @param properties the TypeScript properties of a ``RoutingRuleProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_RoutingRulePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('redirectRule', cdk.requiredValidator)(properties.redirectRule));
        errors.collect(cdk.propertyValidator('redirectRule', BucketResource_RedirectRulePropertyValidator)(properties.redirectRule));
        errors.collect(cdk.propertyValidator('routingRuleCondition', BucketResource_RoutingRuleConditionPropertyValidator)(properties.routingRuleCondition));
        return errors.wrap('supplied properties not correct for "RoutingRuleProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.RoutingRule`` resource
     *
     * @param properties the TypeScript properties of a ``RoutingRuleProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.RoutingRule`` resource.
     */
    function bucketResourceRoutingRulePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_RoutingRulePropertyValidator(properties).assertSuccess();
        return {
            RedirectRule: bucketResourceRedirectRulePropertyToCloudFormation(properties.redirectRule),
            RoutingRuleCondition: bucketResourceRoutingRuleConditionPropertyToCloudFormation(properties.routingRuleCondition),
        };
    }
    /**
     * Determine whether the given properties match those of a ``RoutingRuleConditionProperty``
     *
     * @param properties the TypeScript properties of a ``RoutingRuleConditionProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_RoutingRuleConditionPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('httpErrorCodeReturnedEquals', cdk.validateString)(properties.httpErrorCodeReturnedEquals));
        errors.collect(cdk.propertyValidator('keyPrefixEquals', cdk.validateString)(properties.keyPrefixEquals));
        return errors.wrap('supplied properties not correct for "RoutingRuleConditionProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.RoutingRuleCondition`` resource
     *
     * @param properties the TypeScript properties of a ``RoutingRuleConditionProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.RoutingRuleCondition`` resource.
     */
    function bucketResourceRoutingRuleConditionPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_RoutingRuleConditionPropertyValidator(properties).assertSuccess();
        return {
            HttpErrorCodeReturnedEquals: cdk.stringToCloudFormation(properties.httpErrorCodeReturnedEquals),
            KeyPrefixEquals: cdk.stringToCloudFormation(properties.keyPrefixEquals),
        };
    }
    /**
     * Determine whether the given properties match those of a ``RuleProperty``
     *
     * @param properties the TypeScript properties of a ``RuleProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_RulePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('abortIncompleteMultipartUpload', BucketResource_AbortIncompleteMultipartUploadPropertyValidator)(properties.abortIncompleteMultipartUpload));
        errors.collect(cdk.propertyValidator('expirationDate', cdk.validateDate)(properties.expirationDate));
        errors.collect(cdk.propertyValidator('expirationInDays', cdk.validateNumber)(properties.expirationInDays));
        errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
        errors.collect(cdk.propertyValidator('noncurrentVersionExpirationInDays', cdk.validateNumber)(properties.noncurrentVersionExpirationInDays));
        errors.collect(cdk.propertyValidator('noncurrentVersionTransition', BucketResource_NoncurrentVersionTransitionPropertyValidator)(properties.noncurrentVersionTransition));
        errors.collect(cdk.propertyValidator('noncurrentVersionTransitions', cdk.listValidator(BucketResource_NoncurrentVersionTransitionPropertyValidator))(properties.noncurrentVersionTransitions));
        errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
        errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
        errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
        errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(BucketResource_TagFilterPropertyValidator))(properties.tagFilters));
        errors.collect(cdk.propertyValidator('transition', BucketResource_TransitionPropertyValidator)(properties.transition));
        errors.collect(cdk.propertyValidator('transitions', cdk.listValidator(BucketResource_TransitionPropertyValidator))(properties.transitions));
        return errors.wrap('supplied properties not correct for "RuleProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.Rule`` resource
     *
     * @param properties the TypeScript properties of a ``RuleProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.Rule`` resource.
     */
    function bucketResourceRulePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_RulePropertyValidator(properties).assertSuccess();
        return {
            AbortIncompleteMultipartUpload: bucketResourceAbortIncompleteMultipartUploadPropertyToCloudFormation(properties.abortIncompleteMultipartUpload),
            ExpirationDate: cdk.dateToCloudFormation(properties.expirationDate),
            ExpirationInDays: cdk.numberToCloudFormation(properties.expirationInDays),
            Id: cdk.stringToCloudFormation(properties.id),
            NoncurrentVersionExpirationInDays: cdk.numberToCloudFormation(properties.noncurrentVersionExpirationInDays),
            NoncurrentVersionTransition: bucketResourceNoncurrentVersionTransitionPropertyToCloudFormation(properties.noncurrentVersionTransition),
            NoncurrentVersionTransitions: cdk.listMapper(bucketResourceNoncurrentVersionTransitionPropertyToCloudFormation)(properties.noncurrentVersionTransitions),
            Prefix: cdk.stringToCloudFormation(properties.prefix),
            Status: cdk.stringToCloudFormation(properties.status),
            TagFilters: cdk.listMapper(bucketResourceTagFilterPropertyToCloudFormation)(properties.tagFilters),
            Transition: bucketResourceTransitionPropertyToCloudFormation(properties.transition),
            Transitions: cdk.listMapper(bucketResourceTransitionPropertyToCloudFormation)(properties.transitions),
        };
    }
    /**
     * Determine whether the given properties match those of a ``S3KeyFilterProperty``
     *
     * @param properties the TypeScript properties of a ``S3KeyFilterProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_S3KeyFilterPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
        errors.collect(cdk.propertyValidator('rules', cdk.listValidator(BucketResource_FilterRulePropertyValidator))(properties.rules));
        return errors.wrap('supplied properties not correct for "S3KeyFilterProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.S3KeyFilter`` resource
     *
     * @param properties the TypeScript properties of a ``S3KeyFilterProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.S3KeyFilter`` resource.
     */
    function bucketResourceS3KeyFilterPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_S3KeyFilterPropertyValidator(properties).assertSuccess();
        return {
            Rules: cdk.listMapper(bucketResourceFilterRulePropertyToCloudFormation)(properties.rules),
        };
    }
    /**
     * Determine whether the given properties match those of a ``ServerSideEncryptionByDefaultProperty``
     *
     * @param properties the TypeScript properties of a ``ServerSideEncryptionByDefaultProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_ServerSideEncryptionByDefaultPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('kmsMasterKeyId', cdk.validateString)(properties.kmsMasterKeyId));
        errors.collect(cdk.propertyValidator('sseAlgorithm', cdk.requiredValidator)(properties.sseAlgorithm));
        errors.collect(cdk.propertyValidator('sseAlgorithm', cdk.validateString)(properties.sseAlgorithm));
        return errors.wrap('supplied properties not correct for "ServerSideEncryptionByDefaultProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.ServerSideEncryptionByDefault`` resource
     *
     * @param properties the TypeScript properties of a ``ServerSideEncryptionByDefaultProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.ServerSideEncryptionByDefault`` resource.
     */
    function bucketResourceServerSideEncryptionByDefaultPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_ServerSideEncryptionByDefaultPropertyValidator(properties).assertSuccess();
        return {
            KMSMasterKeyID: cdk.stringToCloudFormation(properties.kmsMasterKeyId),
            SSEAlgorithm: cdk.stringToCloudFormation(properties.sseAlgorithm),
        };
    }
    /**
     * Determine whether the given properties match those of a ``ServerSideEncryptionRuleProperty``
     *
     * @param properties the TypeScript properties of a ``ServerSideEncryptionRuleProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_ServerSideEncryptionRulePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('serverSideEncryptionByDefault', BucketResource_ServerSideEncryptionByDefaultPropertyValidator)(properties.serverSideEncryptionByDefault));
        return errors.wrap('supplied properties not correct for "ServerSideEncryptionRuleProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.ServerSideEncryptionRule`` resource
     *
     * @param properties the TypeScript properties of a ``ServerSideEncryptionRuleProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.ServerSideEncryptionRule`` resource.
     */
    function bucketResourceServerSideEncryptionRulePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_ServerSideEncryptionRulePropertyValidator(properties).assertSuccess();
        return {
            ServerSideEncryptionByDefault: bucketResourceServerSideEncryptionByDefaultPropertyToCloudFormation(properties.serverSideEncryptionByDefault),
        };
    }
    /**
     * Determine whether the given properties match those of a ``SourceSelectionCriteriaProperty``
     *
     * @param properties the TypeScript properties of a ``SourceSelectionCriteriaProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_SourceSelectionCriteriaPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('sseKmsEncryptedObjects', cdk.requiredValidator)(properties.sseKmsEncryptedObjects));
        errors.collect(cdk.propertyValidator('sseKmsEncryptedObjects', BucketResource_SseKmsEncryptedObjectsPropertyValidator)(properties.sseKmsEncryptedObjects));
        return errors.wrap('supplied properties not correct for "SourceSelectionCriteriaProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.SourceSelectionCriteria`` resource
     *
     * @param properties the TypeScript properties of a ``SourceSelectionCriteriaProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.SourceSelectionCriteria`` resource.
     */
    function bucketResourceSourceSelectionCriteriaPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_SourceSelectionCriteriaPropertyValidator(properties).assertSuccess();
        return {
            SseKmsEncryptedObjects: bucketResourceSseKmsEncryptedObjectsPropertyToCloudFormation(properties.sseKmsEncryptedObjects),
        };
    }
    /**
     * Determine whether the given properties match those of a ``SseKmsEncryptedObjectsProperty``
     *
     * @param properties the TypeScript properties of a ``SseKmsEncryptedObjectsProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_SseKmsEncryptedObjectsPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
        errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
        return errors.wrap('supplied properties not correct for "SseKmsEncryptedObjectsProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.SseKmsEncryptedObjects`` resource
     *
     * @param properties the TypeScript properties of a ``SseKmsEncryptedObjectsProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.SseKmsEncryptedObjects`` resource.
     */
    function bucketResourceSseKmsEncryptedObjectsPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_SseKmsEncryptedObjectsPropertyValidator(properties).assertSuccess();
        return {
            Status: cdk.stringToCloudFormation(properties.status),
        };
    }
    /**
     * Determine whether the given properties match those of a ``StorageClassAnalysisProperty``
     *
     * @param properties the TypeScript properties of a ``StorageClassAnalysisProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_StorageClassAnalysisPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('dataExport', BucketResource_DataExportPropertyValidator)(properties.dataExport));
        return errors.wrap('supplied properties not correct for "StorageClassAnalysisProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.StorageClassAnalysis`` resource
     *
     * @param properties the TypeScript properties of a ``StorageClassAnalysisProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.StorageClassAnalysis`` resource.
     */
    function bucketResourceStorageClassAnalysisPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_StorageClassAnalysisPropertyValidator(properties).assertSuccess();
        return {
            DataExport: bucketResourceDataExportPropertyToCloudFormation(properties.dataExport),
        };
    }
    /**
     * Determine whether the given properties match those of a ``TagFilterProperty``
     *
     * @param properties the TypeScript properties of a ``TagFilterProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_TagFilterPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key));
        errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key));
        errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));
        errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));
        return errors.wrap('supplied properties not correct for "TagFilterProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.TagFilter`` resource
     *
     * @param properties the TypeScript properties of a ``TagFilterProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.TagFilter`` resource.
     */
    function bucketResourceTagFilterPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_TagFilterPropertyValidator(properties).assertSuccess();
        return {
            Key: cdk.stringToCloudFormation(properties.key),
            Value: cdk.stringToCloudFormation(properties.value),
        };
    }
    /**
     * Determine whether the given properties match those of a ``TopicConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``TopicConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_TopicConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
        errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
        errors.collect(cdk.propertyValidator('filter', BucketResource_NotificationFilterPropertyValidator)(properties.filter));
        errors.collect(cdk.propertyValidator('topic', cdk.requiredValidator)(properties.topic));
        errors.collect(cdk.propertyValidator('topic', cdk.validateString)(properties.topic));
        return errors.wrap('supplied properties not correct for "TopicConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.TopicConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``TopicConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.TopicConfiguration`` resource.
     */
    function bucketResourceTopicConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_TopicConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Event: cdk.stringToCloudFormation(properties.event),
            Filter: bucketResourceNotificationFilterPropertyToCloudFormation(properties.filter),
            Topic: cdk.stringToCloudFormation(properties.topic),
        };
    }
    /**
     * Determine whether the given properties match those of a ``TransitionProperty``
     *
     * @param properties the TypeScript properties of a ``TransitionProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_TransitionPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('storageClass', cdk.requiredValidator)(properties.storageClass));
        errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
        errors.collect(cdk.propertyValidator('transitionDate', cdk.validateDate)(properties.transitionDate));
        errors.collect(cdk.propertyValidator('transitionInDays', cdk.validateNumber)(properties.transitionInDays));
        return errors.wrap('supplied properties not correct for "TransitionProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.Transition`` resource
     *
     * @param properties the TypeScript properties of a ``TransitionProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.Transition`` resource.
     */
    function bucketResourceTransitionPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_TransitionPropertyValidator(properties).assertSuccess();
        return {
            StorageClass: cdk.stringToCloudFormation(properties.storageClass),
            TransitionDate: cdk.dateToCloudFormation(properties.transitionDate),
            TransitionInDays: cdk.numberToCloudFormation(properties.transitionInDays),
        };
    }
    /**
     * Determine whether the given properties match those of a ``VersioningConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``VersioningConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_VersioningConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
        errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
        return errors.wrap('supplied properties not correct for "VersioningConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.VersioningConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``VersioningConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.VersioningConfiguration`` resource.
     */
    function bucketResourceVersioningConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_VersioningConfigurationPropertyValidator(properties).assertSuccess();
        return {
            Status: cdk.stringToCloudFormation(properties.status),
        };
    }
    /**
     * Determine whether the given properties match those of a ``WebsiteConfigurationProperty``
     *
     * @param properties the TypeScript properties of a ``WebsiteConfigurationProperty``
     *
     * @returns the result of the validation.
     */
    function BucketResource_WebsiteConfigurationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('errorDocument', cdk.validateString)(properties.errorDocument));
        errors.collect(cdk.propertyValidator('indexDocument', cdk.validateString)(properties.indexDocument));
        errors.collect(cdk.propertyValidator('redirectAllRequestsTo', BucketResource_RedirectAllRequestsToPropertyValidator)(properties.redirectAllRequestsTo));
        errors.collect(cdk.propertyValidator('routingRules', cdk.listValidator(BucketResource_RoutingRulePropertyValidator))(properties.routingRules));
        return errors.wrap('supplied properties not correct for "WebsiteConfigurationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::Bucket.WebsiteConfiguration`` resource
     *
     * @param properties the TypeScript properties of a ``WebsiteConfigurationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::Bucket.WebsiteConfiguration`` resource.
     */
    function bucketResourceWebsiteConfigurationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketResource_WebsiteConfigurationPropertyValidator(properties).assertSuccess();
        return {
            ErrorDocument: cdk.stringToCloudFormation(properties.errorDocument),
            IndexDocument: cdk.stringToCloudFormation(properties.indexDocument),
            RedirectAllRequestsTo: bucketResourceRedirectAllRequestsToPropertyToCloudFormation(properties.redirectAllRequestsTo),
            RoutingRules: cdk.listMapper(bucketResourceRoutingRulePropertyToCloudFormation)(properties.routingRules),
        };
    }
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class BucketArn extends cdk.Arn {
}
exports.BucketArn = BucketArn;
class BucketDomainName extends cdk.Token {
}
exports.BucketDomainName = BucketDomainName;
class BucketDualStackDomainName extends cdk.Token {
}
exports.BucketDualStackDomainName = BucketDualStackDomainName;
class BucketWebsiteUrl extends cdk.Token {
}
exports.BucketWebsiteUrl = BucketWebsiteUrl;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``BucketPolicyResourceProps``
     *
     * @param properties the TypeScript properties of a ``BucketPolicyResourceProps``
     *
     * @returns the result of the validation.
     */
    function BucketPolicyResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('bucket', cdk.requiredValidator)(properties.bucket));
        errors.collect(cdk.propertyValidator('bucket', cdk.validateString)(properties.bucket));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
        return errors.wrap('supplied properties not correct for "BucketPolicyResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::S3::BucketPolicy`` resource
     *
     * @param properties the TypeScript properties of a ``BucketPolicyResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::S3::BucketPolicy`` resource.
     */
    function bucketPolicyResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        BucketPolicyResourcePropsValidator(properties).assertSuccess();
        return {
            Bucket: cdk.stringToCloudFormation(properties.bucket),
            PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html
     */
    class BucketPolicyResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::S3::BucketPolicy``.
         *
         * @param parent     the ``cdk.Construct`` this ``BucketPolicyResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``BucketPolicyResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: BucketPolicyResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'bucket', this);
            cdk.requireProperty(properties, 'policyDocument', this);
        }
        renderProperties() {
            return bucketPolicyResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    BucketPolicyResource.resourceTypeName = "AWS::S3::BucketPolicy";
    cloudformation.BucketPolicyResource = BucketPolicyResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
//# sourceMappingURL=data:application/json;base64, 