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

See Also:
    `AWS developer guide for Logs
    <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/index.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__ = [
    "Destination",
    "DestinationProperties",
    "LogGroup",
    "LogGroupProperties",
    "LogStream",
    "LogStreamProperties",
    "MetricFilter",
    "MetricFilterProperties",
    "SubscriptionFilter",
    "SubscriptionFilterProperties",
]


@attrs(**ATTRSCONFIG)
class DestinationProperties(ResourceProperties):
    DestinationName = attrib(default=None)
    DestinationPolicy = attrib(default=None)
    RoleArn = attrib(default=None)
    TargetArn = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Destination(Resource):
    """A Destination for Logs.

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

    RESOURCE_TYPE = "AWS::Logs::Destination"

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


@attrs(**ATTRSCONFIG)
class LogGroupProperties(ResourceProperties):
    LogGroupName = attrib(default=None)
    RetentionInDays = attrib(default=None)


@attrs(**ATTRSCONFIG)
class LogGroup(Resource):
    """A Log Group for Logs.

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

    RESOURCE_TYPE = "AWS::Logs::LogGroup"

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


@attrs(**ATTRSCONFIG)
class LogStreamProperties(ResourceProperties):
    LogGroupName = attrib(default=None)
    LogStreamName = attrib(default=None)


@attrs(**ATTRSCONFIG)
class LogStream(Resource):
    """A Log Stream for Logs.

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

    RESOURCE_TYPE = "AWS::Logs::LogStream"

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


@attrs(**ATTRSCONFIG)
class MetricFilterProperties(ResourceProperties):
    FilterPattern = attrib(default=None)
    LogGroupName = attrib(default=None)
    MetricTransformations = attrib(default=None)


@attrs(**ATTRSCONFIG)
class MetricFilter(Resource):
    """A Metric Filter for Logs.

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

    RESOURCE_TYPE = "AWS::Logs::MetricFilter"

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


@attrs(**ATTRSCONFIG)
class SubscriptionFilterProperties(ResourceProperties):
    DestinationArn = attrib(default=None)
    FilterPattern = attrib(default=None)
    LogGroupName = attrib(default=None)
    RoleArn = attrib(default=None)


@attrs(**ATTRSCONFIG)
class SubscriptionFilter(Resource):
    """A Subscription Filter for Logs.

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

    RESOURCE_TYPE = "AWS::Logs::SubscriptionFilter"

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