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

See Also:
    `AWS developer guide for ECS
    <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/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__ = [
    "Cluster",
    "ClusterProperties",
    "Service",
    "ServiceProperties",
    "TaskDefinition",
    "TaskDefinitionProperties",
]


@attrs(**ATTRSCONFIG)
class ClusterProperties(ResourceProperties):
    ClusterName = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Cluster(Resource):
    """A Cluster for ECS.

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

    RESOURCE_TYPE = "AWS::ECS::Cluster"

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


@attrs(**ATTRSCONFIG)
class ServiceProperties(ResourceProperties):
    Cluster = attrib(default=None)
    DeploymentConfiguration = attrib(default=None)
    DesiredCount = attrib(default=None)
    HealthCheckGracePeriodSeconds = attrib(default=None)
    LaunchType = attrib(default=None)
    LoadBalancers = attrib(default=None)
    NetworkConfiguration = attrib(default=None)
    PlacementConstraints = attrib(default=None)
    PlacementStrategies = attrib(default=None)
    PlatformVersion = attrib(default=None)
    Role = attrib(default=None)
    SchedulingStrategy = attrib(default=None)
    ServiceName = attrib(default=None)
    ServiceRegistries = attrib(default=None)
    TaskDefinition = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Service(Resource):
    """A Service for ECS.

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

    RESOURCE_TYPE = "AWS::ECS::Service"

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


@attrs(**ATTRSCONFIG)
class TaskDefinitionProperties(ResourceProperties):
    ContainerDefinitions = attrib(default=None)
    Cpu = attrib(default=None)
    ExecutionRoleArn = attrib(default=None)
    Family = attrib(default=None)
    Memory = attrib(default=None)
    NetworkMode = attrib(default=None)
    PlacementConstraints = attrib(default=None)
    RequiresCompatibilities = attrib(default=None)
    TaskRoleArn = attrib(default=None)
    Volumes = attrib(default=None)


@attrs(**ATTRSCONFIG)
class TaskDefinition(Resource):
    """A Task Definition for ECS.

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

    RESOURCE_TYPE = "AWS::ECS::TaskDefinition"

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