# 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 .password_character_type_enum import PasswordCharacterTypeEnum
from .password_character_type_rule_policy_enum import PasswordCharacterTypeRulePolicyEnum
from .password_identical_characters_policy_enum import PasswordIdenticalCharactersPolicyEnum
from .password_max_length_exceeded_policy_enum import PasswordMaxLengthExceededPolicyEnum
from .password_sequential_characters_policy_enum import PasswordSequentialCharactersPolicyEnum


class ConnectionPasswordOptionsComplexity(UniversalBaseModel):
    """
    Password complexity requirements configuration
    """

    min_length: typing.Optional[int] = pydantic.Field(default=None)
    """
    Minimum password length required (1-72 characters)
    """

    character_types: typing.Optional[typing.List[PasswordCharacterTypeEnum]] = pydantic.Field(default=None)
    """
    Required character types that must be present in passwords. Valid options: uppercase, lowercase, number, special
    """

    character_type_rule: typing.Optional[PasswordCharacterTypeRulePolicyEnum] = None
    identical_characters: typing.Optional[PasswordIdenticalCharactersPolicyEnum] = None
    sequential_characters: typing.Optional[PasswordSequentialCharactersPolicyEnum] = None
    max_length_exceeded: typing.Optional[PasswordMaxLengthExceededPolicyEnum] = 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
