"""Raw representations of every data type in the AWS S3 service.

See Also:
    `AWS developer guide for S3
    <https://docs.aws.amazon.com/AmazonS3/latest/dev/Welcome.html>`_

This file is automatically generated, and should not be directly edited.
"""

from attr import attrib
from attr import attrs

from ..core import ATTRSCONFIG
from ..core import Resource
from ..core import ResourceProperties
from ..core import create_object_converter

__all__ = [
    "Bucket",
    "BucketProperties",
    "BucketPolicy",
    "BucketPolicyProperties",
]


@attrs(**ATTRSCONFIG)
class BucketProperties(ResourceProperties):
    AccelerateConfiguration = attrib(default=None)
    AccessControl = attrib(default=None)
    AnalyticsConfigurations = attrib(default=None)
    BucketEncryption = attrib(default=None)
    BucketName = attrib(default=None)
    CorsConfiguration = attrib(default=None)
    InventoryConfigurations = attrib(default=None)
    LifecycleConfiguration = attrib(default=None)
    LoggingConfiguration = attrib(default=None)
    MetricsConfigurations = attrib(default=None)
    NotificationConfiguration = attrib(default=None)
    PublicAccessBlockConfiguration = attrib(default=None)
    ReplicationConfiguration = attrib(default=None)
    Tags = attrib(default=None)
    VersioningConfiguration = attrib(default=None)
    WebsiteConfiguration = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Bucket(Resource):
    """A Bucket for S3.

    See Also:
        `AWS Cloud Formation documentation for Bucket
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html>`_
    """

    RESOURCE_TYPE = "AWS::S3::Bucket"

    Properties: BucketProperties = attrib(
        factory=BucketProperties,
        converter=create_object_converter(BucketProperties),
    )


@attrs(**ATTRSCONFIG)
class BucketPolicyProperties(ResourceProperties):
    Bucket = attrib(default=None)
    PolicyDocument = attrib(default=None)


@attrs(**ATTRSCONFIG)
class BucketPolicy(Resource):
    """A Bucket Policy for S3.

    See Also:
        `AWS Cloud Formation documentation for BucketPolicy
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html>`_
    """

    RESOURCE_TYPE = "AWS::S3::BucketPolicy"

    Properties: BucketPolicyProperties = attrib(
        factory=BucketPolicyProperties,
        converter=create_object_converter(BucketPolicyProperties),
    )
