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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .network_acl_action_allow_enum import NetworkAclActionAllowEnum
from .network_acl_action_block_enum import NetworkAclActionBlockEnum
from .network_acl_action_log_enum import NetworkAclActionLogEnum
from .network_acl_action_redirect_enum import NetworkAclActionRedirectEnum


class NetworkAclAction(UniversalBaseModel):
    block: typing.Optional[NetworkAclActionBlockEnum] = None
    allow: typing.Optional[NetworkAclActionAllowEnum] = None
    log: typing.Optional[NetworkAclActionLogEnum] = None
    redirect: typing.Optional[NetworkAclActionRedirectEnum] = None
    redirect_uri: typing.Optional[str] = pydantic.Field(default=None)
    """
    The URI to which the match or not_match requests will be routed
    """

    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
