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

See Also:
    `AWS developer guide for Events
    <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.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__ = [
    "EventBusPolicy",
    "EventBusPolicyProperties",
    "Rule",
    "RuleProperties",
]


@attrs(**ATTRSCONFIG)
class EventBusPolicyProperties(ResourceProperties):
    Action = attrib(default=None)
    Condition = attrib(default=None)
    Principal = attrib(default=None)
    StatementId = attrib(default=None)


@attrs(**ATTRSCONFIG)
class EventBusPolicy(Resource):
    """A Event Bus Policy for Events.

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

    RESOURCE_TYPE = "AWS::Events::EventBusPolicy"

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


@attrs(**ATTRSCONFIG)
class RuleProperties(ResourceProperties):
    Description = attrib(default=None)
    EventPattern = attrib(default=None)
    Name = attrib(default=None)
    RoleArn = attrib(default=None)
    ScheduleExpression = attrib(default=None)
    State = attrib(default=None)
    Targets = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Rule(Resource):
    """A Rule for Events.

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

    RESOURCE_TYPE = "AWS::Events::Rule"

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