# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .network_acl_match_connecting_ipv_4_cidr import NetworkAclMatchConnectingIpv4Cidr
from .network_acl_match_connecting_ipv_6_cidr import NetworkAclMatchConnectingIpv6Cidr
from .network_acl_match_ipv_4_cidr import NetworkAclMatchIpv4Cidr
from .network_acl_match_ipv_6_cidr import NetworkAclMatchIpv6Cidr


class NetworkAclMatch(UniversalBaseModel):
    asns: typing.Optional[typing.List[int]] = None
    auth_0_managed: typing_extensions.Annotated[
        typing.Optional[typing.List[str]], FieldMetadata(alias="auth0_managed"), pydantic.Field(alias="auth0_managed")
    ] = None
    geo_country_codes: typing.Optional[typing.List[str]] = None
    geo_subdivision_codes: typing.Optional[typing.List[str]] = None
    ipv_4_cidrs: typing_extensions.Annotated[
        typing.Optional[typing.List[NetworkAclMatchIpv4Cidr]],
        FieldMetadata(alias="ipv4_cidrs"),
        pydantic.Field(alias="ipv4_cidrs"),
    ] = None
    ipv_6_cidrs: typing_extensions.Annotated[
        typing.Optional[typing.List[NetworkAclMatchIpv6Cidr]],
        FieldMetadata(alias="ipv6_cidrs"),
        pydantic.Field(alias="ipv6_cidrs"),
    ] = None
    ja_3_fingerprints: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="ja3_fingerprints"),
        pydantic.Field(alias="ja3_fingerprints"),
    ] = None
    ja_4_fingerprints: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="ja4_fingerprints"),
        pydantic.Field(alias="ja4_fingerprints"),
    ] = None
    user_agents: typing.Optional[typing.List[str]] = None
    hostnames: typing.Optional[typing.List[str]] = None
    connecting_ipv_4_cidrs: typing_extensions.Annotated[
        typing.Optional[typing.List[NetworkAclMatchConnectingIpv4Cidr]],
        FieldMetadata(alias="connecting_ipv4_cidrs"),
        pydantic.Field(alias="connecting_ipv4_cidrs"),
    ] = None
    connecting_ipv_6_cidrs: typing_extensions.Annotated[
        typing.Optional[typing.List[NetworkAclMatchConnectingIpv6Cidr]],
        FieldMetadata(alias="connecting_ipv6_cidrs"),
        pydantic.Field(alias="connecting_ipv6_cidrs"),
    ] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
