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

See Also:
    `AWS developer guide for WAFv2
    <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.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__ = [
    "IPSet",
    "IPSetProperties",
    "RegexPatternSet",
    "RegexPatternSetProperties",
    "RuleGroup",
    "RuleGroupProperties",
    "WebACL",
    "WebACLProperties",
]


@attrs(**ATTRSCONFIG)
class IPSetProperties(ResourceProperties):
    Addresses = attrib(default=None)
    Description = attrib(default=None)
    IPAddressVersion = attrib(default=None)
    Name = attrib(default=None)
    Scope = attrib(default=None)
    Tags = attrib(default=None)


@attrs(**ATTRSCONFIG)
class IPSet(Resource):
    """A Ip Set for WAFv2.

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

    RESOURCE_TYPE = "AWS::WAFv2::IPSet"

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


@attrs(**ATTRSCONFIG)
class RegexPatternSetProperties(ResourceProperties):
    Description = attrib(default=None)
    Name = attrib(default=None)
    RegularExpressionList = attrib(default=None)
    Scope = attrib(default=None)
    Tags = attrib(default=None)


@attrs(**ATTRSCONFIG)
class RegexPatternSet(Resource):
    """A Regex Pattern Set for WAFv2.

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

    RESOURCE_TYPE = "AWS::WAFv2::RegexPatternSet"

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


@attrs(**ATTRSCONFIG)
class RuleGroupProperties(ResourceProperties):
    Capacity = attrib(default=None)
    Description = attrib(default=None)
    Name = attrib(default=None)
    Rules = attrib(default=None)
    Scope = attrib(default=None)
    Tags = attrib(default=None)
    VisibilityConfig = attrib(default=None)


@attrs(**ATTRSCONFIG)
class RuleGroup(Resource):
    """A Rule Group for WAFv2.

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

    RESOURCE_TYPE = "AWS::WAFv2::RuleGroup"

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


@attrs(**ATTRSCONFIG)
class WebACLProperties(ResourceProperties):
    DefaultAction = attrib(default=None)
    Description = attrib(default=None)
    Name = attrib(default=None)
    Rules = attrib(default=None)
    Scope = attrib(default=None)
    Tags = attrib(default=None)
    VisibilityConfig = attrib(default=None)


@attrs(**ATTRSCONFIG)
class WebACL(Resource):
    """A Web Acl for WAFv2.

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

    RESOURCE_TYPE = "AWS::WAFv2::WebACL"

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