# 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_default_dictionaries_enum import PasswordDefaultDictionariesEnum


class ConnectionPasswordOptionsDictionary(UniversalBaseModel):
    """
    Dictionary-based password restriction policy to prevent common passwords
    """

    active: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Enables dictionary checking to prevent use of common passwords and custom blocked words
    """

    custom: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Array of custom words to block in passwords. Maximum 200 items, each up to 50 characters
    """

    default: typing.Optional[PasswordDefaultDictionariesEnum] = 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
