# 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 .brute_force_protection_mode_enum import BruteForceProtectionModeEnum
from .brute_force_protection_shields_enum import BruteForceProtectionShieldsEnum


class GetBruteForceSettingsResponseContent(UniversalBaseModel):
    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether or not brute force attack protections are active.
    """

    shields: typing.Optional[typing.List[BruteForceProtectionShieldsEnum]] = pydantic.Field(default=None)
    """
    Action to take when a brute force protection threshold is violated.
            Possible values: <code>block</code>, <code>user_notification</code>.
    """

    allowlist: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of trusted IP addresses that will not have attack protection enforced against them.
    """

    mode: typing.Optional[BruteForceProtectionModeEnum] = None
    max_attempts: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum number of unsuccessful attempts.
    """

    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
