HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pydantic/__pycache__/aliases.cpython-310.pyc
o

|��g��@s�dZddlmZddlZddlmZmZmZddlm	Z	ddl
mZdZej
diej��Gd	d
�d
��Zej
diej��Gdd�d��Zej
diej��Gd
d�d��ZdS)z!Support for alias configurations.�)�annotationsN)�Any�Callable�Literal)�PydanticUndefined�)�_internal_dataclass)�AliasGenerator�	AliasPath�AliasChoicesc@s8eZdZUdZded<dd
d�Zdd
d�Zddd�ZdS)r
z�Usage docs: https://docs.pydantic.dev/2.10/concepts/alias#aliaspath-and-aliaschoices

    A data class used by `validation_alias` as a convenience to create aliases.

    Attributes:
        path: A list of string or integer aliases.
    zlist[int | str]�path�	first_arg�str�args�	str | int�return�NonecG�|gt|�|_dS�N)�listr)�selfr
r�r�;/usr/local/lib/python3.10/dist-packages/pydantic/aliases.py�__init__�zAliasPath.__init__�list[str | int]cCs|jS)zvConverts arguments to a list of string or integer aliases.

        Returns:
            The list of aliases.
        )r)rrrr�convert_to_aliasesszAliasPath.convert_to_aliases�d�dictrcCsR|}|jD]!}t|t�rtSz||}Wqtttfy&tYSw|S)z�Searches a dictionary for the path specified by the alias.

        Returns:
            The value at the specified path, or `PydanticUndefined` if the path is not found.
        )r�
isinstancerr�KeyError�
IndexError�	TypeError)rr�v�krrr�search_dict_for_path&s

�zAliasPath.search_dict_for_pathN)r
rrrrr)rr)rrrr)�__name__�
__module__�__qualname__�__doc__�__annotations__rrr%rrrrr
s


r
c@s.eZdZUdZded<ddd	�Zddd�Zd
S)rz�Usage docs: https://docs.pydantic.dev/2.10/concepts/alias#aliaspath-and-aliaschoices

    A data class used by `validation_alias` as a convenience to create aliases.

    Attributes:
        choices: A list containing a string or `AliasPath`.
    zlist[str | AliasPath]�choices�first_choice�str | AliasPathrrcGrr)rr+)rr,r+rrrrDrzAliasChoices.__init__�list[list[str | int]]cCs:g}|jD]}t|t�r|�|���q|�|g�q|S)z�Converts arguments to a list of lists containing string or integer aliases.

        Returns:
            The list of aliases.
        )r+rr
�appendr)r�aliases�crrrrGs

zAliasChoices.convert_to_aliasesN)r,r-r+r-rr)rr.)r&r'r(r)r*rrrrrrr8s


rc@sJeZdZUdZdZded<dZded<dZded<ddd�Zddd�Z	dS)r	a�Usage docs: https://docs.pydantic.dev/2.10/concepts/alias#using-an-aliasgenerator

    A data class used by `alias_generator` as a convenience to create various aliases.

    Attributes:
        alias: A callable that takes a field name and returns an alias for it.
        validation_alias: A callable that takes a field name and returns a validation alias for it.
        serialization_alias: A callable that takes a field name and returns a serialization alias for it.
    NzCallable[[str], str] | None�aliasz6Callable[[str], str | AliasPath | AliasChoices] | None�validation_alias�serialization_alias�
alias_kind�;Literal['alias', 'validation_alias', 'serialization_alias']�
allowed_types�<tuple[type[str] | type[AliasPath] | type[AliasChoices], ...]�
field_namerr�%str | AliasPath | AliasChoices | NonecCsHd}t||�}r"||�}|r"t||�s"td|�d|�d|�d���|S)z�Generate an alias of the specified kind. Returns None if the alias generator is None.

        Raises:
            TypeError: If the alias generator produces an invalid type.
        Nz	Invalid `z	` type. `z!` generator must produce one of `�`)�getattrrr")rr5r7r9r2�alias_generatorrrr�_generate_aliasfs�zAliasGenerator._generate_alias�Dtuple[str | None, str | AliasPath | AliasChoices | None, str | None]cCs>|�dtf|�}|�dtttf|�}|�dtf|�}|||fS)z�Generate `alias`, `validation_alias`, and `serialization_alias` for a field.

        Returns:
            A tuple of three aliases - validation, alias, and serialization.
        r2r3r4)r>rrr
)rr9r2r3r4rrr�generate_aliaseszs
zAliasGenerator.generate_aliases)r5r6r7r8r9rrr:)r9rrr?)
r&r'r(r)r2r*r3r4r>r@rrrrr	Vs


r	r)r)�
__future__r�dataclasses�typingrrr�
pydantic_corer�	_internalr�__all__�	dataclass�
slots_truer
rr	rrrr�<module>s(