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

See Also:
    `AWS developer guide for CloudFormation
    <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/index.html>`_

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

from typing import Any
from typing import Dict

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__ = [
    "CustomResource",
    "CustomResourceProperties",
    "Macro",
    "MacroProperties",
    "Stack",
    "StackProperties",
    "WaitCondition",
    "WaitConditionProperties",
    "WaitConditionHandle",
    "WaitConditionHandleProperties",
]


@attrs(**ATTRSCONFIG)
class CustomResourceProperties(ResourceProperties):
    ServiceToken = attrib(default=None)


@attrs(**ATTRSCONFIG)
class CustomResource(Resource):
    """A Custom Resource for CloudFormation.

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

    RESOURCE_TYPE = "AWS::CloudFormation::CustomResource"

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


@attrs(**ATTRSCONFIG)
class MacroProperties(ResourceProperties):
    Description = attrib(default=None)
    FunctionName = attrib(default=None)
    LogGroupName = attrib(default=None)
    LogRoleARN = attrib(default=None)
    Name = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Macro(Resource):
    """A Macro for CloudFormation.

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

    RESOURCE_TYPE = "AWS::CloudFormation::Macro"

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


@attrs(**ATTRSCONFIG)
class StackProperties(ResourceProperties):
    NotificationARNs = attrib(default=None)
    Parameters = attrib(default=None)
    Tags = attrib(default=None)
    TemplateURL = attrib(default=None)
    TimeoutInMinutes = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Stack(Resource):
    """A Stack for CloudFormation.

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

    RESOURCE_TYPE = "AWS::CloudFormation::Stack"

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


@attrs(**ATTRSCONFIG)
class WaitConditionProperties(ResourceProperties):
    Count = attrib(default=None)
    Handle = attrib(default=None)
    Timeout = attrib(default=None)


@attrs(**ATTRSCONFIG)
class WaitCondition(Resource):
    """A Wait Condition for CloudFormation.

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

    RESOURCE_TYPE = "AWS::CloudFormation::WaitCondition"

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

    # NB: CreationPolicy may be set for WaitCondition
    # (unlike most Resource types)
    CreationPolicy: Dict[str, Any] = attrib(factory=dict)


@attrs(**ATTRSCONFIG)
class WaitConditionHandleProperties(ResourceProperties):
    # A WaitConditionHandle doesn't actually have any Properties.
    pass


@attrs(**ATTRSCONFIG)
class WaitConditionHandle(Resource):
    """A Wait Condition Handle for CloudFormation.

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

    RESOURCE_TYPE = "AWS::CloudFormation::WaitConditionHandle"

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