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

See Also:
    `AWS developer guide for ElasticLoadBalancingV2
    <https://docs.aws.amazon.com/elasticloadbalancing/latest/application/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__ = [
    "Listener",
    "ListenerProperties",
    "ListenerCertificate",
    "ListenerCertificateProperties",
    "ListenerRule",
    "ListenerRuleProperties",
    "LoadBalancer",
    "LoadBalancerProperties",
    "TargetGroup",
    "TargetGroupProperties",
]


@attrs(**ATTRSCONFIG)
class ListenerProperties(ResourceProperties):
    Certificates = attrib(default=None)
    DefaultActions = attrib(default=None)
    LoadBalancerArn = attrib(default=None)
    Port = attrib(default=None)
    Protocol = attrib(default=None)
    SslPolicy = attrib(default=None)


@attrs(**ATTRSCONFIG)
class Listener(Resource):
    """A Listener for ElasticLoadBalancingV2.

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

    RESOURCE_TYPE = "AWS::ElasticLoadBalancingV2::Listener"

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


@attrs(**ATTRSCONFIG)
class ListenerCertificateProperties(ResourceProperties):
    Certificates = attrib(default=None)
    ListenerArn = attrib(default=None)


@attrs(**ATTRSCONFIG)
class ListenerCertificate(Resource):
    """A Listener Certificate for ElasticLoadBalancingV2.

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

    RESOURCE_TYPE = "AWS::ElasticLoadBalancingV2::ListenerCertificate"

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


@attrs(**ATTRSCONFIG)
class ListenerRuleProperties(ResourceProperties):
    Actions = attrib(default=None)
    Conditions = attrib(default=None)
    ListenerArn = attrib(default=None)
    Priority = attrib(default=None)


@attrs(**ATTRSCONFIG)
class ListenerRule(Resource):
    """A Listener Rule for ElasticLoadBalancingV2.

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

    RESOURCE_TYPE = "AWS::ElasticLoadBalancingV2::ListenerRule"

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


@attrs(**ATTRSCONFIG)
class LoadBalancerProperties(ResourceProperties):
    IpAddressType = attrib(default=None)
    LoadBalancerAttributes = attrib(default=None)
    Name = attrib(default=None)
    Scheme = attrib(default=None)
    SecurityGroups = attrib(default=None)
    SubnetMappings = attrib(default=None)
    Subnets = attrib(default=None)
    Tags = attrib(default=None)
    Type = attrib(default=None)


@attrs(**ATTRSCONFIG)
class LoadBalancer(Resource):
    """A Load Balancer for ElasticLoadBalancingV2.

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

    RESOURCE_TYPE = "AWS::ElasticLoadBalancingV2::LoadBalancer"

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


@attrs(**ATTRSCONFIG)
class TargetGroupProperties(ResourceProperties):
    HealthCheckEnabled = attrib(default=None)
    HealthCheckIntervalSeconds = attrib(default=None)
    HealthCheckPath = attrib(default=None)
    HealthCheckPort = attrib(default=None)
    HealthCheckProtocol = attrib(default=None)
    HealthCheckTimeoutSeconds = attrib(default=None)
    HealthyThresholdCount = attrib(default=None)
    Matcher = attrib(default=None)
    Name = attrib(default=None)
    Port = attrib(default=None)
    Protocol = attrib(default=None)
    Tags = attrib(default=None)
    TargetGroupAttributes = attrib(default=None)
    Targets = attrib(default=None)
    TargetType = attrib(default=None)
    UnhealthyThresholdCount = attrib(default=None)
    VpcId = attrib(default=None)


@attrs(**ATTRSCONFIG)
class TargetGroup(Resource):
    """A Target Group for ElasticLoadBalancingV2.

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

    RESOURCE_TYPE = "AWS::ElasticLoadBalancingV2::TargetGroup"

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