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

See Also:
    `AWS developer guide for SNS
    <https://docs.aws.amazon.com/sns/latest/dg/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__ = [
    "Subscription",
    "SubscriptionProperties",
    "Topic",
    "TopicProperties",
    "TopicPolicy",
    "TopicPolicyProperties",
]


@attrs(**ATTRSCONFIG)
class SubscriptionProperties(ResourceProperties):
    DeliveryPolicy = attrib(default=None)
    Endpoint = attrib(default=None)
    FilterPolicy = attrib(default=None)
    Protocol = attrib(default=None)
    RawMessageDelivery = attrib(default=None)
    Region = attrib(default=None)
    TopicArn = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Subscription(Resource):
    """A Subscription for SNS.

    See Also:
        `AWS Cloud Formation documentation for Subscription
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html>`_
    """

    RESOURCE_TYPE = "AWS::SNS::Subscription"

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


@attrs(**ATTRSCONFIG)
class TopicProperties(ResourceProperties):
    DisplayName = attrib(default=None)
    KmsMasterKeyId = attrib(default=None)
    Subscription = attrib(default=None)
    TopicName = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Topic(Resource):
    """A Topic for SNS.

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

    RESOURCE_TYPE = "AWS::SNS::Topic"

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


@attrs(**ATTRSCONFIG)
class TopicPolicyProperties(ResourceProperties):
    PolicyDocument = attrib(default=None)
    Topics = attrib(default=None)


@attrs(**ATTRSCONFIG)
class TopicPolicy(Resource):
    """A Topic Policy for SNS.

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

    RESOURCE_TYPE = "AWS::SNS::TopicPolicy"

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