U
    Qh9                 3   @  s6  U d Z ddlmZ ddlZddlZddlmZ ddlm	Z	mZm
Z
mZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ejd	k rdd
lmZ ndd
lmZ ejdk rddlmZmZm Z  nddlmZmZm Z  ejdk rddlm!Z! nddlm!Z! er$ddl"m#Z# n.zddl"m#Z# W n e$k
rP   e% Z#Y nX e!d Z&G dd deddZ'dZ(de)d< G dd deZ*G dd de*eZ+G dd deZ,e!d Z-G dd  d eddZ.d!d d"d#d$Z/eegef Z0eee*gef Z1eeegef Z2eeee+gef Z3ee0e1e2e3f Z4e!d% Z5G d&d' d'eddZ6dddd(d)d*d+d+d,d-d'd.d/d0Z7G d1d2 d2eZ8eee8gef Z9eee8e*gef Z:eeee8gef Z;eeee8e+gef Z<ee9e:e;e<f Z=G d3d4 d4eddZ>ddddd(d5d6d+d+d,d,d-d4d7d8d9Z?G d:d; d;eddZ@d<d=d>d-d;d?d@dAZAG dBdC dCeddZBd<d=d-dCdDdEdFZCG dGdH dHeddZDdIdJdHdKdLdMZEee.e6e>e@eBeDf ZFG dNdO dOeddZGddPdQdOdRdSdTZHG dUdV dVeddZIdddWd>dJdPdQdVdXdYdZZJG d[d\ d\eddZKdddd]dPdQd^d\d_d`daZLG dbdc dceddZMdddd]dPdQd^dcd_dddeZNG dfdg dgeddZOdd+dPdQd^dgdhdidjZPG dkdl dleddZQddddddddddm	dndndndndnd+dPdQd^dldo
dpdqZRG drds dseddZSdddddddddddt
d+dududududud+dPdQd^dsdvdwdxZTG dydz dzeddZUddddddddddddd{d+d|d|d|d|d|dndnd+dPdQd^dzd}d~dZVG dd deddZWdddddd+dPdQd^ddhddZXG dd deddZYdddddddddddddddndnd+d+d+dd+d+dPdQd^ddddZZG dd deddZ[ddddddddndnd+dPdQd^ddddZ\G dd deddZ]ddddddddddd
d+ddddddndPdQd^ddddZ^G dd deddZ_ddddddddddd
d+dddddddPdQd^ddddZ`G dd deddZadddddddddddddd+dddddddnddPdQd^ddddZbG dd deddZcdddddddddd	d+ddddddPdQd^dd
ddZdG dd deddZedddd]ddPdQd^ddddZfG dd deddZgdddddddddddd+dPdQd^dd	ddZhe!d ZiG ddĄ deddZjdddddŜddPdPdQd^ddƜddȄZkG ddʄ deddZldddddŜdIdPdPdQd^ddƜdd̄ZmG dd΄ deddZndddd]dPdQd^dd_ddЄZoG dd҄ deddZpddddddӜdd+dPdQd^dd՜ddׄZqG ddل deddZrdddڜddddܜddބZseereFf ZtG dd deddZudddddddddd,dndnd+d+dPdQddd	ddZvdddddddd,d+dPdQdddddZwd	dddddddd,dndnd+dPdQdddddZxG dd deddZydddddddddddndndnd+d+dPdQddd
ddZzG dd deddZ{d
ddddddddd,dndnd+d+dPdQd^dd	ddZ|G dd deddZ}dddddddddd,dndnd+d+dPdQd^dd	ddZ~G dd deddZdddddddd,dndndPdQddd ddZeeeef  ZG dd deddZdddڜddddܜddZeeeFf ZG dd	 d	eddZddddddddd,d,dndnd+dPdQd^d	d
	ddZeegef ZG dd deZeee,gef ZG dd deddZeeef ZG dd deddZG dd deddZdddddddJdPd,dQd^ddddZddddddddJdPdPd,dQd^ddddZG dd  d eddZdddddddJdPd,dQd^d dd!d"Zddddd#ddJdPdPdQd^d d$d%d&ZG d'd( d(eZeeegef ZG d)d* d*eZeeee,gef ZG d+d, d,eddZeeef ZG d-d. d.eddZdddddd/dJdPd,dQd^d.dd0d1Zdddddd2d3dJdPd,dPdQd^d.d4d5d6ZG d7d8 d8eddZdddddddPd,dQd^d8d9d:d;ZddddddddPdPd,dQd^d8d<d=d>ZG d?d@ d@eddZe#dddddddddA	dJddBd+dCd+d+dPdQd^d@dDdEdFZG dGdH dHeddZddddddJd+dPdQd^dHdIdJdKZG dLdM dMeddZddddddddddN	dOd+dPdPdPdQd+dPdQd^dMdRdSdTZG dUdV dVeddZdddddddddWdXdYdPdPdZd+d+dPdQd^dVd[d\d]ZG d^d_ d_eddZdddd]ddPdQd^d_d`dadbZG dcdd ddeddZddddddJdJd+dPdQd^dddedfdgZG dhdi dieddZdddd]dJdJdPdQd^didjdkdlZG dmdn dneddZddddddodJd+dpdPd+dQdndqdrdsZG dtdu dueddZddddddddddddvdwdxdyd+d,dzd+d+dPdQd^d{dud|d}d~ZG dd deddZdddddddJdpdPd+d+dQddddZG dd deddZddddddddddd
ddPdyd+d,dzd+d+dPdQd^ddddZG dd deddZddddddddddddddIdJdxd+d+dPdd+d+dzd{dPdQd^ddddZG dd deddZdddddddddd>dJd+d+d+dpdPd+dQd+ddddZG dd deddZddddddddd>ddd+d+dPdQd^dzdd
ddZG dd deddZdddddddddddddIdJddxdPd+dd+dPdQd^d+d+d{ddddZG dd deddZdddd>dJddpddddZe!d Zde)d< G dd deddZdddddddddd+d,dd,dPdQd^dd	ddZG dd deddZdddddddJddPd,dPdQd^ddddZG dd deddZdddddddJd>dPddPdQd^ddĜdŐdƄZG dǐdȄ deddZȐddddd]d,dPdQd^dȐdɜdʐd˄ZG d̐d̈́ deddZdddddddddddΜ
dndd+dPdndPd+dPdQd^d͐dМdѐd҄ZG dӐdԄ deddZdddddddddddΜ
dndd+dPdndPd+dPdQd^dԐdМdՐdքZG dאd؄ deddZdJddؐdٜdڐdۄZG dܐd݄ deddZАdd>dPdQd^dݐdޜdߐdZdZeҐseeGeKeMeOeQeSeUeYe[e]e_eaeceeegejeleneueye{e}eeeeeeeeeeeeeeeeeeeeeeeeeeepeWf2 Zn e!d Ze!d Ze!d ZdddddZeddd>dJdddZeddd Zeddd>dJdddZeddd Zedd3d>dJdddZeddd Zeddd>dddZeddd  Ze,eeedZere,Zd>ddddZdS (  ze
This module contains definitions to build schemas which `pydantic_core` can
validate and serialize.
    )annotationsN)Mapping)datedatetimetime	timedelta)Decimal)TYPE_CHECKINGAnyCallableDictHashableListPatternSetTupleTypeUnion)
deprecated)      )	TypedDict)r      )ProtocolRequired	TypeAlias)r   	   )Literal)PydanticUndefined)ZallowZforbidignorec                   @  s   e Zd ZU dZded< ded< ded< ded< ded	< ded
< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< d ed!< d"ed#< d$S )%
CoreConfigat
  
    Base class for schema configuration options.

    Attributes:
        title: The name of the configuration.
        strict: Whether the configuration should strictly adhere to specified rules.
        extra_fields_behavior: The behavior for handling extra fields.
        typed_dict_total: Whether the TypedDict should be considered total. Default is `True`.
        from_attributes: Whether to use attributes for models, dataclasses, and tagged union keys.
        loc_by_alias: Whether to use the used alias (or first alias for "field required" errors) instead of
            `field_names` to construct error `loc`s. Default is `True`.
        revalidate_instances: Whether instances of models and dataclasses should re-validate. Default is 'never'.
        validate_default: Whether to validate default values during validation. Default is `False`.
        populate_by_name: Whether an aliased field may be populated by its name as given by the model attribute,
            as well as the alias. (Replaces 'allow_population_by_field_name' in Pydantic v1.) Default is `False`.
        str_max_length: The maximum length for string fields.
        str_min_length: The minimum length for string fields.
        str_strip_whitespace: Whether to strip whitespace from string fields.
        str_to_lower: Whether to convert string fields to lowercase.
        str_to_upper: Whether to convert string fields to uppercase.
        allow_inf_nan: Whether to allow infinity and NaN values for float fields. Default is `True`.
        ser_json_timedelta: The serialization option for `timedelta` values. Default is 'iso8601'.
        ser_json_bytes: The serialization option for `bytes` values. Default is 'utf8'.
        ser_json_inf_nan: The serialization option for infinity and NaN values
            in float fields. Default is 'null'.
        val_json_bytes: The validation option for `bytes` values, complementing ser_json_bytes. Default is 'utf8'.
        hide_input_in_errors: Whether to hide input data from `ValidationError` representation.
        validation_error_cause: Whether to add user-python excs to the __cause__ of a ValidationError.
            Requires exceptiongroup backport pre Python 3.11.
        coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).
        regex_engine: The regex engine to use for regex pattern validation. Default is 'rust-regex'. See `StringSchema`.
        cache_strings: Whether to cache strings. Default is `True`, `True` or `'all'` is required to cache strings
            during general validation since validators don't know if they're in a key or a value.
    strtitleboolstrictExtraBehaviorZextra_fields_behaviorZtyped_dict_totalfrom_attributesZloc_by_alias2Literal[('always', 'never', 'subclass-instances')]revalidate_instancesvalidate_defaultpopulate_by_nameintZstr_max_lengthZstr_min_lengthZstr_strip_whitespaceZstr_to_lowerZstr_to_upperallow_inf_nanzLiteral[('iso8601', 'float')]Zser_json_timedeltaz"Literal[('utf8', 'base64', 'hex')]Zser_json_bytesz)Literal[('null', 'constants', 'strings')]Zser_json_inf_nanZval_json_bytesZhide_input_in_errorsZvalidation_error_causecoerce_numbers_to_str$Literal[('rust-regex', 'python-re')]regex_enginez-Union[bool, Literal[('all', 'keys', 'none')]]Zcache_stringsN)__name__
__module____qualname____doc____annotations__ r5   r5   ?./venv/lib/python3.8/site-packages/pydantic_core/core_schema.pyr    /   s2   
#r    F)totalz2set[int | str] | dict[int | str, IncExCall] | Noner   	IncExCallc                   @  s   e Zd ZeddddZeddddZedddd	Zed
dddZeddddZeddddZ	eddddZ
eddddZeddddZddddZddddZd
dddZd
dddZd S )!SerializationInfor8   returnc                 C  s   d S Nr5   selfr5   r5   r6   include|   s    zSerializationInfo.includec                 C  s   d S r<   r5   r=   r5   r5   r6   exclude   s    zSerializationInfo.exclude
Any | Nonec                 C  s   dS )zCurrent serialization context.Nr5   r=   r5   r5   r6   context   s    zSerializationInfo.contextr!   c                 C  s   d S r<   r5   r=   r5   r5   r6   mode   s    zSerializationInfo.moder#   c                 C  s   d S r<   r5   r=   r5   r5   r6   by_alias   s    zSerializationInfo.by_aliasc                 C  s   d S r<   r5   r=   r5   r5   r6   exclude_unset   s    zSerializationInfo.exclude_unsetc                 C  s   d S r<   r5   r=   r5   r5   r6   exclude_defaults   s    z"SerializationInfo.exclude_defaultsc                 C  s   d S r<   r5   r=   r5   r5   r6   exclude_none   s    zSerializationInfo.exclude_nonec                 C  s   d S r<   r5   r=   r5   r5   r6   serialize_as_any   s    z"SerializationInfo.serialize_as_anyc                 C  s   d S r<   r5   r=   r5   r5   r6   
round_trip       zSerializationInfo.round_tripc                 C  s   d S r<   r5   r=   r5   r5   r6   mode_is_json   rJ   zSerializationInfo.mode_is_jsonc                 C  s   d S r<   r5   r=   r5   r5   r6   __str__   rJ   zSerializationInfo.__str__c                 C  s   d S r<   r5   r=   r5   r5   r6   __repr__   rJ   zSerializationInfo.__repr__N)r0   r1   r2   propertyr?   r@   rB   rC   rD   rE   rF   rG   rH   rI   rK   rL   rM   r5   r5   r5   r6   r9   {   s,   r9   c                   @  s   e Zd ZeddddZdS )FieldSerializationInfor!   r:   c                 C  s   d S r<   r5   r=   r5   r5   r6   
field_name   s    z!FieldSerializationInfo.field_nameN)r0   r1   r2   rN   rP   r5   r5   r5   r6   rO      s   rO   c                   @  sj   e Zd ZdZeddddZeddddZed	dd
dZeddddZeddddZ	dS )ValidationInfoz2
    Argument passed to validation functions.
    rA   r:   c                 C  s   dS )zCurrent validation context.Nr5   r=   r5   r5   r6   rB      s    zValidationInfo.contextCoreConfig | Nonec                 C  s   dS )z/The CoreConfig that applies to this validation.Nr5   r=   r5   r5   r6   config   s    zValidationInfo.configzLiteral[('python', 'json')]c                 C  s   dS )z2The type of input data we are currently validatingNr5   r=   r5   r5   r6   rC      s    zValidationInfo.modeDict[str, Any]c                 C  s   dS )z(The data being validated for this model.Nr5   r=   r5   r5   r6   data   s    zValidationInfo.data
str | Nonec                 C  s   dS )zw
        The name of the current field being validated if this validator is
        attached to a model field.
        Nr5   r=   r5   r5   r6   rP      s    zValidationInfo.field_nameN)
r0   r1   r2   r3   rN   rB   rS   rC   rU   rP   r5   r5   r5   r6   rQ      s   rQ   )noner+   r#   floatr!   bytes	bytearraylisttupleset	frozenset	generatordictr   r   r   r   urlmulti-host-urljsonuuidanyc                   @  s   e Zd ZU ded< dS )SimpleSerSchemaz$Required[ExpectedSerializationTypes]typeNr0   r1   r2   r4   r5   r5   r5   r6   rf      s   
rf   ExpectedSerializationTypes)rg   r;   c                 C  s
   t | dS )z{
    Returns a schema for serialization with a custom type.

    Args:
        type: The type to use for serialization
    rg   )rf   rj   r5   r5   r6   simple_ser_schema   s    rk   )alwayszunless-nonerc   json-unless-nonec                   @  s>   e Zd ZU ded< ded< ded< ded< ded	< d
ed< dS ) PlainSerializerFunctionSerSchema#Required[Literal['function-plain']]rg   zRequired[SerializerFunction]functionr#   is_field_serializerinfo_arg
CoreSchemareturn_schemaWhenUsed	when_usedNrh   r5   r5   r5   r6   rn   
  s   
rn   rl   )rq   rr   rt   rv   SerializerFunctionzbool | NonezCoreSchema | Noneru   )rp   rq   rr   rt   rv   r;   c                C  s    |dkrd}t d| ||||dS )a  
    Returns a schema for serialization with a function, can be either a "general" or "field" function.

    Args:
        function: The function to use for serialization
        is_field_serializer: Whether the serializer is for a field, e.g. takes `model` as the first argument,
            and `info` includes `field_name`
        info_arg: Whether the function takes an `info` argument
        return_schema: Schema to use for serializing return value
        when_used: When the function should be called
    rl   Nfunction-plain)rg   rp   rq   rr   rt   rv   _dict_not_none)rp   rq   rr   rt   rv   r5   r5   r6   $plain_serializer_function_ser_schema  s    r{   c                   @  s    e Zd ZdddddddZdS )SerializerFunctionWrapHandlerNr
   zint | str | None)input_value	index_keyr;   c                C  s   d S r<   r5   )r>   r}   r~   r5   r5   r6   __call__4  rJ   z&SerializerFunctionWrapHandler.__call__)Nr0   r1   r2   r   r5   r5   r5   r6   r|   3  s   r|   c                   @  sF   e Zd ZU ded< ded< ded< ded< ded	< ded
< ded< dS )WrapSerializerFunctionSerSchema"Required[Literal['function-wrap']]rg   z Required[WrapSerializerFunction]rp   r#   rq   rr   rs   schemart   ru   rv   Nrh   r5   r5   r5   r6   r   G  s   
r   )rq   rr   r   rt   rv   WrapSerializerFunction)rp   rq   rr   r   rt   rv   r;   c             	   C  s"   |dkrd}t d| |||||dS )aE  
    Returns a schema for serialization with a wrap function, can be either a "general" or "field" function.

    Args:
        function: The function to use for serialization
        is_field_serializer: Whether the serializer is for a field, e.g. takes `model` as the first argument,
            and `info` includes `field_name`
        info_arg: Whether the function takes an `info` argument
        schema: The schema to use for the inner serialization
        return_schema: Schema to use for serializing return value
        when_used: When the function should be called
    rl   Nfunction-wrap)rg   rp   rq   rr   r   rt   rv   ry   )rp   rq   rr   r   rt   rv   r5   r5   r6   #wrap_serializer_function_ser_schemaQ  s    r   c                   @  s&   e Zd ZU ded< ded< ded< dS )FormatSerSchemazRequired[Literal['format']]rg   Required[str]formatting_stringru   rv   Nrh   r5   r5   r5   r6   r   t  s   
r   rm   )rv   r!   )r   rv   r;   c                C  s   |dkrd}t d| |dS )z
    Returns a schema for serialization using python's `format` method.

    Args:
        formatting_string: String defining the format to use
        when_used: Same meaning as for [general_function_plain_ser_schema], but with a different default
    rm   Nformat)rg   r   rv   ry   )r   rv   r5   r5   r6   format_ser_schemaz  s    r   c                   @  s   e Zd ZU ded< ded< dS )ToStringSerSchemazRequired[Literal['to-string']]rg   ru   rv   Nrh   r5   r5   r5   r6   r     s   
r   )rv   r;   c                 C  s   t dd}| dkr| |d< |S )z
    Returns a schema for serialization using python's `str()` / `__str__` method.

    Args:
        when_used: Same meaning as for [general_function_plain_ser_schema], but with a different default
    z	to-stringrj   rm   rv   )r`   )rv   sr5   r5   r6   to_string_ser_schema  s    
r   c                   @  s&   e Zd ZU ded< ded< ded< dS )ModelSerSchemaRequired[Literal['model']]rg   Required[Type[Any]]clsRequired[CoreSchema]r   Nrh   r5   r5   r5   r6   r     s   
r   	Type[Any]rs   )r   r   r;   c                 C  s   t d| |dS )z
    Returns a schema for serialization using a model.

    Args:
        cls: The expected class type, used to generate warnings if the wrong type is passed
        schema: Internal schema to use to serialize the model dict
    model)rg   r   r   )r   )r   r   r5   r5   r6   model_ser_schema  s    r   c                   @  s.   e Zd ZU ded< ded< ded< ded< d	S )
InvalidSchemazRequired[Literal['invalid']]rg   r!   refrT   metadata	SerSchemaserializationNrh   r5   r5   r5   r6   r     s   
r   rV   zDict[str, Any] | None)r   r   r;   c                 C  s   t d| |dS )a]  
    Returns an invalid schema, used to indicate that a schema is invalid.

        Returns a schema that matches any value, e.g.:

    Args:
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
    invalid)rg   r   r   ry   )r   r   r5   r5   r6   invalid_schema  s    r   c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )ComputedFieldz#Required[Literal['computed-field']]rg   r   property_namer   rt   r!   aliasrT   r   Nrh   r5   r5   r5   r6   r     s
   
r   )r   r   )r   rt   r   r   r;   c                C  s   t d| |||dS )a  
    ComputedFields are properties of a model or dataclass that are included in serialization.

    Args:
        property_name: The name of the property on the model or dataclass
        return_schema: The schema used for the type returned by the computed field
        alias: The name to use in the serialized output
        metadata: Any other information you want to include with the schema, not used by pydantic-core
    computed-field)rg   r   rt   r   r   ry   )r   rt   r   r   r5   r5   r6   computed_field  s        r   c                   @  s.   e Zd ZU ded< ded< ded< ded< d	S )
	AnySchemazRequired[Literal['any']]rg   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   r   r   r   zSerSchema | None)r   r   r   r;   c                 C  s   t d| ||dS )a  
    Returns a schema that matches any value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.any_schema()
    v = SchemaValidator(schema)
    assert v.validate_python(1) == 1
    ```

    Args:
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    re   rg   r   r   r   ry   r   r5   r5   r6   
any_schema  s    r   c                   @  s.   e Zd ZU ded< ded< ded< ded< d	S )

NoneSchemazRequired[Literal['none']]rg   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   c                 C  s   t d| ||dS )a  
    Returns a schema that matches a None value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.none_schema()
    v = SchemaValidator(schema)
    assert v.validate_python(None) is None
    ```

    Args:
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rW   r   ry   r   r5   r5   r6   none_schema
  s    r   c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )
BoolSchemazRequired[Literal['bool']]rg   r#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r      s
   
r   )r$   r   r   r   r;   c                 C  s   t d| |||dS )ae  
    Returns a schema that matches a bool value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.bool_schema()
    v = SchemaValidator(schema)
    assert v.validate_python('True') is True
    ```

    Args:
        strict: Whether the value should be a bool or a value that can be converted to a bool
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r#   rg   r$   r   r   r   ry   r$   r   r   r   r5   r5   r6   bool_schema(  s    r   c                   @  s^   e Zd ZU ded< ded< ded< ded< ded< ded< d	ed
< ded< ded< ded< dS )	IntSchemazRequired[Literal['int']]rg   r+   multiple_oflegeltgtr#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r   B  s   
r   	r   r   r   r   r   r$   r   r   r   z
int | None)
r   r   r   r   r   r$   r   r   r   r;   c        	   	      C  s   t d| ||||||||d
S )a  
    Returns a schema that matches a int value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.int_schema(multiple_of=2, le=6, ge=2)
    v = SchemaValidator(schema)
    assert v.validate_python('4') == 4
    ```

    Args:
        multiple_of: The value must be a multiple of this number
        le: The value must be less than or equal to this number
        ge: The value must be greater than or equal to this number
        lt: The value must be strictly less than this number
        gt: The value must be strictly greater than this number
        strict: Whether the value should be a int or a value that can be converted to a int
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r+   )
rg   r   r   r   r   r   r$   r   r   r   ry   r   r5   r5   r6   
int_schemaO  s    "r   c                   @  sf   e Zd ZU ded< ded< ded< ded< ded< ded	< ded
< ded< ded< ded< ded< dS )FloatSchemazRequired[Literal['float']]rg   r#   r,   rX   r   r   r   r   r   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   
r,   r   r   r   r   r   r$   r   r   r   zfloat | None)r,   r   r   r   r   r   r$   r   r   r   r;   c        
   
      C  s   t d| |||||||||	dS )a  
    Returns a schema that matches a float value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.float_schema(le=0.8, ge=0.2)
    v = SchemaValidator(schema)
    assert v.validate_python('0.5') == 0.5
    ```

    Args:
        allow_inf_nan: Whether to allow inf and nan values
        multiple_of: The value must be a multiple of this number
        le: The value must be less than or equal to this number
        ge: The value must be greater than or equal to this number
        lt: The value must be strictly less than this number
        gt: The value must be strictly greater than this number
        strict: Whether the value should be a float or a value that can be converted to a float
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rX   )rg   r,   r   r   r   r   r   r$   r   r   r   ry   r   r5   r5   r6   float_schema  s    $r   c                   @  sv   e Zd ZU ded< ded< ded< ded< ded< ded	< ded
< ded< ded< ded< ded< ded< ded< dS )DecimalSchemazRequired[Literal['decimal']]rg   r#   r,   r   r   r   r   r   r   r+   
max_digitsdecimal_placesr$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   r,   r   r   r   r   r   r   r   r$   r   r   r   zDecimal | None)r,   r   r   r   r   r   r   r   r$   r   r   r   r;   c                 C  s"   t d|||||||| ||	|
|dS )a  
    Returns a schema that matches a decimal value, e.g.:

    ```py
    from decimal import Decimal
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.decimal_schema(le=0.8, ge=0.2)
    v = SchemaValidator(schema)
    assert v.validate_python('0.5') == Decimal('0.5')
    ```

    Args:
        allow_inf_nan: Whether to allow inf and nan values
        multiple_of: The value must be a multiple of this number
        le: The value must be less than or equal to this number
        ge: The value must be greater than or equal to this number
        lt: The value must be strictly less than this number
        gt: The value must be strictly greater than this number
        max_digits: The maximum number of decimal digits allowed
        decimal_places: The maximum number of decimal places allowed
        strict: Whether the value should be a float or a value that can be converted to a float
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    decimal)rg   r   r   r   r   r   r   r   r,   r$   r   r   r   ry   r   r5   r5   r6   decimal_schema  s    )r   c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )ComplexSchemazRequired[Literal['complex']]rg   r#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r   
  s
   
r   r   c                 C  s   t d| |||dS )a  
    Returns a schema that matches a complex value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.complex_schema()
    v = SchemaValidator(schema)
    assert v.validate_python('1+2j') == complex(1, 2)
    assert v.validate_python(complex(1, 2)) == complex(1, 2)
    ```

    Args:
        strict: Whether the value should be a complex object instance or a value that can be converted to a complex object
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    complexr   ry   r   r5   r5   r6   complex_schema  s    r   c                   @  sv   e Zd ZU ded< ded< ded< ded< ded	< ded
< ded< ded< ded< ded< ded< ded< ded< dS )StringSchemazRequired[Literal['str']]rg   zUnion[str, Pattern[str]]patternr+   
max_length
min_lengthr#   strip_whitespaceto_lowerto_upperr.   r/   r$   r-   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r   4  s   
r   r   r   r   r   r   r   r/   r$   r-   r   r   r   zstr | Pattern[str] | Nonez+Literal[('rust-regex', 'python-re')] | None)r   r   r   r   r   r   r/   r$   r-   r   r   r   r;   c                 C  s"   t d| |||||||||	|
|dS )aC  
    Returns a schema that matches a string value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.str_schema(max_length=10, min_length=2)
    v = SchemaValidator(schema)
    assert v.validate_python('hello') == 'hello'
    ```

    Args:
        pattern: A regex pattern that the value must match
        max_length: The value must be at most this length
        min_length: The value must be at least this length
        strip_whitespace: Whether to strip whitespace from the value
        to_lower: Whether to convert the value to lowercase
        to_upper: Whether to convert the value to uppercase
        regex_engine: The regex engine to use for pattern validation. Default is 'rust-regex'.
            - `rust-regex` uses the [`regex`](https://docs.rs/regex) Rust
              crate, which is non-backtracking and therefore more DDoS
              resistant, but does not support all regex features.
            - `python-re` use the [`re`](https://docs.python.org/3/library/re.html) module,
              which supports all regex features, but may be slower.
        strict: Whether the value should be a string or a value that can be converted to a string
        coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r!   )rg   r   r   r   r   r   r   r/   r$   r-   r   r   r   ry   r   r5   r5   r6   
str_schemaD  s    -r   c                   @  sF   e Zd ZU ded< ded< ded< ded< ded	< d
ed< ded< dS )BytesSchemazRequired[Literal['bytes']]rg   r+   r   r   r#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   r   r   r$   r   r   r   )r   r   r$   r   r   r   r;   c              	   C  s   t d| |||||dS )a  
    Returns a schema that matches a bytes value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.bytes_schema(max_length=10, min_length=2)
    v = SchemaValidator(schema)
    assert v.validate_python(b'hello') == b'hello'
    ```

    Args:
        max_length: The value must be at most this length
        min_length: The value must be at least this length
        strict: Whether the value should be a bytes or a value that can be converted to a bytes
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rY   )rg   r   r   r$   r   r   r   ry   r   r5   r5   r6   bytes_schema  s    r   c                   @  sf   e Zd ZU ded< ded< ded< ded< ded< ded	< d
ed< ded< ded< ded< ded< dS )
DateSchemazRequired[Literal['date']]rg   r#   r$   r   r   r   r   r   Literal[('past', 'future')]now_opr+   now_utc_offsetr!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   
r$   r   r   r   r   r   r   r   r   r   zdate | Nonez"Literal[('past', 'future')] | None)r$   r   r   r   r   r   r   r   r   r   r;   c        
   
      C  s   t d| |||||||||	dS )a  
    Returns a schema that matches a date value, e.g.:

    ```py
    from datetime import date
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.date_schema(le=date(2020, 1, 1), ge=date(2019, 1, 1))
    v = SchemaValidator(schema)
    assert v.validate_python(date(2019, 6, 1)) == date(2019, 6, 1)
    ```

    Args:
        strict: Whether the value should be a date or a value that can be converted to a date
        le: The value must be less than or equal to this date
        ge: The value must be greater than or equal to this date
        lt: The value must be strictly less than this date
        gt: The value must be strictly greater than this date
        now_op: The value must be in the past or future relative to the current date
        now_utc_offset: The value must be in the past or future relative to the current date with this utc offset
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   )rg   r$   r   r   r   r   r   r   r   r   r   ry   r   r5   r5   r6   date_schema  s    %r   c                   @  sf   e Zd ZU ded< ded< ded< ded< ded< ded	< d
ed< ded< ded< ded< ded< dS )
TimeSchemazRequired[Literal['time']]rg   r#   r$   r   r   r   r   r   'Union[Literal[('aware', 'naive')], int]tz_constraintLiteral[('truncate', 'error')]microseconds_precisionr!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   truncate
r$   r   r   r   r   r   r   r   r   r   ztime | Nonez(Literal[('aware', 'naive')] | int | Noner   )r$   r   r   r   r   r   r   r   r   r   r;   c        
   
      C  s   t d| |||||||||	dS )a  
    Returns a schema that matches a time value, e.g.:

    ```py
    from datetime import time
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.time_schema(le=time(12, 0, 0), ge=time(6, 0, 0))
    v = SchemaValidator(schema)
    assert v.validate_python(time(9, 0, 0)) == time(9, 0, 0)
    ```

    Args:
        strict: Whether the value should be a time or a value that can be converted to a time
        le: The value must be less than or equal to this time
        ge: The value must be greater than or equal to this time
        lt: The value must be strictly less than this time
        gt: The value must be strictly greater than this time
        tz_constraint: The value must be timezone aware or naive, or an int to indicate required tz offset
        microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   )rg   r$   r   r   r   r   r   r   r   r   r   ry   r   r5   r5   r6   time_schema  s    %r   c                   @  sv   e Zd ZU ded< ded< ded< ded< ded< ded	< d
ed< ded< ded< ded< ded< ded< ded< dS )DatetimeSchemazRequired[Literal['datetime']]rg   r#   r$   r   r   r   r   r   r   r   r   r   r+   r   r   r   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r   9  s   
r   r$   r   r   r   r   r   r   r   r   r   r   r   zdatetime | None)r$   r   r   r   r   r   r   r   r   r   r   r   r;   c                 C  s"   t d| |||||||||	|
|dS )a  
    Returns a schema that matches a datetime value, e.g.:

    ```py
    from datetime import datetime
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.datetime_schema()
    v = SchemaValidator(schema)
    now = datetime.now()
    assert v.validate_python(str(now)) == now
    ```

    Args:
        strict: Whether the value should be a datetime or a value that can be converted to a datetime
        le: The value must be less than or equal to this datetime
        ge: The value must be greater than or equal to this datetime
        lt: The value must be strictly less than this datetime
        gt: The value must be strictly greater than this datetime
        now_op: The value must be in the past or future relative to the current datetime
        tz_constraint: The value must be timezone aware or naive, or an int to indicate required tz offset
            TODO: use of a tzinfo where offset changes based on the datetime is not yet supported
        now_utc_offset: The value must be in the past or future relative to the current datetime with this utc offset
        microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   )rg   r$   r   r   r   r   r   r   r   r   r   r   r   ry   r   r5   r5   r6   datetime_schemaK  s    +r   c                   @  s^   e Zd ZU ded< ded< ded< ded< ded< ded	< d
ed< ded< ded< ded< dS )TimedeltaSchemazRequired[Literal['timedelta']]rg   r#   r$   r   r   r   r   r   r   r   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   	r$   r   r   r   r   r   r   r   r   ztimedelta | None)
r$   r   r   r   r   r   r   r   r   r;   c        	   	      C  s   t d| ||||||||d
S )a]  
    Returns a schema that matches a timedelta value, e.g.:

    ```py
    from datetime import timedelta
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.timedelta_schema(le=timedelta(days=1), ge=timedelta(days=0))
    v = SchemaValidator(schema)
    assert v.validate_python(timedelta(hours=12)) == timedelta(hours=12)
    ```

    Args:
        strict: Whether the value should be a timedelta or a value that can be converted to a timedelta
        le: The value must be less than or equal to this timedelta
        ge: The value must be greater than or equal to this timedelta
        lt: The value must be strictly less than this timedelta
        gt: The value must be strictly greater than this timedelta
        microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   )
rg   r$   r   r   r   r   r   r   r   r   ry   r   r5   r5   r6   timedelta_schema  s    #r   c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )LiteralSchemazRequired[Literal['literal']]rg   Required[List[Any]]expectedr!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s
   
r   z	list[Any])r   r   r   r   r;   c                C  s   t d| |||dS )a[  
    Returns a schema that matches a literal value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.literal_schema(['hello', 'world'])
    v = SchemaValidator(schema)
    assert v.validate_python('hello') == 'hello'
    ```

    Args:
        expected: The value must be one of these values
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    literal)rg   r   r   r   r   ry   )r   r   r   r   r5   r5   r6   literal_schema  s    r   c                   @  sV   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< ded< ded< dS )
EnumSchemazRequired[Literal['enum']]rg   Required[Any]r   r   membersz Literal[('str', 'int', 'float')]sub_typezCallable[[Any], Any]missingr#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   )r   r   r$   r   r   r   r
   z'Literal[('str', 'int', 'float')] | NonezCallable[[Any], Any] | None)	r   r   r   r   r$   r   r   r   r;   c                C  s   t d| |||||||d	S )a  
    Returns a schema that matches an enum value, e.g.:

    ```py
    from enum import Enum
    from pydantic_core import SchemaValidator, core_schema

    class Color(Enum):
        RED = 1
        GREEN = 2
        BLUE = 3

    schema = core_schema.enum_schema(Color, list(Color.__members__.values()))
    v = SchemaValidator(schema)
    assert v.validate_python(2) is Color.GREEN
    ```

    Args:
        cls: The enum class
        members: The members of the enum, generally `list(MyEnum.__members__.values())`
        sub_type: The type of the enum, either 'str' or 'int' or None for plain enums
        missing: A function to use when the value is not found in the enum, from `_missing_`
        strict: Whether to use strict mode, defaults to False
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    enum)	rg   r   r   r   r   r$   r   r   r   ry   )r   r   r   r   r$   r   r   r   r5   r5   r6   enum_schema  s    &r   )Znullr#   r+   rX   r!   r[   r`   c                   @  s>   e Zd ZU ded< ded< ded< ded< ded	< d
ed< dS )IsInstanceSchemaz Required[Literal['is-instance']]rg   r   r   r!   cls_reprr   rT   r   r   r   Nrh   r5   r5   r5   r6   r   +  s   
r   )r   r   r   r   )r   r   r   r   r   r;   c                C  s   t d| ||||dS )a  
    Returns a schema that checks if a value is an instance of a class, equivalent to python's `isinstance` method, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    class A:
        pass

    schema = core_schema.is_instance_schema(cls=A)
    v = SchemaValidator(schema)
    v.validate_python(A())
    ```

    Args:
        cls: The value must be an instance of this class
        cls_repr: If provided this string is used in the validator name instead of `repr(cls)`
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    is-instancerg   r   r   r   r   r   ry   r   r   r   r   r   r5   r5   r6   is_instance_schema4  s         r   c                   @  s>   e Zd ZU ded< ded< ded< ded< ded	< d
ed< dS )IsSubclassSchemaz Required[Literal['is-subclass']]rg   r   r   r!   r   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r   V  s   
r   c                C  s   t d| ||||dS )a  
    Returns a schema that checks if a value is a subtype of a class, equivalent to python's `issubclass` method, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    class A:
        pass

    class B(A):
        pass

    schema = core_schema.is_subclass_schema(cls=A)
    v = SchemaValidator(schema)
    v.validate_python(B)
    ```

    Args:
        cls: The value must be a subclass of this class
        cls_repr: If provided this string is used in the validator name instead of `repr(cls)`
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    is-subclassr   ry   r   r5   r5   r6   is_subclass_schema_  s          r   c                   @  s.   e Zd ZU ded< ded< ded< ded< d	S )
CallableSchemazRequired[Literal['callable']]rg   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   c                 C  s   t d| ||dS )a,  
    Returns a schema that checks if a value is callable, equivalent to python's `callable` method, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.callable_schema()
    v = SchemaValidator(schema)
    v.validate_python(min)
    ```

    Args:
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    callabler   ry   r   r5   r5   r6   callable_schema  s    r   c                   @  s>   e Zd ZU ded< ded< ded< ded< d	ed
< ded< dS )
UuidSchemazRequired[Literal['uuid']]rg   zLiteral[(1, 3, 4, 5)]versionr#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r     s   
r   r   r$   r   r   r   zLiteral[(1, 3, 4, 5)] | None)r   r$   r   r   r   r;   c                 C  s   t d| ||||dS )Nrd   )rg   r   r$   r   r   r   ry   r   r5   r5   r6   uuid_schema  s         r   c                   @  s&   e Zd ZU ded< ded< ded< dS )IncExSeqSerSchemaz-Required[Literal['include-exclude-sequence']]rg   zSet[int]r?   r@   Nrh   r5   r5   r5   r6   r     s   
r   r?   r@   zSet[int] | None)r?   r@   r;   c                 C  s   t d| |dS )Nzinclude-exclude-sequencerg   r?   r@   ry   r   r5   r5   r6   filter_seq_schema  s    r   c                   @  sV   e Zd ZU ded< ded< ded< ded< ded	< ded
< ded< ded< ded< dS )
ListSchemazRequired[Literal['list']]rg   rs   items_schemar+   r   r   r#   	fail_fastr$   r!   r   rT   r   IncExSeqOrElseSerSchemar   Nrh   r5   r5   r5   r6   r    s   
r  )r   r   r  r$   r   r   r   zIncExSeqOrElseSerSchema | None)	r  r   r   r  r$   r   r   r   r;   c                C  s   t d| |||||||d	S )a  
    Returns a schema that matches a list value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.list_schema(core_schema.int_schema(), min_length=0, max_length=10)
    v = SchemaValidator(schema)
    assert v.validate_python(['4']) == [4]
    ```

    Args:
        items_schema: The value must be a list of items that match this schema
        min_length: The value must be a list with at least this many items
        max_length: The value must be a list with at most this many items
        fail_fast: Stop validation on the first error
        strict: The value must be a list with exactly this many items
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r[   	rg   r  r   r   r  r$   r   r   r   ry   r  r   r   r  r$   r   r   r   r5   r5   r6   list_schema  s     r  )extras_schemar$   r   r   r   zlist[CoreSchema]TupleSchema)r  r  r$   r   r   r   r;   c                C  s4   |dk	rt | }| |g } nd}t| |||||dS )a  
    Returns a schema that matches a tuple of schemas, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.tuple_positional_schema(
        [core_schema.int_schema(), core_schema.str_schema()]
    )
    v = SchemaValidator(schema)
    assert v.validate_python((1, 'hello')) == (1, 'hello')
    ```

    Args:
        items_schema: The value must be a tuple with items that match these schemas
        extras_schema: The value must be a tuple with items that match this schema
            This was inspired by JSON schema's `prefixItems` and `items` fields.
            In python's `typing.Tuple`, you can't specify a type for "extra" items -- they must all be the same type
            if the length is variable. So this field won't be set from a `typing.Tuple` annotation on a pydantic model.
        strict: The value must be a tuple with exactly this many items
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    N)r  variadic_item_indexr$   r   r   r   )lentuple_schema)r  r  r$   r   r   r   r
  r5   r5   r6   tuple_positional_schema  s    !r  )r   r   r$   r   r   r   )r  r   r   r$   r   r   r   r;   c             
   C  s    t | p
t gd||||||dS )a  
    Returns a schema that matches a tuple of a given schema, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.tuple_variable_schema(
        items_schema=core_schema.int_schema(), min_length=0, max_length=10
    )
    v = SchemaValidator(schema)
    assert v.validate_python(('1', 2, 3)) == (1, 2, 3)
    ```

    Args:
        items_schema: The value must be a tuple with items that match this schema
        min_length: The value must be a tuple with at least this many items
        max_length: The value must be a tuple with at most this many items
        strict: The value must be a tuple with exactly this many items
        ref: Optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   )r  r
  r   r   r$   r   r   r   )r  r   )r  r   r   r$   r   r   r   r5   r5   r6   tuple_variable_schema/  s     
r  c                   @  s^   e Zd ZU ded< ded< ded< ded< ded< d	ed
< d	ed< ded< ded< ded< dS )r	  zRequired[Literal['tuple']]rg   Required[List[CoreSchema]]r  r+   r
  r   r   r#   r  r$   r!   r   rT   r   r  r   Nrh   r5   r5   r5   r6   r	  [  s   
)r
  r   r   r  r$   r   r   r   )
r  r
  r   r   r  r$   r   r   r   r;   c          	      C  s   t d| ||||||||d
S )a  
    Returns a schema that matches a tuple of schemas, with an optional variadic item, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.tuple_schema(
        [core_schema.int_schema(), core_schema.str_schema(), core_schema.float_schema()],
        variadic_item_index=1,
    )
    v = SchemaValidator(schema)
    assert v.validate_python((1, 'hello', 'world', 1.5)) == (1, 'hello', 'world', 1.5)
    ```

    Args:
        items_schema: The value must be a tuple with items that match these schemas
        variadic_item_index: The index of the schema in `items_schema` to be treated as variadic (following PEP 646)
        min_length: The value must be a tuple with at least this many items
        max_length: The value must be a tuple with at most this many items
        fail_fast: Stop validation on the first error
        strict: The value must be a tuple with exactly this many items
        ref: Optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r\   )
rg   r  r
  r   r   r  r$   r   r   r   ry   )	r  r
  r   r   r  r$   r   r   r   r5   r5   r6   r  h  s    %r  c                   @  sV   e Zd ZU ded< ded< ded< ded< ded	< ded
< ded< ded< ded< dS )	SetSchemazRequired[Literal['set']]rg   rs   r  r+   r   r   r#   r  r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r    s   
r  c                C  s   t d| |||||||d	S )a  
    Returns a schema that matches a set of a given schema, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.set_schema(
        items_schema=core_schema.int_schema(), min_length=0, max_length=10
    )
    v = SchemaValidator(schema)
    assert v.validate_python({1, '2', 3}) == {1, 2, 3}
    ```

    Args:
        items_schema: The value must be a set with items that match this schema
        min_length: The value must be a set with at least this many items
        max_length: The value must be a set with at most this many items
        fail_fast: Stop validation on the first error
        strict: The value must be a set with exactly this many items
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r]   r  ry   r  r5   r5   r6   
set_schema  s    "r  c                   @  sV   e Zd ZU ded< ded< ded< ded< ded	< ded
< ded< ded< ded< dS )FrozenSetSchemazRequired[Literal['frozenset']]rg   rs   r  r+   r   r   r#   r  r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r    s   
r  c                C  s   t d| |||||||d	S )a   
    Returns a schema that matches a frozenset of a given schema, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.frozenset_schema(
        items_schema=core_schema.int_schema(), min_length=0, max_length=10
    )
    v = SchemaValidator(schema)
    assert v.validate_python(frozenset(range(3))) == frozenset({0, 1, 2})
    ```

    Args:
        items_schema: The value must be a frozenset with items that match this schema
        min_length: The value must be a frozenset with at least this many items
        max_length: The value must be a frozenset with at most this many items
        fail_fast: Stop validation on the first error
        strict: The value must be a frozenset with exactly this many items
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r^   r  ry   r  r5   r5   r6   frozenset_schema  s    "r  c                   @  sF   e Zd ZU ded< ded< ded< ded< ded	< d
ed< ded< dS )GeneratorSchemazRequired[Literal['generator']]rg   rs   r  r+   r   r   r!   r   rT   r   r  r   Nrh   r5   r5   r5   r6   r    s   
r  )r   r   r   r   r   )r  r   r   r   r   r   r;   c             	   C  s   t d| |||||dS )a  
    Returns a schema that matches a generator value, e.g.:

    ```py
    from typing import Iterator
    from pydantic_core import SchemaValidator, core_schema

    def gen() -> Iterator[int]:
        yield 1

    schema = core_schema.generator_schema(items_schema=core_schema.int_schema())
    v = SchemaValidator(schema)
    v.validate_python(gen())
    ```

    Unlike other types, validated generators do not raise ValidationErrors eagerly,
    but instead will raise a ValidationError when a violating value is actually read from the generator.
    This is to ensure that "validated" generators retain the benefit of lazy evaluation.

    Args:
        items_schema: The value must be a generator with items that match this schema
        min_length: The value must be a generator that yields at least this many items
        max_length: The value must be a generator that yields at most this many items
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r_   )rg   r  r   r   r   r   r   ry   )r  r   r   r   r   r   r5   r5   r6   generator_schema  s    $r  c                   @  s&   e Zd ZU ded< ded< ded< dS )IncExDictSerSchemaz)Required[Literal['include-exclude-dict']]rg   	IncExDictr?   r@   Nrh   r5   r5   r5   r6   r  M  s   
r  zIncExDict | Nonec                 C  s   t d| |dS )Nzinclude-exclude-dictr   ry   r   r5   r5   r6   filter_dict_schemaS  s    r  c                   @  sV   e Zd ZU ded< ded< ded< ded< ded< d	ed
< ded< ded< ded< dS )
DictSchemazRequired[Literal['dict']]rg   rs   keys_schemavalues_schemar+   r   r   r#   r$   r!   r   rT   r   IncExDictOrElseSerSchemar   Nrh   r5   r5   r5   r6   r  Z  s   
r  )	r  r  r   r   r$   r   r   r   r;   c                C  s   t d| |||||||d	S )a  
    Returns a schema that matches a dict value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.dict_schema(
        keys_schema=core_schema.str_schema(), values_schema=core_schema.int_schema()
    )
    v = SchemaValidator(schema)
    assert v.validate_python({'a': '1', 'b': 2}) == {'a': 1, 'b': 2}
    ```

    Args:
        keys_schema: The value must be a dict with keys that match this schema
        values_schema: The value must be a dict with values that match this schema
        min_length: The value must be a dict with at least this many items
        max_length: The value must be a dict with at most this many items
        strict: Whether the keys and values should be validated with strict mode
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r`   )	rg   r  r  r   r   r$   r   r   r   ry   )r  r  r   r   r$   r   r   r   r5   r5   r6   dict_schemaf  s    "r  c                   @  s   e Zd ZU ded< ded< dS )NoInfoValidatorFunctionSchemaLiteral['no-info']rg   NoInfoValidatorFunctionrp   Nrh   r5   r5   r5   r6   r    s   
r  c                   @  s&   e Zd ZU ded< ded< ded< dS )WithInfoValidatorFunctionSchemaRequired[Literal['with-info']]rg   z#Required[WithInfoValidatorFunction]rp   r!   rP   Nrh   r5   r5   r5   r6   r!    s   
r!  c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )_ValidatorFunctionSchemaRequired[ValidationFunction]rp   r   r   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r#    s
   
r#  c                   @  s   e Zd ZU ded< ded< dS )BeforeValidatorFunctionSchemaz$Required[Literal['function-before']]rg   rs   json_schema_input_schemaNrh   r5   r5   r5   r6   r%    s   
r%  )r   r&  r   r   r   )rp   r   r   r&  r   r   r;   c             	   C  s   t dd| d|||||dS )a=  
    Returns a schema that calls a validator function before validating, no `info` argument is provided, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: bytes) -> str:
        return v.decode() + 'world'

    func_schema = core_schema.no_info_before_validator_function(
        function=fn, schema=core_schema.str_schema()
    )
    schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})

    v = SchemaValidator(schema)
    assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
    ```

    Args:
        function: The validator function to call
        schema: The schema to validate the output of the validator function
        ref: optional unique identifier of the schema, used to reference the schema in other places
        json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    function-beforeno-inforg   rp   rg   rp   r   r   r&  r   r   ry   rp   r   r   r&  r   r   r5   r5   r6   !no_info_before_validator_function  s    #r,  )rP   r   r&  r   r   WithInfoValidatorFunction)rp   r   rP   r   r&  r   r   r;   c             	   C  s    t dt d| |d|||||dS )a  
    Returns a schema that calls a validator function before validation, the function is called with
    an `info` argument, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: bytes, info: core_schema.ValidationInfo) -> str:
        assert info.data is not None
        assert info.field_name is not None
        return v.decode() + 'world'

    func_schema = core_schema.with_info_before_validator_function(
        function=fn, schema=core_schema.str_schema(), field_name='a'
    )
    schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})

    v = SchemaValidator(schema)
    assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
    ```

    Args:
        function: The validator function to call
        field_name: The name of the field
        schema: The schema to validate the output of the validator function
        ref: optional unique identifier of the schema, used to reference the schema in other places
        json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r'  	with-inforg   rp   rP   r*  ry   )rp   r   rP   r   r&  r   r   r5   r5   r6   #with_info_before_validator_function  s    (r0  c                   @  s   e Zd ZU ded< dS )AfterValidatorFunctionSchemaz#Required[Literal['function-after']]rg   Nrh   r5   r5   r5   r6   r1    s   
r1  c             	   C  s   t dd| d|||||dS )a)  
    Returns a schema that calls a validator function after validating, no `info` argument is provided, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: str) -> str:
        return v + 'world'

    func_schema = core_schema.no_info_after_validator_function(fn, core_schema.str_schema())
    schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})

    v = SchemaValidator(schema)
    assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
    ```

    Args:
        function: The validator function to call after the schema is validated
        schema: The schema to validate before the validator function
        ref: optional unique identifier of the schema, used to reference the schema in other places
        json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    function-afterr(  r)  r*  ry   r+  r5   r5   r6    no_info_after_validator_function  s    !r3  )rP   r   r   r   )rp   r   rP   r   r   r   r;   c                C  s   t dt d| |d||||dS )a  
    Returns a schema that calls a validator function after validation, the function is called with
    an `info` argument, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: str, info: core_schema.ValidationInfo) -> str:
        assert info.data is not None
        assert info.field_name is not None
        return v + 'world'

    func_schema = core_schema.with_info_after_validator_function(
        function=fn, schema=core_schema.str_schema(), field_name='a'
    )
    schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})

    v = SchemaValidator(schema)
    assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
    ```

    Args:
        function: The validator function to call after the schema is validated
        schema: The schema to validate before the validator function
        field_name: The name of the field this validators is applied to, if any
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r2  r.  r/  )rg   rp   r   r   r   r   ry   )rp   r   rP   r   r   r   r5   r5   r6   "with_info_after_validator_functionI  s    &r4  c                   @  s    e Zd ZdddddddZdS )ValidatorFunctionWrapHandlerNr
   zstr | int | None)r}   outer_locationr;   c                C  s   d S r<   r5   )r>   r}   r6  r5   r5   r6   r   z  s    z%ValidatorFunctionWrapHandler.__call__)Nr   r5   r5   r5   r6   r5  y  s   r5  c                   @  s   e Zd ZU ded< ded< dS )!NoInfoWrapValidatorFunctionSchemar  rg   NoInfoWrapValidatorFunctionrp   Nrh   r5   r5   r5   r6   r7    s   
r7  c                   @  s&   e Zd ZU ded< ded< ded< dS )#WithInfoWrapValidatorFunctionSchemar"  rg   z'Required[WithInfoWrapValidatorFunction]rp   r!   rP   Nrh   r5   r5   r5   r6   r9    s   
r9  c                   @  sF   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< dS )WrapValidatorFunctionSchemar   rg   zRequired[WrapValidatorFunction]rp   r   r   r!   r   rs   r&  rT   r   r   r   Nrh   r5   r5   r5   r6   r:    s   
r:  r8  c             	   C  s   t dd| d|||||dS )a  
    Returns a schema which calls a function with a `validator` callable argument which can
    optionally be used to call inner validation with the function logic, this is much like the
    "onion" implementation of middleware in many popular web frameworks, no `info` argument is passed, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(
        v: str,
        validator: core_schema.ValidatorFunctionWrapHandler,
    ) -> str:
        return validator(input_value=v) + 'world'

    schema = core_schema.no_info_wrap_validator_function(
        function=fn, schema=core_schema.str_schema()
    )
    v = SchemaValidator(schema)
    assert v.validate_python('hello ') == 'hello world'
    ```

    Args:
        function: The validator function to call
        schema: The schema to validate the output of the validator function
        ref: optional unique identifier of the schema, used to reference the schema in other places
        json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   r(  r)  rg   rp   r   r&  r   r   r   ry   r+  r5   r5   r6   no_info_wrap_validator_function  s    &r<  )rP   r&  r   r   r   WithInfoWrapValidatorFunction)rp   r   rP   r&  r   r   r   r;   c             	   C  s    t dt d| |d|||||dS )a[  
    Returns a schema which calls a function with a `validator` callable argument which can
    optionally be used to call inner validation with the function logic, this is much like the
    "onion" implementation of middleware in many popular web frameworks, an `info` argument is also passed, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(
        v: str,
        validator: core_schema.ValidatorFunctionWrapHandler,
        info: core_schema.ValidationInfo,
    ) -> str:
        return validator(input_value=v) + 'world'

    schema = core_schema.with_info_wrap_validator_function(
        function=fn, schema=core_schema.str_schema()
    )
    v = SchemaValidator(schema)
    assert v.validate_python('hello ') == 'hello world'
    ```

    Args:
        function: The validator function to call
        schema: The schema to validate the output of the validator function
        field_name: The name of the field this validators is applied to, if any
        json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   r.  r/  r;  ry   )rp   r   rP   r&  r   r   r   r5   r5   r6   !with_info_wrap_validator_function  s    )r>  c                   @  s>   e Zd ZU ded< ded< ded< ded< d	ed
< ded< dS )PlainValidatorFunctionSchemaro   rg   r$  rp   r!   r   rs   r&  rT   r   r   r   Nrh   r5   r5   r5   r6   r?  	  s   
r?  )rp   r   r&  r   r   r;   c                C  s   t dd| d||||dS )a[  
    Returns a schema that uses the provided function for validation, no `info` argument is passed, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: str) -> str:
        assert 'hello' in v
        return v + 'world'

    schema = core_schema.no_info_plain_validator_function(function=fn)
    v = SchemaValidator(schema)
    assert v.validate_python('hello ') == 'hello world'
    ```

    Args:
        function: The validator function to call
        ref: optional unique identifier of the schema, used to reference the schema in other places
        json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rx   r(  r)  rg   rp   r   r&  r   r   ry   )rp   r   r&  r   r   r5   r5   r6    no_info_plain_validator_function	  s    rA  )rp   rP   r   r&  r   r   r;   c                C  s   t dt d| |d||||dS )a  
    Returns a schema that uses the provided function for validation, an `info` argument is passed, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: str, info: core_schema.ValidationInfo) -> str:
        assert 'hello' in v
        return v + 'world'

    schema = core_schema.with_info_plain_validator_function(function=fn)
    v = SchemaValidator(schema)
    assert v.validate_python('hello ') == 'hello world'
    ```

    Args:
        function: The validator function to call
        field_name: The name of the field this validators is applied to, if any
        ref: optional unique identifier of the schema, used to reference the schema in other places
        json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rx   r.  r/  r@  ry   )rp   rP   r   r&  r   r   r5   r5   r6   "with_info_plain_validator_function4	  s     rB  c                   @  sf   e Zd ZU ded< ded< ded< ded< d	ed
< ded< d	ed< d	ed< ded< ded< ded< dS )WithDefaultSchemazRequired[Literal['default']]rg   r   r   r
   defaultz9Union[Callable[[], Any], Callable[[Dict[str, Any]], Any]]default_factoryr#   default_factory_takes_dataz%Literal[('raise', 'omit', 'default')]on_errorr)   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   rC  ^	  s   
rC  )	rD  rE  rF  rG  r)   r$   r   r   r   z?Union[Callable[[], Any], Callable[[Dict[str, Any]], Any], None]z,Literal[('raise', 'omit', 'default')] | None)r   rD  rE  rF  rG  r)   r$   r   r   r   r;   c       	         C  s0   t d| ||||||||	d
}
|tk	r,||
d< |
S )a  
    Returns a schema that adds a default value to the given schema, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.with_default_schema(core_schema.str_schema(), default='hello')
    wrapper_schema = core_schema.typed_dict_schema(
        {'a': core_schema.typed_dict_field(schema)}
    )
    v = SchemaValidator(wrapper_schema)
    assert v.validate_python({}) == v.validate_python({'a': 'hello'})
    ```

    Args:
        schema: The schema to add a default value to
        default: The default value to use
        default_factory: A callable that returns the default value to use
        default_factory_takes_data: Whether the default factory takes a validated data argument
        on_error: What to do if the schema validation fails. One of 'raise', 'omit', 'default'
        validate_default: Whether the default value should be validated
        strict: Whether the underlying schema should be validated with strict mode
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rD  )
rg   r   rE  rF  rG  r)   r$   r   r   r   )rz   r   )r   rD  rE  rF  rG  r)   r$   r   r   r   r   r5   r5   r6   with_default_schemal	  s    'rH  c                   @  s>   e Zd ZU ded< ded< ded< ded< d	ed
< ded< dS )NullableSchemazRequired[Literal['nullable']]rg   r   r   r#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   rI  	  s   
rI  )r   r$   r   r   r   r;   c                C  s   t d| ||||dS )a  
    Returns a schema that matches a nullable value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.nullable_schema(core_schema.str_schema())
    v = SchemaValidator(schema)
    assert v.validate_python(None) is None
    ```

    Args:
        schema: The schema to wrap
        strict: Whether the underlying schema should be validated with strict mode
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    nullable)rg   r   r$   r   r   r   ry   )r   r$   r   r   r   r5   r5   r6   nullable_schema	  s         rK  c                   @  sf   e Zd ZU ded< ded< ded< ded< ded	< d
ed< ded< ded< ded< ded< ded< dS )UnionSchemazRequired[Literal['union']]rg   z9Required[List[Union[CoreSchema, Tuple[CoreSchema, str]]]]choicesr#   auto_collapser!   custom_error_typecustom_error_message!Dict[str, Union[str, int, float]]custom_error_contextz#Literal[('smart', 'left_to_right')]rC   r$   r   rT   r   r   r   Nrh   r5   r5   r5   r6   rL  	  s   
rL  )	rN  rO  rP  rR  rC   r$   r   r   r   z)list[CoreSchema | tuple[CoreSchema, str]]zdict[str, str | int] | Nonez*Literal[('smart', 'left_to_right')] | None)rM  rN  rO  rP  rR  rC   r$   r   r   r   r;   c       	   
      C  s   t d| |||||||||	dS )a  
    Returns a schema that matches a union value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.union_schema([core_schema.str_schema(), core_schema.int_schema()])
    v = SchemaValidator(schema)
    assert v.validate_python('hello') == 'hello'
    assert v.validate_python(1) == 1
    ```

    Args:
        choices: The schemas to match. If a tuple, the second item is used as the label for the case.
        auto_collapse: whether to automatically collapse unions with one element to the inner validator, default true
        custom_error_type: The custom error type to use if the validation fails
        custom_error_message: The custom error message to use if the validation fails
        custom_error_context: The custom error context to use if the validation fails
        mode: How to select which choice to return
            * `smart` (default) will try to return the choice which is the closest match to the input value
            * `left_to_right` will return the first choice in `choices` which succeeds validation
        strict: Whether the underlying schemas should be validated with strict mode
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    union)rg   rM  rN  rO  rP  rR  rC   r$   r   r   r   ry   )
rM  rN  rO  rP  rR  rC   r$   r   r   r   r5   r5   r6   union_schema	  s    'rT  c                   @  sf   e Zd ZU ded< ded< ded< ded< ded	< d
ed< ded< ded< ded< ded< ded< dS )TaggedUnionSchemaz!Required[Literal['tagged-union']]rg   z$Required[Dict[Hashable, CoreSchema]]rM  zcRequired[Union[str, List[Union[str, int]], List[List[Union[str, int]]], Callable[[Any], Hashable]]]discriminatorr!   rO  rP  rQ  rR  r#   r$   r&   r   rT   r   r   r   Nrh   r5   r5   r5   r6   rU  
  s   
rU  )rO  rP  rR  r$   r&   r   r   r   zDict[Any, CoreSchema]zDstr | list[str | int] | list[list[str | int]] | Callable[[Any], Any]z#dict[str, int | str | float] | None)rM  rV  rO  rP  rR  r$   r&   r   r   r   r;   c          
      C  s   t d| |||||||||	dS )a
  
    Returns a schema that matches a tagged union value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    apple_schema = core_schema.typed_dict_schema(
        {
            'foo': core_schema.typed_dict_field(core_schema.str_schema()),
            'bar': core_schema.typed_dict_field(core_schema.int_schema()),
        }
    )
    banana_schema = core_schema.typed_dict_schema(
        {
            'foo': core_schema.typed_dict_field(core_schema.str_schema()),
            'spam': core_schema.typed_dict_field(
                core_schema.list_schema(items_schema=core_schema.int_schema())
            ),
        }
    )
    schema = core_schema.tagged_union_schema(
        choices={
            'apple': apple_schema,
            'banana': banana_schema,
        },
        discriminator='foo',
    )
    v = SchemaValidator(schema)
    assert v.validate_python({'foo': 'apple', 'bar': '123'}) == {'foo': 'apple', 'bar': 123}
    assert v.validate_python({'foo': 'banana', 'spam': [1, 2, 3]}) == {
        'foo': 'banana',
        'spam': [1, 2, 3],
    }
    ```

    Args:
        choices: The schemas to match
            When retrieving a schema from `choices` using the discriminator value, if the value is a str,
            it should be fed back into the `choices` map until a schema is obtained
            (This approach is to prevent multiple ownership of a single schema in Rust)
        discriminator: The discriminator to use to determine the schema to use
            * If `discriminator` is a str, it is the name of the attribute to use as the discriminator
            * If `discriminator` is a list of int/str, it should be used as a "path" to access the discriminator
            * If `discriminator` is a list of lists, each inner list is a path, and the first path that exists is used
            * If `discriminator` is a callable, it should return the discriminator when called on the value to validate;
              the callable can return `None` to indicate that there is no matching discriminator present on the input
        custom_error_type: The custom error type to use if the validation fails
        custom_error_message: The custom error message to use if the validation fails
        custom_error_context: The custom error context to use if the validation fails
        strict: Whether the underlying schemas should be validated with strict mode
        from_attributes: Whether to use the attributes of the object to retrieve the discriminator value
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    tagged-union)rg   rM  rV  rO  rP  rR  r$   r&   r   r   r   ry   )
rM  rV  rO  rP  rR  r$   r&   r   r   r   r5   r5   r6   tagged_union_schema
  s    DrX  c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )ChainSchemazRequired[Literal['chain']]rg   r  stepsr!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   rY  r
  s
   
rY  )rZ  r   r   r   r;   c                C  s   t d| |||dS )a_  
    Returns a schema that chains the provided validation schemas, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: str, info: core_schema.ValidationInfo) -> str:
        assert 'hello' in v
        return v + ' world'

    fn_schema = core_schema.with_info_plain_validator_function(function=fn)
    schema = core_schema.chain_schema(
        [fn_schema, fn_schema, fn_schema, core_schema.str_schema()]
    )
    v = SchemaValidator(schema)
    assert v.validate_python('hello') == 'hello world world world'
    ```

    Args:
        steps: The schemas to chain
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    chain)rg   rZ  r   r   r   ry   )rZ  r   r   r   r5   r5   r6   chain_schemaz
  s    r\  c                   @  sF   e Zd ZU ded< ded< ded< ded< ded	< d
ed< ded< dS )LaxOrStrictSchemaz"Required[Literal['lax-or-strict']]rg   r   
lax_schemastrict_schemar#   r$   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r]  
  s   
r]  )r^  r_  r$   r   r   r   r;   c             	   C  s   t d| |||||dS )a  
    Returns a schema that uses the lax or strict schema, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    def fn(v: str, info: core_schema.ValidationInfo) -> str:
        assert 'hello' in v
        return v + ' world'

    lax_schema = core_schema.int_schema(strict=False)
    strict_schema = core_schema.int_schema(strict=True)

    schema = core_schema.lax_or_strict_schema(
        lax_schema=lax_schema, strict_schema=strict_schema, strict=True
    )
    v = SchemaValidator(schema)
    assert v.validate_python(123) == 123

    schema = core_schema.lax_or_strict_schema(
        lax_schema=lax_schema, strict_schema=strict_schema, strict=False
    )
    v = SchemaValidator(schema)
    assert v.validate_python('123') == 123
    ```

    Args:
        lax_schema: The lax schema to use
        strict_schema: The strict schema to use
        strict: Whether the strict schema should be used
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    lax-or-strict)rg   r^  r_  r$   r   r   r   ry   )r^  r_  r$   r   r   r   r5   r5   r6   lax_or_strict_schema
  s    +ra  c                   @  s>   e Zd ZU ded< ded< ded< ded< ded	< d
ed< dS )JsonOrPythonSchemaz#Required[Literal['json-or-python']]rg   r   json_schemapython_schemar!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   rb  
  s   
rb  )rc  rd  r   r   r   r;   c                C  s   t d| ||||dS )a  
    Returns a schema that uses the Json or Python schema depending on the input:

    ```py
    from pydantic_core import SchemaValidator, ValidationError, core_schema

    v = SchemaValidator(
        core_schema.json_or_python_schema(
            json_schema=core_schema.int_schema(),
            python_schema=core_schema.int_schema(strict=True),
        )
    )

    assert v.validate_json('"123"') == 123

    try:
        v.validate_python('123')
    except ValidationError:
        pass
    else:
        raise AssertionError('Validation should have failed')
    ```

    Args:
        json_schema: The schema to use for Json inputs
        python_schema: The schema to use for Python inputs
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    json-or-python)rg   rc  rd  r   r   r   ry   )rc  rd  r   r   r   r5   r5   r6   json_or_python_schema
  s    &rf  c                   @  sF   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< dS )TypedDictFieldz%Required[Literal['typed-dict-field']]rg   r   r   r#   required>Union[str, List[Union[str, int]], List[List[Union[str, int]]]]validation_aliasr!   serialization_aliasserialization_excluderT   r   Nrh   r5   r5   r5   r6   rg    s   
rg  )rh  rj  rk  rl  r   z4str | list[str | int] | list[list[str | int]] | None)r   rh  rj  rk  rl  r   r;   c             	   C  s   t d| |||||dS )a  
    Returns a schema that matches a typed dict field, e.g.:

    ```py
    from pydantic_core import core_schema

    field = core_schema.typed_dict_field(schema=core_schema.int_schema(), required=True)
    ```

    Args:
        schema: The schema to use for the field
        required: Whether the field is required, otherwise uses the value from `total` on the typed dict
        validation_alias: The alias(es) to use to find the field in the validation data
        serialization_alias: The alias to use as a key when serializing
        serialization_exclude: Whether to exclude the field when serializing
        metadata: Any other information you want to include with the schema, not used by pydantic-core
    typed-dict-field)rg   r   rh  rj  rk  rl  r   ry   )r   rh  rj  rk  rl  r   r5   r5   r6   typed_dict_field  s    rn  c                   @  sv   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< d	ed< d	ed< ded< ded< ded< ded< dS )TypedDictSchemazRequired[Literal['typed-dict']]rg   z#Required[Dict[str, TypedDictField]]fieldsr   r   List[ComputedField]computed_fieldsr#   r$   rs   r  r%   extra_behaviorr7   r*   r!   r   rT   r   r   r   r    rS   Nrh   r5   r5   r5   r6   ro  D  s   
ro  )r   rr  r$   r  rs  r7   r*   r   r   r   rS   zDict[str, TypedDictField]zType[Any] | Nonezlist[ComputedField] | NonezExtraBehavior | NonerR   )rp  r   rr  r$   r  rs  r7   r*   r   r   r   rS   r;   c                C  s"   t d| |||||||||	|
|dS )a(  
    Returns a schema that matches a typed dict, e.g.:

    ```py
    from typing_extensions import TypedDict

    from pydantic_core import SchemaValidator, core_schema

    class MyTypedDict(TypedDict):
        a: str

    wrapper_schema = core_schema.typed_dict_schema(
        {'a': core_schema.typed_dict_field(core_schema.str_schema())}, cls=MyTypedDict
    )
    v = SchemaValidator(wrapper_schema)
    assert v.validate_python({'a': 'hello'}) == {'a': 'hello'}
    ```

    Args:
        fields: The fields to use for the typed dict
        cls: The class to use for the typed dict
        computed_fields: Computed fields to use when serializing the model, only applies when directly inside a model
        strict: Whether the typed dict is strict
        extras_schema: The extra validator to use for the typed dict
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        extra_behavior: The extra behavior to use for the typed dict
        total: Whether the typed dict is total, otherwise uses `typed_dict_total` from config
        populate_by_name: Whether the typed dict should populate by name
        serialization: Custom serialization schema
    
typed-dict)rg   rp  r   rr  r$   r  rs  r7   r*   r   r   r   rS   ry   )rp  r   rr  r$   r  rs  r7   r*   r   r   r   rS   r5   r5   r6   typed_dict_schemaU  s    .ru  c                   @  sF   e Zd ZU ded< ded< ded< ded< d	ed
< d	ed< ded< dS )
ModelFieldz Required[Literal['model-field']]rg   r   r   ri  rj  r!   rk  r#   rl  frozenrT   r   Nrh   r5   r5   r5   r6   rv    s   
rv  )rj  rk  rl  rw  r   )r   rj  rk  rl  rw  r   r;   c             	   C  s   t d| |||||dS )aq  
    Returns a schema for a model field, e.g.:

    ```py
    from pydantic_core import core_schema

    field = core_schema.model_field(schema=core_schema.int_schema())
    ```

    Args:
        schema: The schema to use for the field
        validation_alias: The alias(es) to use to find the field in the validation data
        serialization_alias: The alias to use as a key when serializing
        serialization_exclude: Whether to exclude the field when serializing
        frozen: Whether the field is frozen
        metadata: Any other information you want to include with the schema, not used by pydantic-core
    model-field)rg   r   rj  rk  rl  rw  r   ry   )r   rj  rk  rl  rw  r   r5   r5   r6   model_field  s    ry  c                   @  sn   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< d	ed< d	ed< ded< ded< ded< dS )ModelFieldsSchemaz!Required[Literal['model-fields']]rg   zRequired[Dict[str, ModelField]]rp  r!   
model_namerq  rr  r#   r$   rs   r  r%   rs  r*   r&   r   rT   r   r   r   Nrh   r5   r5   r5   r6   rz    s   
rz  )
r{  rr  r$   r  rs  r*   r&   r   r   r   zDict[str, ModelField])rp  r{  rr  r$   r  rs  r*   r&   r   r   r   r;   c       
         C  s    t d| |||||||||	|
dS )a  
    Returns a schema that matches a typed dict, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    wrapper_schema = core_schema.model_fields_schema(
        {'a': core_schema.model_field(core_schema.str_schema())}
    )
    v = SchemaValidator(wrapper_schema)
    print(v.validate_python({'a': 'hello'}))
    #> ({'a': 'hello'}, None, {'a'})
    ```

    Args:
        fields: The fields to use for the typed dict
        model_name: The name of the model, used for error messages, defaults to "Model"
        computed_fields: Computed fields to use when serializing the model, only applies when directly inside a model
        strict: Whether the typed dict is strict
        extras_schema: The extra validator to use for the typed dict
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        extra_behavior: The extra behavior to use for the typed dict
        populate_by_name: Whether the typed dict should populate by name
        from_attributes: Whether the typed dict should be populated from attributes
        serialization: Custom serialization schema
    model-fields)rg   rp  r{  rr  r$   r  rs  r*   r&   r   r   r   ry   )rp  r{  rr  r$   r  rs  r*   r&   r   r   r   r5   r5   r6   model_fields_schema  s    )r}  c                   @  s   e Zd ZU ded< ded< ded< ded< d	ed
< d	ed< ded< ded< d	ed< d	ed< ded< ded< ded< ded< ded< dS )ModelSchemar   rg   r   r   r   generic_originr   r   r#   custom_init
root_modelr!   	post_initr'   r(   r$   rw  r%   rs  r    rS   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r~    s   
r~  )r  r  r  r  r(   r$   rw  rs  rS   r   r   r   z9Literal[('always', 'never', 'subclass-instances')] | None)r   r   r  r  r  r  r(   r$   rw  rs  rS   r   r   r   r;   c                C  s&   t d| |||||||||	|
|||dS )a(  
    A model schema generally contains a typed-dict schema.
    It will run the typed dict validator, then create a new class
    and set the dict and fields set returned from the typed dict validator
    to `__dict__` and `__pydantic_fields_set__` respectively.

    Example:

    ```py
    from pydantic_core import CoreConfig, SchemaValidator, core_schema

    class MyModel:
        __slots__ = (
            '__dict__',
            '__pydantic_fields_set__',
            '__pydantic_extra__',
            '__pydantic_private__',
        )

    schema = core_schema.model_schema(
        cls=MyModel,
        config=CoreConfig(str_max_length=5),
        schema=core_schema.model_fields_schema(
            fields={'a': core_schema.model_field(core_schema.str_schema())},
        ),
    )
    v = SchemaValidator(schema)
    assert v.isinstance_python({'a': 'hello'}) is True
    assert v.isinstance_python({'a': 'too long'}) is False
    ```

    Args:
        cls: The class to use for the model
        schema: The schema to use for the model
        generic_origin: The origin type used for this model, if it's a parametrized generic. Ex,
            if this model schema represents `SomeModel[int]`, generic_origin is `SomeModel`
        custom_init: Whether the model has a custom init method
        root_model: Whether the model is a `RootModel`
        post_init: The call after init to use for the model
        revalidate_instances: whether instances of models and dataclasses (including subclass instances)
            should re-validate defaults to config.revalidate_instances, else 'never'
        strict: Whether the model is strict
        frozen: Whether the model is frozen
        extra_behavior: The extra behavior to use for the model, used in serialization
        config: The config to use for the model
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r   )rg   r   r  r   r  r  r  r(   r$   rw  rs  rS   r   r   r   ry   )r   r   r  r  r  r  r(   r$   rw  rs  rS   r   r   r   r5   r5   r6   model_schema  s"    Br  c                   @  sf   e Zd ZU ded< ded< ded< ded< ded	< ded
< ded< ded< ded< ded< ded< dS )DataclassFieldz$Required[Literal['dataclass-field']]rg   r   namer   r   r#   kw_onlyinit	init_onlyrw  ri  rj  r!   rk  rl  rT   r   Nrh   r5   r5   r5   r6   r  s  s   
r  )r  r  r  rj  rk  rl  r   rw  )r  r   r  r  r  rj  rk  rl  r   rw  r;   c          
      C  s   t d| |||||||||	dS )a  
    Returns a schema for a dataclass field, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    field = core_schema.dataclass_field(
        name='a', schema=core_schema.str_schema(), kw_only=False
    )
    schema = core_schema.dataclass_args_schema('Foobar', [field])
    v = SchemaValidator(schema)
    assert v.validate_python({'a': 'hello'}) == ({'a': 'hello'}, None)
    ```

    Args:
        name: The name to use for the argument parameter
        schema: The schema to use for the argument parameter
        kw_only: Whether the field can be set with a positional argument as well as a keyword argument
        init: Whether the field should be validated during initialization
        init_only: Whether the field should be omitted  from `__dict__` and passed to `__post_init__`
        validation_alias: The alias(es) to use to find the field in the validation data
        serialization_alias: The alias to use as a key when serializing
        serialization_exclude: Whether to exclude the field when serializing
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        frozen: Whether the field is frozen
    dataclass-field)rg   r  r   r  r  r  rj  rk  rl  r   rw  ry   )
r  r   r  r  r  rj  rk  rl  r   rw  r5   r5   r6   dataclass_field  s    'r  c                   @  s^   e Zd ZU ded< ded< ded< ded< d	ed
< d	ed< ded< ded< ded< ded< dS )DataclassArgsSchemaz#Required[Literal['dataclass-args']]rg   r   dataclass_namezRequired[List[DataclassField]]rp  rq  rr  r#   r*   collect_init_onlyr!   r   rT   r   r   r   r%   rs  Nrh   r5   r5   r5   r6   r    s   
r  )rr  r*   r  r   r   r   rs  zlist[DataclassField]zList[ComputedField] | None)
r  rp  rr  r*   r  r   r   r   rs  r;   c          	      C  s   t d| ||||||||d
S )a  
    Returns a schema for validating dataclass arguments, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    field_a = core_schema.dataclass_field(
        name='a', schema=core_schema.str_schema(), kw_only=False
    )
    field_b = core_schema.dataclass_field(
        name='b', schema=core_schema.bool_schema(), kw_only=False
    )
    schema = core_schema.dataclass_args_schema('Foobar', [field_a, field_b])
    v = SchemaValidator(schema)
    assert v.validate_python({'a': 'hello', 'b': True}) == ({'a': 'hello', 'b': True}, None)
    ```

    Args:
        dataclass_name: The name of the dataclass being validated
        fields: The fields to use for the dataclass
        computed_fields: Computed fields to use when serializing the dataclass
        populate_by_name: Whether to populate by name
        collect_init_only: Whether to collect init only fields into a dict to pass to `__post_init__`
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
        extra_behavior: How to handle extra fields
    dataclass-args)
rg   r  rp  rr  r*   r  r   r   r   rs  ry   )	r  rp  rr  r*   r  r   r   r   rs  r5   r5   r6   dataclass_args_schema  s    (r  c                   @  s   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< ded< ded< ded< ded< ded< ded< ded< ded< dS )DataclassSchemazRequired[Literal['dataclass']]rg   r   r   r   r  r   r   zRequired[List[str]]rp  r!   cls_namer#   r  r'   r(   r$   rw  r   rT   r   r   r   slotsr    rS   Nrh   r5   r5   r5   r6   r    s   
r  )r  r  r  r(   r$   r   r   r   rw  r  rS   	List[str])r   r   rp  r  r  r  r(   r$   r   r   r   rw  r  rS   r;   c                C  s&   t d| |||||||||	|
|||dS )a  
    Returns a schema for a dataclass. As with `ModelSchema`, this schema can only be used as a field within
    another schema, not as the root type.

    Args:
        cls: The dataclass type, used to perform subclass checks
        schema: The schema to use for the dataclass fields
        fields: Fields of the dataclass, this is used in serialization and in validation during re-validation
            and while validating assignment
        generic_origin: The origin type used for this dataclass, if it's a parametrized generic. Ex,
            if this model schema represents `SomeDataclass[int]`, generic_origin is `SomeDataclass`
        cls_name: The name to use in error locs, etc; this is useful for generics (default: `cls.__name__`)
        post_init: Whether to call `__post_init__` after validation
        revalidate_instances: whether instances of models and dataclasses (including subclass instances)
            should re-validate defaults to config.revalidate_instances, else 'never'
        strict: Whether to require an exact instance of `cls`
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
        frozen: Whether the dataclass is frozen
        slots: Whether `slots=True` on the dataclass, means each field is assigned independently, rather than
            simply setting `__dict__`, default false
    	dataclass)rg   r   r  rp  r  r   r  r(   r$   r   r   r   rw  r  rS   ry   )r   r   rp  r  r  r  r(   r$   r   r   r   rw  r  rS   r5   r5   r6   dataclass_schema  s"    (r  c                   @  s.   e Zd ZU ded< ded< ded< ded< d	S )
ArgumentsParameterr   r  r   r   zELiteral[('positional_only', 'positional_or_keyword', 'keyword_only')]rC   ri  r   Nrh   r5   r5   r5   r6   r  G  s   
r  )rC   r   zLLiteral[('positional_only', 'positional_or_keyword', 'keyword_only')] | None)r  r   rC   r   r;   c                C  s   t | |||dS )a  
    Returns a schema that matches an argument parameter, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    param = core_schema.arguments_parameter(
        name='a', schema=core_schema.str_schema(), mode='positional_only'
    )
    schema = core_schema.arguments_schema([param])
    v = SchemaValidator(schema)
    assert v.validate_python(('hello',)) == (('hello',), {})
    ```

    Args:
        name: The name to use for the argument parameter
        schema: The schema to use for the argument parameter
        mode: The mode to use for the argument parameter
        alias: The alias to use for the argument parameter
    r  r   rC   r   ry   r  r5   r5   r6   arguments_parameterN  s    r  )Zuniformzunpacked-typed-dictVarKwargsModec                   @  sV   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< ded< ded< dS )ArgumentsSchemazRequired[Literal['arguments']]rg   z"Required[List[ArgumentsParameter]]arguments_schemar#   r*   rs   var_args_schemar  var_kwargs_modevar_kwargs_schemar!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r  o  s   
r  )r*   r  r  r  r   r   r   zlist[ArgumentsParameter]zVarKwargsMode | None)		argumentsr*   r  r  r  r   r   r   r;   c                C  s   t d| |||||||d	S )a  
    Returns a schema that matches an arguments schema, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    param_a = core_schema.arguments_parameter(
        name='a', schema=core_schema.str_schema(), mode='positional_only'
    )
    param_b = core_schema.arguments_parameter(
        name='b', schema=core_schema.bool_schema(), mode='positional_only'
    )
    schema = core_schema.arguments_schema([param_a, param_b])
    v = SchemaValidator(schema)
    assert v.validate_python(('hello', True)) == (('hello', True), {})
    ```

    Args:
        arguments: The arguments to use for the arguments schema
        populate_by_name: Whether to populate by name
        var_args_schema: The variable args schema to use for the arguments schema
        var_kwargs_mode: The validation mode to use for variadic keyword arguments. If `'uniform'`, every value of the
            keyword arguments will be validated against the `var_kwargs_schema` schema. If `'unpacked-typed-dict'`,
            the `var_kwargs_schema` argument must be a [`typed_dict_schema`][pydantic_core.core_schema.typed_dict_schema]
        var_kwargs_schema: The variable kwargs schema to use for the arguments schema
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    r  )	rg   r  r*   r  r  r  r   r   r   ry   )r  r*   r  r  r  r   r   r   r5   r5   r6   r  {  s    (r  c                   @  sN   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< ded< dS )
CallSchemazRequired[Literal['call']]rg   r   r  zRequired[Callable[..., Any]]rp   r!   function_namers   rt   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r    s   
r  )r  rt   r   r   r   zCallable[..., Any])r  rp   r  rt   r   r   r   r;   c             
   C  s   t d| ||||||dS )a-  
    Returns a schema that matches an arguments schema, then calls a function, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    param_a = core_schema.arguments_parameter(
        name='a', schema=core_schema.str_schema(), mode='positional_only'
    )
    param_b = core_schema.arguments_parameter(
        name='b', schema=core_schema.bool_schema(), mode='positional_only'
    )
    args_schema = core_schema.arguments_schema([param_a, param_b])

    schema = core_schema.call_schema(
        arguments=args_schema,
        function=lambda a, b: a + str(not b),
        return_schema=core_schema.str_schema(),
    )
    v = SchemaValidator(schema)
    assert v.validate_python((('hello', True))) == 'helloFalse'
    ```

    Args:
        arguments: The arguments to use for the arguments schema
        function: The function to use for the call schema
        function_name: The function name to use for the call schema, if not provided `function.__name__` is used
        return_schema: The return schema to use for the call schema
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    call)rg   r  rp   r  rt   r   r   r   ry   )r  rp   r  rt   r   r   r   r5   r5   r6   call_schema  s    *r  c                   @  sN   e Zd ZU ded< ded< ded< ded< d	ed
< ded< ded< ded< dS )CustomErrorSchemaz!Required[Literal['custom-error']]rg   r   r   r   rO  r!   rP  rQ  rR  r   rT   r   r   r   Nrh   r5   r5   r5   r6   r    s   
r  )rP  rR  r   r   r   zdict[str, Any] | None)r   rO  rP  rR  r   r   r   r;   c             
   C  s   t d| ||||||dS )a  
    Returns a schema that matches a custom error value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.custom_error_schema(
        schema=core_schema.int_schema(),
        custom_error_type='MyError',
        custom_error_message='Error msg',
    )
    v = SchemaValidator(schema)
    v.validate_python(1)
    ```

    Args:
        schema: The schema to use for the custom error schema
        custom_error_type: The custom error type to use for the custom error schema
        custom_error_message: The custom error message to use for the custom error schema
        custom_error_context: The custom error context to use for the custom error schema
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    custom-error)rg   r   rO  rP  rR  r   r   r   ry   )r   rO  rP  rR  r   r   r   r5   r5   r6   custom_error_schema  s    "r  c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )
JsonSchemazRequired[Literal['json']]rg   rs   r   r!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r  *  s
   
r  )r   r   r   r   r;   c                C  s   t d| |||dS )a  
    Returns a schema that matches a JSON value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    dict_schema = core_schema.model_fields_schema(
        {
            'field_a': core_schema.model_field(core_schema.str_schema()),
            'field_b': core_schema.model_field(core_schema.bool_schema()),
        },
    )

    class MyModel:
        __slots__ = (
            '__dict__',
            '__pydantic_fields_set__',
            '__pydantic_extra__',
            '__pydantic_private__',
        )
        field_a: str
        field_b: bool

    json_schema = core_schema.json_schema(schema=dict_schema)
    schema = core_schema.model_schema(cls=MyModel, schema=json_schema)
    v = SchemaValidator(schema)
    m = v.validate_python('{"field_a": "hello", "field_b": true}')
    assert isinstance(m, MyModel)
    ```

    Args:
        schema: The schema to use for the JSON schema
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rc   )rg   r   r   r   r   ry   )r   r   r   r   r5   r5   r6   rc  2  s    +rc  c                   @  sf   e Zd ZU ded< ded< ded< ded< d	ed
< ded< d	ed< ded< d	ed< ded< ded< dS )	UrlSchemazRequired[Literal['url']]rg   r+   r   r  allowed_schemesr#   host_requiredr!   default_hostdefault_portdefault_pathr$   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r  `  s   
r  
r   r  r  r  r  r  r$   r   r   r   zlist[str] | None)r   r  r  r  r  r  r$   r   r   r   r;   c        
   
      C  s   t d| |||||||||	dS )a  
    Returns a schema that matches a URL value, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.url_schema()
    v = SchemaValidator(schema)
    print(v.validate_python('https://example.com'))
    #> https://example.com/
    ```

    Args:
        max_length: The maximum length of the URL
        allowed_schemes: The allowed URL schemes
        host_required: Whether the URL must have a host
        default_host: The default host to use if the URL does not have a host
        default_port: The default port to use if the URL does not have a port
        default_path: The default path to use if the URL does not have a path
        strict: Whether to use strict URL parsing
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    ra   rg   r   r  r  r  r  r  r$   r   r   r   ry   r  r5   r5   r6   
url_scheman  s    %r  c                   @  sf   e Zd ZU ded< ded< ded< ded< d	ed
< ded< d	ed< ded< d	ed< ded< ded< dS )MultiHostUrlSchemaz#Required[Literal['multi-host-url']]rg   r+   r   r  r  r#   r  r!   r  r  r  r$   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r    s   
r  c        
   
      C  s   t d| |||||||||	dS )a&  
    Returns a schema that matches a URL value with possibly multiple hosts, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.multi_host_url_schema()
    v = SchemaValidator(schema)
    print(v.validate_python('redis://localhost,0.0.0.0,127.0.0.1'))
    #> redis://localhost,0.0.0.0,127.0.0.1
    ```

    Args:
        max_length: The maximum length of the URL
        allowed_schemes: The allowed URL schemes
        host_required: Whether the URL must have a host
        default_host: The default host to use if the URL does not have a host
        default_port: The default port to use if the URL does not have a port
        default_path: The default path to use if the URL does not have a path
        strict: Whether to use strict URL parsing
        ref: optional unique identifier of the schema, used to reference the schema in other places
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    rb   r  ry   r  r5   r5   r6   multi_host_url_schema  s    %r  c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )DefinitionsSchemaz Required[Literal['definitions']]rg   r   r   r  definitionsrT   r   r   r   Nrh   r5   r5   r5   r6   r    s
   
r  )r   r  r;   c                 C  s   t d| |dS )ab  
    Build a schema that contains both an inner schema and a list of definitions which can be used
    within the inner schema.

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema = core_schema.definitions_schema(
        core_schema.list_schema(core_schema.definition_reference_schema('foobar')),
        [core_schema.int_schema(ref='foobar')],
    )
    v = SchemaValidator(schema)
    assert v.validate_python([1, 2, '3']) == [1, 2, 3]
    ```

    Args:
        schema: The inner schema
        definitions: List of definitions which can be referenced within inner schema
    r  )rg   r   r  )r  )r   r  r5   r5   r6   definitions_schema  s    r  c                   @  s6   e Zd ZU ded< ded< ded< ded< d	ed
< dS )DefinitionReferenceSchemaz#Required[Literal['definition-ref']]rg   r   
schema_refr!   r   rT   r   r   r   Nrh   r5   r5   r5   r6   r    s
   
r  )r  r   r   r   r;   c                 C  s   t d| |||dS )aw  
    Returns a schema that points to a schema stored in "definitions", this is useful for nested recursive
    models and also when you want to define validators separately from the main schema, e.g.:

    ```py
    from pydantic_core import SchemaValidator, core_schema

    schema_definition = core_schema.definition_reference_schema('list-schema')
    schema = core_schema.definitions_schema(
        schema=schema_definition,
        definitions=[
            core_schema.list_schema(items_schema=schema_definition, ref='list-schema'),
        ],
    )
    v = SchemaValidator(schema)
    assert v.validate_python([()]) == [[]]
    ```

    Args:
        schema_ref: The schema ref to use for the definition reference schema
        metadata: Any other information you want to include with the schema, not used by pydantic-core
        serialization: Custom serialization schema
    definition-ref)rg   r  r   r   r   ry   )r  r   r   r   r5   r5   r6   definition_reference_schema  s        r  )2r   re   rW   r#   r+   rX   r   r!   rY   r   r   r   r   r   r   r   r   r   r[   r\   r]   r^   r_   r`   r2  r'  r   rx   rD  rJ  rS  rW  r[  r`  re  rt  r|  r   r  r  r  r  r  rc   ra   rb   r  r  rd   r   )rx  r  rm  r   )dZno_such_attributeZjson_invalidZ	json_typeZneeds_python_objectZrecursion_loopr   Zfrozen_fieldZfrozen_instanceZextra_forbiddenZinvalid_keyZget_attribute_errorZ
model_typeZmodel_attributes_typeZdataclass_typeZdataclass_exact_typeZnone_requiredZgreater_thanZgreater_than_equalZ	less_thanZless_than_equalr   Zfinite_numberZ	too_shortZtoo_longZiterable_typeZiteration_errorZstring_typeZstring_sub_typeZstring_unicodeZstring_too_shortZstring_too_longZstring_pattern_mismatchr   Z	dict_typeZmapping_typeZ	list_typeZ
tuple_typeZset_typeZ	bool_typeZbool_parsingZint_typeZint_parsingZint_parsing_sizeZint_from_floatZ
float_typeZfloat_parsingZ
bytes_typeZbytes_too_shortZbytes_too_longZbytes_invalid_encodingZvalue_errorZassertion_errorZliteral_errorZ	date_typeZdate_parsingZdate_from_datetime_parsingZdate_from_datetime_inexactZ	date_pastZdate_futureZ	time_typeZtime_parsingZdatetime_typeZdatetime_parsingZdatetime_object_invalidZdatetime_from_date_parsingZdatetime_pastZdatetime_futureZtimezone_naiveZtimezone_awareZtimezone_offsetZtime_delta_typeZtime_delta_parsingZfrozen_set_typeZis_instance_ofZis_subclass_ofZcallable_typeZunion_tag_invalidZunion_tag_not_foundZarguments_typeZmissing_argumentZunexpected_keyword_argumentZmissing_keyword_only_argumentZunexpected_positional_argumentZ missing_positional_only_argumentZmultiple_argument_valuesZurl_typeZurl_parsingZurl_syntax_violationZurl_too_longZ
url_schemeZ	uuid_typeZuuid_parsingZuuid_versionZdecimal_typeZdecimal_parsingZdecimal_max_digitsZdecimal_max_placesZdecimal_whole_digitsZcomplex_typeZcomplex_str_parsing)kwargsr;   c                  K  s   dd |   D S )Nc                 S  s   i | ]\}}|d k	r||qS r<   r5   ).0kvr5   r5   r6   
<dictcomp>  s       z"_dict_not_none.<locals>.<dictcomp>)items)r  r5   r5   r6   rz     s    rz   c`field_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.)rp   rP   r   c                 K  s"   t dt t| |fd|i|S )Nr  rP   warningswarnDeprecationWarningr0  rp   rP   r   r  r5   r5   r6   field_before_validator_function  s
    r  e`general_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.c                  O  s   t dt t| |S )Nr  r  argsr  r5   r5   r6   !general_before_validator_function  s
    r  a`field_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.c                 K  s"   t dt t| |fd|i|S )Nr  rP   r  r  r  r4  r  r5   r5   r6   field_after_validator_function'  s
    r  c`general_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.c                  O  s   t dt t| |S )Nr  r  r  r5   r5   r6    general_after_validator_function0  s
    r  _`field_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.c                 K  s"   t dt t| |fd|i|S )Nr  rP   r  r  r  r>  r  r5   r5   r6   field_wrap_validator_function9  s
    r  a`general_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.c                  O  s   t dt t| |S )Nr  r  r  r5   r5   r6   general_wrap_validator_functionD  s
    r  a`field_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.)rp   rP   c                 K  s    t dt t| fd|i|S )Nr  rP   r  r  r  rB  )rp   rP   r  r5   r5   r6   field_plain_validator_functionM  s
    r  c`general_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.c                  O  s   t dt t| |S )Nr  r  r  r5   r5   r6    general_plain_validator_functionV  s
    r  )FieldValidationInfoZFieldValidatorFunctionZGeneralValidatorFunctionZFieldWrapValidatorFunctionobject)	attr_namer;   c                 C  sX   t | }|d kr$td|  dn0dd l}d|  d|j d}|j|tdd |S d S )	Nz)module 'pydantic_core' has no attribute ''r   `z` is deprecated, use `z
` instead.   )
stacklevel)_deprecated_import_lookupgetAttributeErrorr  r0   r  r  )r  Znew_attrr  msgr5   r5   r6   __getattr__j  s    
r  )NN)NNNN)N)N)N)N)N)NN)N)NNN)r3   Z
__future__r   Z_annotationssysr  Zcollections.abcr   r   r   r   r   r   r   typingr	   r
   r   r   r   r   r   r   r   r   r   Ztyping_extensionsr   version_infor   r   r   r   r   Zpydantic_corer   ImportErrorr  r%   r    r8   r4   r9   rO   rQ   ri   rf   rk   Z$GeneralPlainNoInfoSerializerFunctionZ"GeneralPlainInfoSerializerFunctionZ"FieldPlainNoInfoSerializerFunctionZ FieldPlainInfoSerializerFunctionrw   ru   rn   r{   r|   Z#GeneralWrapNoInfoSerializerFunctionZ!GeneralWrapInfoSerializerFunctionZ!FieldWrapNoInfoSerializerFunctionZFieldWrapInfoSerializerFunctionr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZJsonTyper   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r	  r  r  r  r  r  r  r  r+   r!   r  r  r  r  r  r  r   r  r-  r!  ZValidationFunctionr#  r%  r,  r0  r1  r3  r4  r5  r8  r7  r=  r9  ZWrapValidatorFunctionr:  r<  r>  r?  rA  rB  rC  rH  rI  rK  rL  rT  rU  rX  rY  r\  r]  ra  rb  rf  rg  rn  ro  ru  rv  ry  rz  r}  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rc  r  r  r  r  r  r  r  r  ZMYPYrs   ZCoreSchemaTypeZCoreSchemaFieldTypeZ	ErrorTyperz   r  r  r  r  r  r  r  r  r  r  r  r5   r5   r5   r6   <module>   sp  4

I&" #
		     	   $0&3*:
"*>'&4&4*<$1"4"%  "12 ,$3"/"/$/$ *0	*2,3*0*0*5,4(+**48$666S""&6$0*%>?*%89@U2646@;(05,6,.	".2424
   "95
h	
	