
    5j}             
      :
   % S r SSKJr  SSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSKrSSKrSSKJrJr  SSKJrJr  SSKJr  SSKJr  SSKJr  SS	KJrJrJr  SS
KJrJrJ r J!r!J"r"J#r#  SSK$J%r%  SSK&J'r'  SSK(J)r)J*r*J+r+  SSKJ,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9  SSK:J;r;  SSKJ<r<  SSK=r=SSK>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrF  SSK=JGrGJHrHJIrIJJrJJKrKJLrL  SSKMJNrNJOrOJPrP  SSKQJRrRJSrS  SSKTJUrUJVrVJWrW  SSKXJYrYJZrZJ[r[  SSK\J]r]J^r^J_r_J`r`Jara  SSKbJcrc  SSKdJere  SSKJfrf  SSKgJhrhJiriJjrjJkrkJlrl  SSKmJnrnJoro  SSKpJqrqJrrr  SS KhJsrsJtrtJuruJvrvJwrwJxrxJyryJzrzJ{r{  SS!KiJ|r|J}r}J~r~JrJrJrJrJrJrJrJrJr  SS"KJr  SS#KJr  SS$KJr  SS%KJrJrJrJr  SS&KJrJr  SS'KJr  SS(KJr  SS)KlJrJrJrJrJr  SS*KJrJr  \,(       a   SS+KJrJr  SS,KJr  SS-K(Jr  SS.KJr  SS/KJr  \GRV                  S0:  r\7\\\~4   r\6" S1\S29r\7\|\   \|\   \|\~   4   r\Rr\.\-\/\ER~                  4   r\\GRf                  /rS3\S4'   \\GRn                  \GRp                  GRr                  /rS3\S5'   \\GRx                  \GRp                  GRz                  /rS3\S6'   \\GR                  \GRp                  GRx                  /rS3\S7'   \\R^                  /rS3\S8'   \\\ \!\"\#/rS3\S9'   \GR                  \GRp                  GR                  /rS3\S:'   \	GR                  \
GR                  \
GR                  \
GR                  \
GR                  \
GR                  /rS3\S;'   \Rh                  \GR                  \GRp                  Rh                  \GRp                  GR                  \GR                  \=GR                  \GR                  \GR                  \GR                  \GR                  /
r\GR                  \GR                  /rS3\S<'   \^\]\`\aS=.rS>\S?'         SiS@ jrSjSA jr      SkSB jr        SlSC jrSSD.         SmSE jjr\/\5\-   \W4   r        SnSF jr\7\/\\-4   S4   r " SG SH5      rSoSI jr " SJ SK5      rSL SM SN SO SP SQ SR SS ST.rSU\SV'           SpSW jrSqSX jr        SrSY jrSsSZ jrStS[ jr      SuS\ jr    SvS] jr " S^ S_\I5      rSSSSSS`.             SwSa jjr " Sb Sc5      rSxSd jr " Se Sf5      r " Sg Sh5      rg)yz-Convert python types to pydantic-core schema.    )annotationsN)	ExitStackcontextmanager)copydeepcopy)Decimal)Enum)partial)	Parameter_ParameterKind	signature)IPv4AddressIPv4InterfaceIPv4NetworkIPv6AddressIPv6InterfaceIPv6Network)chain)
attrgetter)FunctionType
LambdaType
MethodType)TYPE_CHECKINGAnyCallableDictFinal
ForwardRefIterableIteratorMappingTypeTypeVarUnioncastoverload)UUID)warn)
CoreSchemaMultiHostUrlPydanticCustomError$PydanticSerializationUnexpectedValuePydanticUndefinedUrlcore_schemato_jsonable_python)LiteralTypeAliasType	TypedDictget_args
get_originis_typeddict   )AliasChoicesAliasGenerator	AliasPath)GetCoreSchemaHandlerGetJsonSchemaHandler)
ConfigDictJsonDictJsonEncoder)PydanticSchemaGenerationErrorPydanticUndefinedAnnotationPydanticUserError)AfterValidatorBeforeValidatorFieldValidatorModesPlainValidatorWrapValidator)JsonSchemaValue)version_short)PydanticDeprecatedSince20   )_core_utils_decorators_discriminated_union_known_annotated_metadata_typing_extra)ConfigWrapperConfigWrapperStack)CoreMetadataHandlerbuild_metadata_dict)	CoreSchemaOrFieldcollect_invalid_schemasdefine_expected_missing_refsget_refget_type_refis_function_with_inner_schema%is_list_like_schema_with_items_schemasimplify_schema_referencesvalidate_core_schema)	DecoratorDecoratorInfosFieldSerializerDecoratorInfoFieldValidatorDecoratorInfoModelSerializerDecoratorInfoModelValidatorDecoratorInfoRootValidatorDecoratorInfoValidatorDecoratorInfoget_attribute_from_basesinspect_field_serializerinspect_model_serializerinspect_validator)extract_docstrings_from_cls)collect_dataclass_fields)PydanticRecursiveRef)get_standard_typevars_maphas_instance_in_typerecursively_defined_type_refsreplace_types)import_cached_base_modelimport_cached_field_info)MockCoreSchema)CallbackGetCoreSchemaHandler)get_cls_type_hints_lenientis_annotatedis_finalvaris_self_typeis_zoneinfo_type)lenient_issubclasssmart_deepcopy)ComputedFieldInfo	FieldInfo)	BaseModel)Discriminator)StandardDataclass)GetJsonSchemaFunction)      FieldDecoratorInfoType)boundz
list[type]TUPLE_TYPES
LIST_TYPES	SET_TYPESFROZEN_SET_TYPES
DICT_TYPESIP_TYPESSEQUENCE_TYPES
PATH_TYPESDEQUE_TYPES)beforeafterplainwrapzbdict[FieldValidatorModes, type[BeforeValidator | AfterValidator | PlainValidator | WrapValidator]]_mode_to_validatorc                Z    SU R                   ;   a  gU R                    H
  nX!:X  d  M
    g   g)zCheck if field name is in validator fields.

Args:
    info: The field info.
    field: The field name to check.

Returns:
    `True` if field name is in validator fields, `False` otherwise.
*TF)fields)infofieldv_field_names      b/root/lseg-credit/backend/venv/lib/python3.13/site-packages/pydantic/_internal/_generate_schema.py)check_validator_fields_against_field_namer      s/     dkk  $     c           	     (   [        U5      nU  H  nSUR                  R                  ;   a  M  UR                  R                  SL a  M:  UR                  R                   H-  nX1;  d  M
  [	        SUR
                   SUR                   S3SS9e   M     g)	aZ  Check if the defined fields in decorators exist in `fields` param.

It ignores the check for a decorator if the decorator has `*` as field or `check_fields=False`.

Args:
    decorators: An iterable of decorators.
    fields: An iterable of fields name.

Raises:
    PydanticUserError: If one of the field names does not exist in `fields` param.
r   Fz*Decorators defined with incorrect fields: .zO (use check_fields=False if you're inheriting from the model and intended this)zdecorator-missing-fieldcodeN)setr   r   check_fieldsrB   cls_refcls_var_name)
decoratorsr   decr   s       r   check_decorator_fields_existr      s     [F#((//!88  E)XX__E"'@QsO_O_N`ef2  % r   c                l    U  Vs/ s H"  n[        UR                  U5      (       d  M   UPM$     sn$ s  snf N)r   r   )validator_functionsr   r   s      r   $filter_field_decorator_info_by_fieldr      s0     /m.C2[\_\d\dfk2lC.mmms   11c                   U(       d  U $ U S   S:X  a  [        U S   X5      U S'   U $ U S   S:X  a/  U R                  S5      =nb  [        U S   U   UU5      U S   U'   U $ [        U 5      (       a6  U R                  S[        R
                  " 5       5      n[        XAU5      U S'   U $ U S   S:X  a6  U R                  S[        R
                  " 5       5      n[        XAU5      U S'   U $ [        S	U S    35      e)
Ntypenullableschematuplevariadic_item_indexitems_schemadictvalues_schemazO`@validator(..., each_item=True)` cannot be applied to fields with a schema of )apply_each_item_validatorsgetapply_validatorsr[   r/   
any_schema	TypeError)r   each_item_validators
field_namer   inner_schemas        r   r   r      s(     
 f~#5fX6FH\ix	7	"#)::.C#DDQ:J~&':;$;F>"#67 M 
/v	6	6zz.+2H2H2JK!1,V`!a~ M 
6	!zz/;3I3I3KL"2<Wa"b
 M ]^dek^l]mn
 	
r   )titlec                  SSK Jn  SSKJn  SSKJn  [        5       nU" U 5      nUR                  U5      n	Ub  X9S'   OSU	;  a  UR                  U	S'   X'L d  U" U5      (       d  U" U5      (       a  SOUR                  n
U
(       a!  SU	;  a  [        R                  " U
5      U	S'   U$ [        X%5      (       a:  UR                  S	   R                  (       a  UR                  S	   R                  U	S'   U$ )
ae  Add title and description for model-like classes' JSON schema.

Args:
    schema_or_field: The schema data to generate a JSON schema from.
    handler: The `GetCoreSchemaHandler` instance.
    cls: The model-like class.
    title: The title to set for the model's schema, defaults to the model's name

Returns:
    JsonSchemaValue: The updated JSON schema.
r7   is_pydantic_dataclass)	RootModelrK   )is_builtin_dataclassNr   descriptionroot)dataclassesr   
root_modelr   _dataclassesr   rq   resolve_ref_schema__name____doc__inspectcleandoc
issubclassmodel_fieldsr   )schema_or_fieldhandlerclsr   r   r   r   r~   json_schemaoriginal_schema	docstrings              r   modify_model_json_schemar      s    $ 4&2(*I/*K00=O#( 		'#&<< (,@,E,EI^_bIcIcilititI]/9)0)9)9))D&  
C	#	#(8(8(@(L(L),)9)9&)A)M)M&r   c                4   U (       d  U$ SU;   a  U$ U/[        USUR                  R                  5      SS Q7 HZ  nU R                  U5      nUc  M  [        R
                  " S[        5        S3[        5        [        R                  " USS9US'   Us  $    U$ )	zIterate over the json_encoders and add the first matching encoder to the schema.

Args:
    json_encoders: A dictionary of types and their encoder functions.
    tp: The type to check for a matching encoder.
    schema: The schema to add the encoder to.
serialization__mro__Nz=`json_encoders` is deprecated. See https://docs.pydantic.dev/z</concepts/serialization/#custom-serializers for alternativesjson)	when_used)
getattr	__class__r   r   warningsr(   rI   rJ   r/   $plain_serializer_function_ser_schema)json_encoderstpr   baseencoders        r   ,_add_custom_serialization_from_json_encodersr   "  s     &  Hgb)R\\-A-AB3BGH##D)?KMOK\  ]Y  Z%	
 #."R"RSZfl"m I Mr   c                  J    \ rS rSrSrSS jr\S	S j5       r\S
S j5       r	Sr
g)TypesNamespaceStackiG  zA stack of types namespaces.c                    U/U l         g r   _types_namespace_stack)selftypes_namespaces     r   __init__TypesNamespaceStack.__init__J  s    =L<M#r   c                     U R                   S   $ Nr   r   r   s    r   tailTypesNamespaceStack.tailM  s    **2..r   c              #  N  #    [         R                  " U5      R                  5       nUR                  U R                  =(       d    0 5        U R
                  R                  U5         S v   U R
                  R                  5         g ! U R
                  R                  5         f = f7fr   )rP   get_module_ns_ofr   updater   r   appendpop)r   for_typer   s      r   pushTypesNamespaceStack.pushQ  st     '88BGGItyyB/##**?;	.''++-D''++-s   A$B%'B +B%B""B%r   N)r   TypesNamespace)returnr   )r   	type[Any])r   
__module____qualname____firstlineno__r   r   propertyr   r   r   __static_attributes__ r   r   r   r   G  s3    &N / / . .r   r   c                    U b  U $ U$ )a6  Return the first argument if it is not None, otherwise return the second argument.

Use case: serialization_alias (argument a) and alias (argument b) are both defined, and serialization_alias is ''.
This function will return serialization_alias, which is the first argument, even though it is an empty string.
r  )abs     r   _get_first_non_nullr  \  s     1$1$r   c                     \ rS rSrSrSr SN       SOS jjr\            SPS j5       r\	SQS j5       r
\	SRS j5       r\	SSS	 j5       r\	STS
 j5       rSUS jrSVS jrSWS jrSVS jrSVS jrSXS jrSYS jrSYS jrSZS jr      S[S jr " S S\5      rS\S jrS\S jrS]S jr S^     S_S jjrS`S jr\ SN     SaS jj5       r S\S jr!SbS jr"ScS  jr#\$SdS! j5       r%\$SeS" j5       r%SfSgS# jjr%ScS$ jr&ShS% jr'SiS& jr(SiS' jr)SjS( jr*SS).         SkS* jjr+        SlS+ jr,        SmS, jr-\        SnS- j5       r.\      SoS. j5       r/\        SpS/ j5       r0        SqS0 jr1SrS1 jr2    SZS2 jr3SsS3 jr4StS4 jr5SuS5 jr6\7Rp                  S4         SvS6 jjr9SwS7 jr:SxS8 jr;SxS9 jr<SrS: jr=SyS; jr>SzS< jr?S{S= jr@S|S> jrASxS? jrB      S}S@ jrCS~SA jrDSSB jrE      SSC jrFSSD jrG      SSE jrHSF 4       SSG jjrISSH jrJ      SSI jrK        SSJ jrL Sf       SSK jjrM      SSL jrNSMrOg)GenerateSchemaie  z\Generate core schema for a Pydantic model, dataclass and types like `str`, `datetime`, ... .)_config_wrapper_stackr   _typevars_mapfield_name_stackmodel_type_stackdefsNc                    [        U5      U l        [        U5      U l        X0l        [        5       U l        [        5       U l        [        5       U l
        g r   )rR   r
  r   r   r  _FieldNameStackr  _ModelTypeStackr  _Definitionsr  )r   config_wrapperr   typevars_maps       r   r   GenerateSchema.__init__q  sC     &8%G"&9/&J#) / 1 / 1 N	r   c                    U R                  U 5      nXl        X&l        X6l        XFl        [        5       Ul        XVl        U$ r   )__new__r
  r   r  r  r  r  r  )r   config_wrapper_stacktypes_namespace_stackr  r  r  objs          r   __from_parentGenerateSchema.__from_parent  s?     kk#$8!%:"/(.0
r   c                .    U R                   R                  $ r   )r
  r   r   s    r   _config_wrapperGenerateSchema._config_wrapper  s    ))...r   c                .    U R                   R                  $ r   )r   r   r   s    r   _types_namespaceGenerateSchema._types_namespace  s    **///r   c                    U R                   R                  =(       d    [        nUR                  U R                  U R
                  U R                  U R                  U R                  5      $ r   )	r  schema_generatorr	  _GenerateSchema__from_parentr
  r   r  r  r  )r   r   s     r   _current_generate_schema'GenerateSchema._current_generate_schema  sV    ""33E~  &&''!!II
 	
r   c                .    U R                   R                  $ r   )r  arbitrary_types_allowedr   s    r   _arbitrary_typesGenerateSchema._arbitrary_types  s    ##;;;r   c                ,    [         R                  " 5       $ )zGenerate a CoreSchema for `str`)r/   
str_schemar   s    r   r-  GenerateSchema.str_schema  s    %%''r   c                L    [         R                  " U R                  U5      5      $ r   )r/   list_schemagenerate_schemar   
items_types     r   _list_schemaGenerateSchema._list_schema  s    &&t';';J'GHHr   c                l    [         R                  " U R                  U5      U R                  U5      5      $ r   )r/   dict_schemar1  )r   	keys_typevalues_types      r   _dict_schemaGenerateSchema._dict_schema  s,    &&t';';I'FH\H\]hHijjr   c                L    [         R                  " U R                  U5      5      $ r   )r/   
set_schemar1  r2  s     r   _set_schemaGenerateSchema._set_schema  s    %%d&:&::&FGGr   c                L    [         R                  " U R                  U5      5      $ r   )r/   frozenset_schemar1  r2  s     r   _frozenset_schema GenerateSchema._frozenset_schema  s    ++D,@,@,LMMr   c           	     @  ^^
^^^ [        TR                  R                  5       5      m
[        T5      mTR                  (       d  S O[
        R                  " TR                  5      nUS:X  a  S nTR                  US.mTR                  5        VVs0 s H  u  p4Uc  M
  X4_M     snnmS m[        T[        5      (       a  Sm[        R                  " S5      nOs[        T[        5      (       a  Sm[        R                  " S5      nOE[        T[        5      (       a  Sm[        R                  " S5      nO[        R                  " S 5      nT
(       a  SU4S jjn[!        TR"                  SS 5      [$        R"                  R&                  :H  n[        R(                  " TT
TU(       a  S OTR"                  TS	U/0S
9nU R*                  R,                  (       a  [        R.                  " [1        S5      XS9nU$ SU
UUUU4S jjn	[        R2                  " TS	U	/0S9$ s  snnf )NzAn enumeration.)r   r   intstrfloatc                    U $ r   r  xs    r   <lambda>-GenerateSchema._enum_schema.<locals>.<lambda>  s    XYr   c                \   > U" U 5      nUR                  U5      nUR                  T5        U$ r   )r   r   )r   r   r   r   
js_updatess       r   get_json_schema4GenerateSchema._enum_schema.<locals>.get_json_schema  s0    %fo")"<"<["I&&z2""r   __func__pydantic_js_functions)sub_typemissingrefmetadatavalue)r   c           	        > U" [         R                  " TTTTS95      nUR                  U5      nUR                  T5        U$ )N)rS  rU  )r/   enum_schemar   r   )	_r   r   r   casesenum_ref	enum_typerN  rS  s	       r   get_json_schema_no_cases=GenerateSchema._enum_schema.<locals>.get_json_schema_no_cases  sD    %k&=&=iYago&pq")"<"<["I&&z2""r   rV  )r   r)   r   r<   r   rH   )r   r<   r   rH   )list__members__valuesrY   r   r   r   r   itemsr   rE  r/   simple_ser_schemarF  rG  r   r   	_missing_r	   rQ  rY  r  use_enum_values no_info_after_validator_functionr   is_instance_schema)r   r]  r   kvvalue_ser_typerO  default_missingrY  r^  r[  r\  rN  rS  s    `        @@@@r   _enum_schemaGenerateSchema._enum_schema  s   	 5 5 < < >?	*"+"3"3d9I9I)J[J[9\,,K(11+N
'1'7'7'9K'9tqQdad'9K
:>i%%H4?4Q4QRW4XN	3''H(::5AN	5))H(::7CN )MMkZN# &i&9&9:tLPTP^P^PgPggO%11! /Y5H5H1O3DEK ##33)JJw' # # 1114L3MN s Ls   	HHc                  ^^ SSK Jn  [        S[        S[        S[
        S[        S[        S0mSU4S	 jjn[        R                  " [        R                  " UT   5      [        R                  " [        R                  " T[        R                  " 5       5      [        R                  " T5      S
9[        R                  " U5      [!        UU4S j/S9S9$ )NrK   )IP_VALIDATOR_LOOKUPipv4ipv4networkipv4interfaceipv6ipv6networkipv6interfacec           	        > [        U T[        45      (       d  [        ST S[        U 5       SU  S35      e[        U 5      $ )Nz
Expected `z` but got `z` with value `'z-'` - serialized value may not be as expected.)
isinstancerF  r,   r   )ipr   s    r   ser_ip)GenerateSchema._ip_schema.<locals>.ser_ip  sI    b2s),,: KRzLyz  r7Nr   )r   python_schemac                   > STT   S.$ )Nstringr   formatr  )_1_2ip_type_json_schema_formatr   s     r   rK  +GenerateSchema._ip_schema.<locals>.<lambda>  s    hJdegJh-ir   js_functions)
lax_schemastrict_schemar   rV  )rz  r   r   rF  )_validatorsrq  r   r   r   r   r   r   r/   lax_or_strict_schema no_info_plain_validator_functionjson_or_python_schemarh  r-  ri  r   rT   )r   r   rq  r{  r  s    `  @r   
_ip_schemaGenerateSchema._ip_schema  s    4 ??&
"	 //"CCDWXZD[\%;;'HH[McMcMef)<<R@ &JJ6R(ij

 
	
r   c                    [        U[        5      (       d)  [        U< S3[        5        [        R
                  " 5       $ [        R                  " U5      $ )Na   is not a Python type (it may be an instance of an object), Pydantic will allow any object with no validation since we cannot even enforce that the input is an instance of the given type. To get rid of this error wrap the type with `pydantic.SkipValidation`.)ry  r   r(   UserWarningr/   r   ri  )r   r   s     r   _arbitrary_type_schema%GenerateSchema._arbitrary_type_schema!  sO    "d##& Z Z  ))++--b11r   c                "    [        SU< S35      e)N,Unable to generate pydantic-core schema for a  . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.

If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.)r@   r   r  s     r   _unknown_type_schema#GenerateSchema._unknown_type_schema-  s#    +:3' Bf f
 	
r   c                    Uc  U$  [         R                  " UU5      $ ! [         R                   a    [         R                  " UU5        Us $ f = fr   )rN   apply_discriminatorMissingDefinitionForUnionRefset_discriminator_in_metadata)r   r   discriminators      r   _apply_discriminator_to_union,GenerateSchema._apply_discriminator_to_union8  s_      M	';;  $@@ 	 >> M	s    -AAc                      \ rS rSrSrg)GenerateSchema.CollectedInvalidiJ  r  N)r   r   r   r   r  r  r   r   CollectedInvalidr  J  s    r   r  c                    U R                  U5      n[        U5      n[        U5      (       a  U R                  5       e[        R
                  " U5      n[        U5      nU$ r   )collect_definitionsr\   rV   r  rN   apply_discriminatorsr]   )r   r   s     r   clean_schemaGenerateSchema.clean_schemaM  sU    ))&1+F3"6**''))%::6B%f-r   c                :   [        SUR                  SS 5      5      nU(       a  XR                  R                  U'   SU;   a  [        R
                  " US   5      n[        R                  " U[        U R                  R                  R                  5       5      5      $ )N
str | NonerU  )	r%   r   r  definitionsr/   definition_reference_schemadefinitions_schemara  rc  )r   r   rU  s      r   r  "GenerateSchema.collect_definitionsV  sz    <E4!89)/II!!#&F? <<VE]KF--&&--/0
 	
r   c                    [        U5      R                  nUR                  S/ 5      nX$;  a  UR                  U5        g g )NrR  )rS   rV  
setdefaultr   )r   metadata_schemajs_functionrV  rR  s        r   _add_js_functionGenerateSchema._add_js_functiona  sA    &7@@ ( 3 34KR P 3!((5 4r   Tc                6   SnU(       a  U R                  X5      nUb  UnUc  U R                  U5      n[        X5      nUb7  [        X0R                  R
                  5      nU(       a  U R                  Xe5        [        U R                  R                  X5      nU$ )a|  Generate core schema.

Args:
    obj: The object to generate core schema for.
    from_dunder_get_core_schema: Whether to generate schema from either the
        `__get_pydantic_core_schema__` function or `__pydantic_core_schema__` property.

Returns:
    The generated core schema.

Raises:
    PydanticUndefinedAnnotation:
        If it is not possible to evaluate forward reference.
    PydanticSchemaGenerationError:
        If it is not possible to generate pydantic-core schema.
    TypeError:
        - If `alias_generator` returns a disallowed type (must be str, AliasPath or AliasChoices).
        - If V1 style validator with `each_item=True` applied on a wrong field.
    PydanticUserError:
        - If `typing.TypedDict` is used instead of `typing_extensions.TypedDict` on Python < 3.12.
        - If `__modify_schema__` method is used instead of `__get_pydantic_json_schema__`.
N)
_generate_schema_from_property_generate_schema_inner!_extract_get_pydantic_json_schemaresolve_original_schemar  r  r  r   r  r   )r   r  from_dunder_get_core_schemar   from_propertymetadata_js_functionr  s          r   r1  GenerateSchema.generate_schemal  s    6 %)& ??IM(&>005F@M+5fii>S>STO%%oL=d>R>R>`>`benr   c                	   U R                   R                  U5       u  p#Ub  UsSSS5        $ UR                  nUR                  nUR                  n[        [        UR                  R                  5       UR                  R                  5       UR                  R                  5       5      1 UR                  5       kUR                  5       k5        [        UR                  SS9nUR                  U5      nU R                  X5      n	[!        [#        [$        XS9/S9n
UR&                  R                  5       nU R(                  R+                  U5         U R,                  R+                  U5         U R.                  n SnUR1                  S5      S:X  Ga  UR2                  S   UL d   eUR2                  S	   [4        L d   eUR2                  SS	  H  n[7        US
0 5      R1                  SS5      nUc  M%  [9        U[:        5      (       a5  [<        R>                  " [<        R@                  " USSS9U RB                  5      n[E        U5      nU[F        [H        4;  a  [K        S5      eU RM                  USS9S   nU[N        Ld  M  U RQ                  U5      n  O   URR                  (       a[  U RU                  SUS   U5      nUS   n[W        UUS5      n[X        RZ                  " UU[7        USS5      S[7        USS5      UUU
S9nGO[X        R\                  " UR_                  5        VVs0 s H  u  nnUU Ra                  UUU5      _M     snnUR                  5        Vs/ s H  nU Rc                  UUR                  5      PM!     snUURd                  S9n[g        UURh                  R                  5       S5      n[k        U[m        5       5      nUb  Un[W        UUS5      n[X        RZ                  " UU[7        USS5      S[7        USS5      UUU
S9nU Ro                  UURp                  R                  5       5      n[W        UUS5      nUU R                   Rr                  U'   [X        Rt                  " U5      sSSS5        sSSS5        sSSS5        $ s  snnf s  snf ! , (       d  f       O= fSSS5        O! , (       d  f       O= fSSS5        g! , (       d  f       g= f)z%Generate schema for a Pydantic model.NF)checkr   r   r  extra_fields_behaviorallowr   r   __annotations____pydantic_extra__T)is_argumentis_classzEThe type annotation for `__pydantic_extra__` must be `Dict[str, ...]`requiredrK   r   r   inner__pydantic_custom_init____pydantic_post_init__)custom_initr   	post_initconfigrU  rV  )computed_fieldsextras_schema
model_nameouter);r  get_schema_or_refr   __pydantic_decorators__r  r   r   field_validatorsrc  field_serializers
validatorskeysrQ   model_configcore_config_get_model_title_from_configrT   r
   r   model_validatorsr
  r   r   r&  r   r   objectr   ry  rF  rP   eval_type_backport_make_forward_refr!  r5   r   r   r@    _get_args_resolving_forward_refsr   r1  __pydantic_root_model___common_field_schemaapply_model_validatorsr/   model_schemamodel_fields_schemard  _generate_md_field_schema_computed_field_schemar   r   root_validatorsrW   ro   _apply_model_serializersmodel_serializersr  r  )r   r   	model_refmaybe_schemar   r   r  r  r  r   rV  r  r  candidate_clsextras_annotationr   extra_items_type
root_fieldr   r  rj  rk  dfields_schemanew_inner_schemar   s                             r   _model_schemaGenerateSchema._model_schema  s   YY((-1J)'# .- %%F44J(88O(//66800779))002
 :&++-9/"6"6"89 +3+;+;5IN(44S9K55cJE*AY_b9p8qrH)::AAC++00@$B]B]BbBbcfBg44 $??#:;wF;;q>S000;;r?f444),Sb)9,3MCTVX,Y,],]0$-) -8)*;SAA4A4T4T$1$C$C(9uW[%& %)$9$9	5" 1 ",,=!>B!$5&C$k'" !" 04/T/T 1)- 0U 0  0!,  0s:040D0DEU0V %/ *:2 ..!%!:!:66&>S]!^J#-h#7L#9,HXZa#bL#.#;#;$$+C1KT$R#'")#/G"N*%!)	$L =H<[<[Y_YeYeYghYgQUQRTUD::1aLLYgh &5%;%;%=)%= !77:;W;WX%=) '4#&<<=M $4M:C]C]CdCdCfhl#mL'CLRoRq'r$'3'7#9,HXZa#bL#.#;#;$$+C1KT$R#(")#/G"N*%!)	$L 66|ZEaEaEhEhEjk/8H'R39		%%i0">>yIY ChBg@@- .-L i)c ChBg@@@- .--su   SD$SR3-BR2B
R B$R$!RR&R C2R2	R3;	SR
R'#R3*	S3
S	=S
Sc                    Uc  gUR                   (       a  UR                   $ UR                  nU(       a:  U" U 5      n[        U[        5      (       d  [	        SU SUR
                   35      eU$ g)zfGet the title of a model if `model_title_generator` or `title` are set in the config, else return NoneNzmodel_title_generator  must return str, not )r   model_title_generatorry  rF  r   r   )modelr  r  r   s       r   r  +GenerateSchema._get_model_title_from_config  st    
 !!''' . D D )%0EeS))"89N8OOefkfufuev wxxLr   c                t    US   S:X  a.  U R                   R                  nUS    H
  nX2US   '   M     US   $ U$ )zeUnpack all 'definitions' schemas into `GenerateSchema.defs.definitions`
and return the inner schema.
r   r  rU  r   )r  r  )r   r   r  ss       r   _unpack_refs_defs GenerateSchema._unpack_refs_defs  sJ     &>]*))//KM*()AeH% +(##r   c           	        [        U5      (       a  U R                  R                  5       nU R                  R	                  U5       u  p4Ub  UsSSS5        $  SSS5        XL a  SnOSn[        USS5      =nb  U" U[        U R                  XS95      nO[        USS5      =nb.  [        U[        5      (       d  UR                  SS5      U:X  a  UnOb[        USS5      =n	bQ  [        S	[        5        [        R                  " U	" 5        V
s/ s H  n
[        R                  " U
5      PM     sn
5      nOgU R                  U5      n[!        U5      (       a!  US
   R#                  SS5      nU(       a  XS'   O[%        U5      nU(       a.  XpR                  R&                  U'   [        R(                  " U5      $ U$ ! , (       d  f       GNh= fs  sn
f )a  Try to generate schema from either the `__get_pydantic_core_schema__` function or
`__pydantic_core_schema__` property.

Note: `__get_pydantic_core_schema__` takes priority so it can
decide whether to use a `__pydantic_core_schema__` attribute, or generate a fresh schema.
Nunpackzto-def__get_pydantic_core_schema__)ref_mode__pydantic_core_schema__r   __get_validators__zc`__get_validators__` is deprecated and will be removed, use `__get_pydantic_core_schema__` instead.r   rU  )rx   r  r   r  r  r   rt   r  ry  rs   r(   rJ   r/   chain_schema"with_info_plain_validator_functionr  rZ   r   rX   r  r  )r   r  sourcerZ  r  r  
get_schemar   existing_schemar  rk  rU  s               r   r  -GenerateSchema._generate_schema_from_property   s    ''++-CYY((-1B!'# .-' . =HH "#'EtLLJY4T5P5PRVjF !(-G NN_[??##E40C7$F#C)=tDDjQu) !--jtjv.wjvef{/]/]^_/`jv.wxF ''/(00"&&ud3C #u&/C)/II!!#&::3??W .-2 /xs   F9 G9
Gc                >    [         R                  " XR                  S9n[        U[        5      (       a  [	        UR                  SU 35      eU R                  (       a  [        XR                  5      nU$ ! [         a  n[        R
                  " U5      UeS nAff = f)N)globalnsz%Unable to evaluate forward reference )rP   r  r!  	NameErrorrA   from_name_errorry  r   __forward_arg__r  rp   )r   r  es      r   _resolve_forward_ref#GenerateSchema._resolve_forward_refW  s    	H223AVAVWC
 c:&&-c.A.AEjknjoCpqq%7%78C
  	H-==a@aG	Hs   A6 6
B BBc                    g r   r  )r   r  r  s      r   r  /GenerateSchema._get_args_resolving_forward_refsm  s    fir   c                    g r   r  r  s     r   r  r  p  s    TWr   c           	         [        U5      nU(       aD  [        U Vs/ s H+  n[        U[        5      (       a  U R	                  U5      OUPM-     sn5      nU$ U(       a  [        SU S35      eU$ s  snf )Nz	Expected z+ to have generic parameters but it had none)r4   r   ry  r   r  r   )r   r  r  argsr  s        r   r  r  s  st    }dhidh_`*Q
:S:S$33A6YZZdhijD  iu,WXYY js   2A/c                H    U R                  U5      nU(       d  [        $ US   $ )Nr   )r  r   )r   r  r  s      r   _get_first_arg_or_any$GenerateSchema._get_first_arg_or_any{  s#    44S9JAwr   c                    U R                  U5      nU(       d  [        [        4$ [        U5      S:  a  [        U5      n[	        SU S35      eUS   US   4$ )Nr7   z Expected two type arguments for z, got 1r   rK   )r  r   lenr5   r   )r   r  r  origins       r   _get_first_two_args_or_any)GenerateSchema._get_first_two_args_or_any  s[    44S9:t9q=_F>vhgNOOAwQr   c                f   [        U5      (       a  U R                  U5      $ [        U[        5      (       a  U$ [        U[        5      (       a  [        U5      n[        U[
        5      (       a   U R                  U R                  U5      5      $ [        5       n[        X5      (       a6  U R                  R                  U5         U R                  U5      sS S S 5        $ [        U[        5      (       a  [        R                  " UR                   S9$ U R#                  U5      $ ! , (       d  f       NR= f)N)
schema_ref)rv   _annotated_schemary  r   rF  r   r1  r  rq   rz   r  r   r  rl   r/   r  type_ref
match_type)r   r  r~   s      r   r  %GenerateSchema._generate_schema_inner  s    ))#..c4  Jc3S/Cc:&&''(A(A#(FGG,.	c--&&++C0))#. 10 c/00::cllSSs## 10s   D""
D0c                f   U[         L a  U R                  5       $ U[        L a  [        R                  " 5       $ U[
        L a  [        R                  " 5       $ U[        L a  [        R                  " 5       $ U[        L a  [        R                  " 5       $ U[        L a  [        R                  " 5       $ U[        L d	  U[        L a  [        R                  " 5       $ U[         R"                  L a  [        R$                  " 5       $ U[         R                   L a  [        R&                  " 5       $ U[         R(                  L a  [        R*                  " 5       $ U[         R,                  L a  [        R.                  " 5       $ U[0        L a  [        R2                  " 5       $ U[4        L a  [        R6                  " 5       $ U[8        L a  [        R:                  " 5       $ U[<        L a  [        R>                  " 5       $ Ub  U[@        RB                  L a  [        RD                  " 5       $ U[F        ;   a  U RI                  U5      $ U[J        ;   a  U RM                  U5      $ U[N        ;   a  U RQ                  [        5      $ U[R        ;   a  U RU                  [        5      $ U[V        ;   a  U RY                  [        5      $ U[Z        ;   a  U R]                  [        5      $ U[^        ;   a  U Ra                  [        [        5      $ [c        U[d        5      (       a  U Rg                  U5      $ U[h        L a  U Rk                  5       $ [@        Rl                  " U5      (       a  [        Rn                  " 5       $ [@        Rp                  " U5      (       a  U Rs                  U5      $ [u        U5      (       a  U Rw                  US5      $ [@        Rx                  " U5      (       a  U R{                  US5      $ [@        R|                  " U5      (       a  U R                  UR                  5      $ U[        R                  :X  a  U R                  U5      $ U[        R                  R                  L d  U[        R                  L a  U R                  5       $ [c        U[        R                  5      (       a  U R                  U5      $ [        U5      (       a>  U[        L a  [        R                  " 5       $ U R                  U R                  U5      5      $ [c        U[        [        [        [        45      (       a  U R                  U5      $ [        R                  " U5      (       a&  [        U[        5      (       a  U R                  U5      $ [        U5      (       a  U R                  5       $ [@        R                  " U5      (       a  U R                  US5      $ [        U5      nUb  U R                  X5      $ U R                  US5      nUb  Uu  pEU R                  XE5      $ U R                  (       a  U R                  U5      $ U R                  U5      $ )a  Main mapping of types to schemas.

The general structure is a series of if statements starting with the simple cases
(non-generic primitive types) and then handling generics and other more complex cases.

Each case either generates a schema directly, calls into a public user-overridable method
(like `GenerateSchema.tuple_variable_schema`) or calls into a private method that handles some
boilerplate before calling into the user-facing method (e.g. `GenerateSchema._tuple_schema`).

The idea is that we'll evolve this into adding more and more user facing methods over time
as they get requested and we figure out what the right API for them is.
Nr  )crF  r-  bytesr/   bytes_schemarE  
int_schemarG  float_schemaboolbool_schemacomplexcomplex_schemar   r  r   datetimedatedate_schemadatetime_schematimetime_schema	timedeltatimedelta_schemar   decimal_schemar'   uuid_schemar.   
url_schemar*   multi_host_url_schemarP   NoneTypenone_schemar   r  r   _tuple_schemar   r4  r   r>  r   rB  r   _sequence_schemar   r:  ry  r2   _type_alias_type_schemar   _type_schemais_callable_typecallable_schemais_literal_type_literal_schemar6   _typed_dict_schemais_namedtuple_namedtuple_schemais_new_typer1  __supertype__rePattern_pattern_schemacollectionsabcHashabletyping_hashable_schemar#   _unsubstituted_typevar_schemarw   r   r  r   r   r   r
   _callable_schemar   isclassr   r	   rn  ry   _zoneinfo_schemais_dataclass_dataclass_schemar5   _match_generic_type0_get_prepare_pydantic_annotations_for_known_type_apply_annotationsr*  r  r  )r   r  r  ressource_typer   s         r   r#  GenerateSchema.match_type  s    #:??$$E\++--CZ))++E\++--D[**,,G^--//CZ3&=))++HMM!**,,H%%%..00HMM!**,,H&&&//11G^--//D[**,,CZ))++L 4466[C=#9#99**,,H_??3''K%%c**J$$S))I##C(($$))#..N"((--J$$S#..]++//44D[$$&&++C00..00**3//'',,#**355((--**355&&s++''(9(9::BJJ'',,KOO,,,v0F((**V^^,,55c::e|"--//''**3/  lJ
GLMM((--__S!!jd&;&;$$S))c""((**%%c**))#t44C++C88CCCL?'*$K**;DD  ..s33((--r   c                   [        U[        5      (       a  U R                  U5      $ [        R                  " U5      (       a  U R                  X5      $ [        R                  " U5      (       a  U R                  X5      $ U R                  X!5      nUb  U$ [        R                  " U5      (       a  U R                  U5      $ U[        ;   a  U R                  U5      $ U[        ;   a   U R                  U R                  U5      5      $ U[         ;   a   U R#                  U R                  U5      5      $ U[$        ;   a   U R'                  U R                  U5      5      $ U[(        ;   a  U R*                  " U R-                  U5      6 $ [/        U5      (       a  U R1                  X5      $ U[2        R4                  [6        4;   a  U R9                  U5      $ U[:        ;   a   U R=                  U R                  U5      5      $ U[2        R>                  [@        RB                  R>                  [2        RD                  [@        RB                  RD                  1;   a  U RG                  U5      $ U[H        RJ                  [2        RJ                  4;   a  U RM                  U5      $ U RO                  US5      nUb  Uu  pVU RQ                  XV5      $ U RR                  (       a  U RU                  U5      $ U RW                  U5      $ )Nr  ),ry  r2   r>  rP   rU  rV  rE  rF  r  origin_is_union_union_schemar   r<  r   r4  r  r   r>  r   rB  r   r:  r  r6   rD  rO  r"   r   _subclass_schemar   r=  r   rL  rM  	Generator_iterable_schemarI  rJ  rK  rX  rY  r*  r  r  )r   r  r  r  rZ  r[  r   s          r   rW  "GenerateSchema._match_generic_type  st   fm,,//44 %%f--))#66&&v..**377;;FH$  ((00%%c**{"%%c**z!$$T%?%?%DEEy ##D$>$>s$CDD''))$*D*DS*IJJz!$$d&E&Ec&JKK&!!**377T**((--~%(()C)CC)HII)A)A6CSCSU`UdUdUnUnoo((--

FNN33'',,CCCL?'*$K**;DD  ..v66((--r   r  c          	         U R                  XU5      n[        R                  " US   UR                  5       (       d  SOUUS   US   US   US   S9$ )zAPrepare a TypedDictField to represent a model or typeddict field.r   Fserialization_excludevalidation_aliasserialization_aliasrV  )r  re  rf  rg  rV  )r  r/   typed_dict_fieldis_required)r   name
field_infor   r  common_fields         r   _generate_td_field_schema(GenerateSchema._generate_td_field_schemaA  sg     00:N++"","8"8":":U"./F"G)*<= ,-B C!*-
 	
r   c           	     |    U R                  XU5      n[        R                  " US   US   US   US   US   US   S9$ )z0Prepare a ModelField to represent a model field.r   re  rf  rg  frozenrV  re  rf  rg  rp  rV  )r  r/   model_fieldr   rj  rk  r   rl  s        r   r  (GenerateSchema._generate_md_field_schemaT  s\     00:N&&""./F"G)*<= ,-B C)!*-
 	
r   c                    U R                  XU5      n[        R                  " UUS   UR                  UR                  =(       d    SUR
                  (       a  SOSUS   US   US   US   US   S	9
$ )
zJPrepare a DataclassField to represent the parameter/field, of a dataclass.r   NFre  rf  rg  rp  rV  )init	init_onlykw_onlyre  rf  rg  rp  rV  )r  r/   dataclass_fieldrv  init_varrx  rs  s        r   _generate_dc_field_schema(GenerateSchema._generate_dc_field_schemae  s     00:N**" ))1T&..DE"./F"G)*<= ,-B C)!*-
 	
r   c                   UR                   b8  UR                   S::  d(  UR                  b  UR                  b  UR                  Gc%  Su  p4n[	        U [
        5      (       a  U R                  U5      u  p4nOM[	        U [        5      (       a8  U " U5      n[	        U[        5      (       d  [        SU  SUR                   35      eUR                   b  UR                   S::  a  SUl         UR                   S:X  a&  [        XS5      Ul        [        XC5      Ul        X1l        UR                  c  X1l        UR                  c  [        XS5      Ul        UR                  c  [        XC5      Ul        ggg)a\  Apply an alias_generator to aliases on a FieldInfo instance if appropriate.

Args:
    alias_generator: A callable that takes a string and returns a string, or an AliasGenerator instance.
    field_info: The FieldInfo instance to which the alias_generator is (maybe) applied.
    field_name: The name of the field from which to generate the alias.
NrK   NNNalias_generator r  )alias_priorityaliasrf  rg  ry  r9   generate_aliasesr   rF  r   r   r  )alias_generatorrk  r   r  rf  rg  s         r   $_apply_alias_generator_to_field_info3GenerateSchema._apply_alias_generator_to_field_infoz  s`    %%-((A-'**2--5;K8E%8/>::?N?_?_`j?k<)<OX66'
3!%--#&66GG]^c^m^m]n$opp
 ((0J4M4MQR4R,-
) ((A-1DEX1`
..ABR.Z
+#(  '#( --51DEX1`
.**2.ABR.Z
+ 39 6r   c                   UR                   b  UR                   S::  d  UR                  c  Su  p4n[        U [        5      (       a  U R	                  U5      u  p4nOM[        U [
        5      (       a8  U " U5      n[        U[        5      (       d  [        SU  SUR                   35      eUR                   b  UR                   S::  a  SUl         UR                   S:X  a  [        XS5      Ul        ggg)a  Apply an alias_generator to alias on a ComputedFieldInfo instance if appropriate.

Args:
    alias_generator: A callable that takes a string and returns a string, or an AliasGenerator instance.
    computed_field_info: The ComputedFieldInfo instance to which the alias_generator is (maybe) applied.
    computed_field_name: The name of the computed field from which to generate the alias.
NrK   r~  r  r  )
r  r  ry  r9   r  r   rF  r   r   r  )r  computed_field_infocomputed_field_namer  rf  rg  s         r   -_apply_alias_generator_to_computed_field_info<GenerateSchema._apply_alias_generator_to_computed_field_info  s    $  ..6"11Q6"((0;K8E%8/>::?N?_?_`s?t<)<OX66'(;<!%--#&66GG]^c^m^m]n$opp
 #119=P=_=_cd=d56#2
 #11Q6,?@S,[#) 7) 1r   c                    UR                   =(       d    U R                   nUc  gUR                  c?  U" X!5      n[        U[        5      (       d  [	        SU SUR
                   35      eXAl        gg)a=  Apply a field_title_generator on a FieldInfo or ComputedFieldInfo instance if appropriate
Args:
    config_wrapper: The config of the model
    field_info: The FieldInfo or ComputedField instance to which the title_generator is (maybe) applied.
    field_name: The name of the field from which to generate the title.
Nzfield_title_generator r  )field_title_generatorr   ry  rF  r   r   )r  rk  r   r  r   s        r   *_apply_field_title_generator_to_field_info9GenerateSchema._apply_field_title_generator_to_field_info  sv     !+ @ @ hNDhDh (#)*AEeS))"89N8OOefkfufuev wxx$ $r   c           	     	  ^ ^ [        5       n[        TR                  [        [        45      (       GaY  T R
                  nT R                  (       ab  U=(       d    0 R                  5       nUR                  T R                  R                  5        VVs0 s H  u  pgUR                  U_M     snn5        [        R                  " TR                  U5      nUTR                  La  [        U[        5      (       d  UR                  " U5      n	U	R                  Tl        U	R                  R                  5        H5  u  pgUTR                  ;  d  M  UTR                   ;  d  M)  [#        TXg5        M7     / U	R$                  QTR$                  QTl        TR                  TR$                  pSUU 4S jjn/ n['        UR(                  R+                  5       U5       H>  nUR-                  [.        UR0                  R2                     R5                  U5      5        M@     T R6                  R9                  U5         TR:                  b  T R=                  XU-   US9nOT R=                  U
X-   5      nS S S 5        ['        UR>                  R+                  5       U5      n[A        U5      (       a  STl!        U Vs/ s H  owR0                  RD                  SL d  M  UPM!     nnU Vs/ s H  owU;  d  M
  UPM     nn[G        WUU5      n[I        UUU5      nTRK                  5       (       d  [M        TU5      nT RO                  U['        URP                  R+                  5       U5      5      nT RS                  T RT                  TU5        TRV                  TRX                  [[        TR\                  5      =(       d    TR\                  S:H  =(       d    S [_        TR`                  5      S.nUR                  5        VVs0 s H  u  pgUc  M
  Xg_M     nnnTRb                  n[e        [g        UU5      /S9nT RT                  Rh                  nUb  T Rk                  UTU5        [m        TRn                  [p        [r        45      (       a  TRn                  Ru                  5       nOTRn                  n[w        UTRx                  (       a  SOS UTRz                  TR|                  US9$ s  snnf ! , (       d  f       GNw= fs  snf s  snf s  snnf )	Nc                @   > TR                  U TR                  5      n U $ r   )r  r  )r   rk  r   s    r   set_discriminator>GenerateSchema._common_field_schema.<locals>.set_discriminator  s     77
@X@XYFMr   )transform_inner_schemaT )r   r   
deprecatedexamplesjs_annotation_functionsrq  r   r)   r   r)   )?rr   rn   
annotationr   rF  r!  r  r   r   rd  r   rP   eval_type_lenientrl   from_annotation_attributes_setmetadata_lookupsetattrrV  r   r  rc  r   r   r   mode_from_decoratorr  r   r  rY  r  $_validators_require_validate_defaultvalidate_default	each_itemr   r   ri  wrap_default_apply_field_serializersr  r  r  r   r   r*  r  r0   r  json_schema_extrarT   get_json_schema_update_funcr  r  ry  rf  r8   r:   convert_to_aliases_common_fieldexcluderg  rp  )r   rj  rk  r   r}   r   rj  rk  	evaluatednew_field_infor[  r   r  validators_from_decorators	decoratorr   this_field_validatorsr   json_schema_updatesr  rV  r  rf  s   ` `                    r   r  #GenerateSchema._common_field_schema  sc    -.	
 5 5
C7HII"33O!!#2#8b">">"@&&$BTBTBZBZB\']B\$!

AB\']^%77
8M8M_I
 5 55>RS\^r>s>s!*!:!:9!E(6(A(A
% +::@@BDA
 
 : ::q
HbHb?b
A1 C 'W(?(?&V*BUBU&V
##-#8#8*:M:M[	 	
 &("=j>Y>Y>`>`>bdhiI&--.@ATAT.U.e.efo.pq j ""''-''300/I!Ibs 1  00< . !EZEZEZEaEaEcei j/0EFF*.J'+@]+@aFFDTDTX\D\+@],A c,AqNbEb,A c+F4H$O!&*?F
 %%''!*f5F..89U9U9\9\9^`de
 	778L8LjZ^_  %%%11z445\9N9NRT9T\X\*:+>+>?	
 1D0I0I0K]0Kqtqt0K]&88&%@ATVg%h$i
 ..>>&55ozSWXj11L)3LMM)::MMO)::*4*<*<$$- * > >$$
 	
q (^< .-$  ^ c, ^s6   S
/6S,S'S'	S,%S,,	S19S1
S$c                   U R                  USS9n/ nSnU H=  nUb  U[        R                  L a  SnM  UR                  U R	                  U5      5        M?     [        U5      S:X  a  US   nOx/ nU HZ  nUR                  S0 5      R                  [        R                  5      n	U	b  UR                  X45        MI  UR                  U5        M\     [        R                  " U5      nU(       a  [        R                  " U5      nU$ )zGenerate schema for a Union.Tr  FrK   r   rV  )r  rP   r:  r   r1  r  r   rL   TAGGED_UNION_TAG_KEYr/   union_schemanullable_schema)
r   
union_typer  choicesr   argr  choices_with_tagschoicetags
             r   r_  GenerateSchema._union_schemaY  s    44Z$4O$&C{c]%;%;;t33C89	  w<1
AKM!jjR044[5U5UV?%,,f];%,,V4 " (():;A++A.Ar   c                B   U R                   R                  U5       u  p#Ub  UsS S S 5        $ [        U5      =(       d    UnUR                  n[	        U5      nU R
                  R                  U5         [        R                  " XPR                  5      n[        XV5      nU R                  U5      nUS   S:w  d   eX'S'   S S S 5        WU R                   R                  U'   [        R                  " U5      sS S S 5        $ ! , (       d  f       NF= f! , (       d  f       g = f)Nr   r  rU  )r  r  r5   	__value__rm   r   r   rP   r  r!  rp   r1  r  r/   r  )r   r  rU  r  r  r  r  r   s           r   r>  &GenerateSchema._type_alias_type_schemat  s     YY((-1D#'# .-  _+F))J4S9L,,11&9*<<ZI^I^_
*:D
--j9f~666 #u : *0DII!!#&::3?! .- :9 .-s*   DAD3AC??6D?
D		D
Dc                   [         R                  " U5      nU(       d
   SU 35       e[        R                  " U5      nU R                  R
                  (       a/  [        S U 5       5      (       a  [        R                  " S U5      nU$ )zGenerate schema for a Literal.z(literal "expected" cannot be empty, obj=c              3  B   #    U  H  n[        U[        5      v   M     g 7fr   )ry  r	   ).0rk  s     r   	<genexpr>1GenerateSchema._literal_schema.<locals>.<genexpr>  s     7^U]PQ
1d8K8KU]s   c                H    [        U [        5      (       a  U R                  $ U $ r   )ry  r	   rW  )rk  s    r   rK  0GenerateSchema._literal_schema.<locals>.<lambda>  s    Z4%8%8!''?a?r   )rP   all_literal_valuesr/   literal_schemar  rg  anyrh  )r   literal_typeexpectedr   s       r   rC  GenerateSchema._literal_schema  ss     33LARCL>RRx++H5//C7^U]7^4^4^ AA?F r   c                   [        5       nU R                  R                  U5         U R                  R	                  U5       u  nnUb  UsSSS5        sSSS5        $ [        U5      nUb  Un[        (       d#  [        U5      R                  S:X  a
  [        SSS9e [        US5      nU R                  R                  U5         U R                  R                  U5         U R                  R                  U5      nU R                   n UR"                  n	0 n
[$        R&                  " U5      nU R                  R(                  (       a  [+        USS9nOSn[-        XR.                  5      R1                  5        H  u  p[3        X5      nX;   n[5        U5      [6        R8                  :X  a  SnU R;                  USS	9S
   nO2[5        U5      [6        R<                  :X  a  SnU R;                  USS	9S
   nUR>                  " U5      nUb  UR@                  c  X;   a	  X   Ul         U RC                  U R                  UU5        U RE                  UUXS	9X'   M     U RG                  U[I        U5      5      n[K        [M        [N        UUS9/S9n[P        RR                  " U
UURT                  RW                  5        Vs/ s H  nU RY                  UURZ                  5      PM!     snUUUS9nU R]                  UUR^                  RW                  5       5      n[a        UURb                  RW                  5       S5      nUU R                  Rd                  U'   [P        Rf                  " U5      sSSS5        sSSS5        sSSS5        sSSS5        $ ! [         a    Sn GNf = fs  snf ! , (       d  f       O= fSSS5        O! , (       d  f       O= fSSS5        O! , (       d  f       O= fSSS5        g! , (       d  f       g= f)a2  Generate schema for a TypedDict.

It is not possible to track required/optional keys in TypedDict without __required_keys__
since TypedDict.__new__ erases the base classes (it replaces them with just `dict`)
and thus we can track usage of total=True/False
__required_keys__ was added in Python 3.9
(https://github.com/miss-islington/cpython/blob/1e9939657dd1f8eb9f596f77c1084d2d351172fc/Doc/library/typing.rst?plain=1#L1546-L1548)
however it is buggy
(https://github.com/python/typing_extensions/blob/ac52ac5f2cb0e00e7988bae1e2a1b8257ac88d6d/src/typing_extensions.py#L657-L666).

On 3.11 but < 3.12 TypedDict does not preserve inheritance information.

Hence to avoid creating validators that do not do what users expect we only
support typing.TypedDict on Python >= 3.12 or typing_extension.TypedDict on all versions
NrO  zXPlease use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.12.ztyped-dict-versionr   __pydantic_config__T)use_inspectr  r   Fr  r  )r   r  rU  rV  r  all)4rr   r  r   r  r  rm   _SUPPORTS_TYPEDDICTr   r   rB   rf   AttributeErrorr
  r   r  r  r&  __required_keys__r_   builduse_attribute_docstringsrj   ru   r!  rd  rp   r5   rP   Requiredr  NotRequiredr  r   r  rm  r  rQ   rT   r
   r   r/   typed_dict_schemar  rc  r  r  r  r  r  r  r  r  )r   typed_dict_clsr  r}   typed_dict_refr  r  r  r  required_keysr   r   field_docstringsr   r  r  rk  r   rV  r  	td_schemar   s                         r   rD  !GenerateSchema._typed_dict_schema  s     -.	""''79T9TUc9d i
'# :e9d77 5^DL!!'&&4+?+J+Jh+V'n- 
,D^Uj,k ++008$:U:U:Z:Z[i:j"22>>~N440>0P0P@B+11.A
''@@'B>_c'd$'+$.HYnYn.o.u.u.w*J!.z!HJ):H!*-1G1GG#'%)%J%J&%) &K & &
 $J/=3L3LL#(%)%J%J&%) &K & &

 "+!:!::!FJ(4&22:&:1A1M
.CCDDXDXZdfpq)-)G)G"J
 *H *F&3 /x: 99.-X^J_`.")*B^c"d!e (99& ",!;!;!B!B!D%!DA 33Az7S7ST!D% '%&
	 66y*B^B^BeBeBgh/
8S8S8Z8Z8\^cd8>		%%n5">>~NA ;k:j88- :e9d77& " n%i ;k:j888- :e9d9d777s   O)O
	O)>ON(ON5GN	3&NBN		N5'	O0	O)NONON	
N)%N5,	O5
O?O	O)
O	O))
O7c                   U R                   R                  U5         U R                  R                  U5       u  nnUb  UsSSS5        sSSS5        $ [	        U5      nUb  UnU R
                  R                  U5         [        XR                  5      nU(       d   UR                   Vs0 s H	  ow[        _M     nnU(       a.  UR                  5        VV	s0 s H  u  pU[        X5      _M     nnn	[        R                  " UR                  5        VV	s/ s H>  u  pU R                  UU	UR                  R!                  U["        R$                  5      S9PM@     sn	n['        SS9S9n
[        R(                  " XUS9sSSS5        sSSS5        sSSS5        $ s  snf s  sn	nf s  sn	nf ! , (       d  f       O= f SSS5        O! , (       d  f       O= fSSS5        g! , (       d  f       g= f)z!Generate schema for a NamedTuple.N)defaultT)js_prefer_positional_argumentsr`  )rU  )r  r   r  r  rm   r   ru   r!  _fieldsr   rd  rp   r/   arguments_schema_generate_parameter_schema_field_defaultsr   r   emptyrT   call_schema)r   namedtuple_clsr  namedtuple_refr  r  r   rj  r   r  r  s              r   rF  !GenerateSchema._namedtuple_schema  s   ""''79T9TUc9d i
'# :e9d77 5^DL!!',,11.A.HYnYn.o"3A3I3I"J3Iac63IK"J 7B6G6G6I#6I2J #M*$KK6I   #
 $/#?#? 7B6G6G6I 7J2J 77&&$2$B$B$F$FzS\SbSb$c 8 
 7J 1PTU
$  #../?Ucd/ BA :e9d77 #K# BAA :e9d9d777sw   GG 	G+G>+F')F
9F'F-&F'AF!"F':	G	GF''
F51G9	G
G	G
G*c                   [        5       nU[        R                  L a  UR                  " U5      nOUR                  " X#5      nUR
                  c   S5       eUR
                  UR                  pU R                  R                  U5         U R                  Xx5      n	SSS5        UR                  5       (       d  [        UW	5      n	[        R                  " UW	5      n
Ub  XJS'   UR                  b  UR                  U
S'   U
$ U R                  R                   n[#        U[$        5      (       a#  UR                  b  UR                  U5      U
S'   U
$ [#        U[&        5      (       a  U" U5      U
S'   U
$ ! , (       d  f       N= f)zXPrepare a ArgumentsParameter to represent a field in a namedtuple or function signature.Nz<field.annotation should not be None when generating a schemar  r  )rr   r   r  r  from_annotated_attributer  rV  r  r   rY  ri  r  r/   arguments_parameterr  r  r  ry  r9   r   )r   rj  r  r  r  r}   r   r[  r   r   parameter_schemar  s               r   r  )GenerateSchema._generate_parameter_schema&  s`    -.	ioo%--j9E66zKE+k-kk+#(#3#3U^^[""''-,,[FF .   ""!%0F&::4H'+V$;;"(-W%   #22BBO/>::?T?T?`,;,A,A$,G )   OX66,;D,A )# .-s   	E00
E>c                  ^ [        U5      mU R                  U5      nT(       a  U(       a  [        U4S jU 5       5      nU(       dI  U[        ;   a)  [        R
                  " [        R                  " 5       /SS9$ [        R
                  " / 5      $ US   [        L aB  [        U5      S:X  a(  [        R
                  " U R                  US   5      /SS9$ [        S5      e[        U5      S:X  a  US   S:X  a  [        R
                  " / 5      $ [        R
                  " U Vs/ s H  o0R                  U5      PM     sn5      $ s  snf )	zIGenerate schema for a Tuple, e.g. `tuple[int, str]` or `tuple[int, ...]`.c              3  <   >#    U  H  n[        UT5      v   M     g 7fr   )rp   )r  paramr  s     r   r  /GenerateSchema._tuple_schema.<locals>.<genexpr>P  s     R6%===6s   r   )r   r   r7   z&Variable tuples can only have one typerK   r  )rm   r  r   r   r/   tuple_schemar   Ellipsisr  r1  
ValueError)r   
tuple_typeparamsr  r  s       @r   r<  GenerateSchema._tuple_schemaI  s    1<66zBFR6RRF [("//1G1G1I0J`abb #//33BZ8#6{a"//1E1EfQi1P0Qghii !!IJJ[A&)r/ ++B//++V\,]V\U-A-A%-HV\,]^^,]s   !Ec                ^    [         R                  " [         R                  " [        5      SSS9$ )Nis_typezInput should be a typecustom_error_typecustom_error_message)r/   custom_error_schemari  r   r   s    r   r?  GenerateSchema._type_schemag  s)    ..**40'!9
 	
r   c                   ^^ [         R                  S:  a   S5       eSSKJmJm  S	UU4S jjn[        S /S9n[        R                  " U[        R                  " 5       US9$ )
z/Generate schema for a zone_info.ZoneInfo object)r   	   Unreachabler   )ZoneInfoZoneInfoNotFoundErrorc                  > [        U T5      (       a  U $  T" U 5      $ ! T[        [        4 a    [        SSSU 05      ef = f)Nzoneinfo_strzinvalid timezone: {value}rW  )ry  r  r   r+   )rW  r  r  s    r   validate_str_is_valid_iana_tzFGenerateSchema._zoneinfo_schema.<locals>.validate_str_is_valid_iana_tzw  sT    %**i&):yA i).:UX_afWghhis    !?c                    SSS.$ )Nr  zoneinfor  r  r  r  s     r   rK  1GenerateSchema._zoneinfo_schema.<locals>.<lambda>  s
    XakDlr   r  r   rV  )rW  r   r   r  )	sysversion_infor  r  r  rT   r/   r  to_string_ser_schema)r   r	  rV  r  r  s      @@r   rT  GenerateSchema._zoneinfo_scheman  sc     f$'-'5 	=	i 	i '5l4mn;;)%::<
 	
r   c           	         U R                  USS9n[        R                  " U Vs/ s H$  o R                  [        R
                  U   5      PM&     sn5      $ s  snf )z*Generate schema for `Type[Union[X, ...]]`.Tr  )r  r/   r  r1  rO  r"   )r   r  r  s      r   _union_is_subclass_schema(GenerateSchema._union_is_subclass_schema  sP    44Z$4O'']a(b]aUY)=)=fkk$>O)P]a(bcc(bs   +Ac           	     J   U R                  U5      n[        R                  " U5      =(       d    UnU[        :X  a  U R	                  5       $ [        U[        R                  5      (       a  UR                  (       ai  [        R                  " [        UR                  5      5      (       a  U R                  UR                  5      $ [        R                  " UR                  5      $ UR                  (       aP  [        R                  " UR                   Vs/ s H$  o0R!                  [        R"                  U   5      PM&     sn5      $ U R	                  5       $ [        R                  " [        U5      5      (       a  U R                  U5      $ [        R                  " U5      $ s  snf )z-Generate schema for a Type, e.g. `Type[int]`.)r  rP   annotated_typer   r?  ry  rO  r#   	__bound__r^  r5   r  r/   is_subclass_schema__constraints__r  r1  r"   )r   type_
type_paramcs       r   r`  GenerateSchema._subclass_schema  s8   //6
"11*=K
$$&&
FNN33## 00J<P<P1QRR99*:N:NOO"55j6J6JKK++"//CMC]C]^C]a))&++a.9C]^  ((****:j+ABB11*==11*== _s   +F c                   SSK Jn  U R                  U5      n[        R                  " U5      n[        U5      n[        R                  " [        R                  SS9nU[        :w  a2  SSK
Jn  [        R                  " U[        R                  " Xt5      /5      n[        R                  " X#SS9n[        R                  " XVUS9$ )	z5Generate schema for a Sequence, e.g. `Sequence[int]`.rK   )serialize_sequence_via_listSequence)cls_repr)sequence_validatorT)r   info_arg)r   r}  r   )_serializersr!  r1  r/   r0  r{   ri  rO  r"  r   r  r$  r  no_info_wrap_validator_function#wrap_serializer_function_ser_schemar  )	r   r3  r!  item_type_schemar0  r   r}  r$  r   s	            r   r=  GenerateSchema._sequence_schema  s    =//
;!--.>?$[1#66vQ[\7'44 K KL^ lmM $GG'4
 00#P]
 	
r   c                n    U R                  U5      n[        R                  " U R                  U5      5      $ )z$Generate a schema for an `Iterable`.)r  r/   generator_schemar1  )r   r  	item_types      r   rb  GenerateSchema._iterable_schema  s.    ..u5	++D,@,@,KLLr   c                   SSK Jn  [        S /S9n[        R                  " [        S5      S[        R                  " 5       S9nU[        R                  :X  d  U[        R                  :X  a  [        R                  " UR                  XCS9$ U R                  US	S
9S   nU[        L a  [        R                  " UR                  XCS9$ U[        L a  [        R                  " UR                   XCS9$ [#        SU< S35      e)NrK   )r  c                    SSS.$ )Nr  regexr  r  r  s     r   rK  0GenerateSchema._pattern_schema.<locals>.<lambda>  s
    XahDir   r  patternr   )r   return_schemar  Tr  r   r  r   )r  r  rT   r/   r   r   r-  rO  rJ  rI  r  pattern_either_validatorr  rF  pattern_str_validatorr&  pattern_bytes_validatorr@   )r   pattern_typer  rV  serr  s         r   rK  GenerateSchema._pattern_schema  s    !&5i4jk>>y!V;CYCYC[
 6>>)\RZZ-G??44C  55 6 
  C<??11  e^??333  02^_k^nno0pqqr   c                    [         R                  " [         R                  " [        R                  R
                  5      SSS9$ )Nis_hashablezInput should be hashabler  )r/   r   ri  rL  rM  rN  r   s    r   rP  GenerateSchema._hashable_schema  s3    ..**;??+C+CD+!;
 	
r   c                	  ^ ^ T R                   R                  U5         T R                  R                  U5       u  nnUb  UsSSS5        sSSS5        $ [	        U5      nUb  Un[        5        nUR                   HJ  n[        R                  " U5      (       d  M   UR                  T R                  R                  U5      5        ML     Sn[        UR                  5       HW  n[        R                  " U5      (       d  M   [        USS5      nUR                  T R                  R                  U5      5        MY     T R                  R                  U5      n	T R                   m SSKJn
  U
" U5      (       aP  [%        UR&                  5      nU(       a3  UR)                  5        H  nUR+                  UT R,                  5        M!     O[/        UT R,                  US9nT R                  R0                  R2                  S:X  a6  UR5                  5        H"  u  pUR6                  SL d  M  [9        SU S	3S
S9e   UR:                  R=                  S5      =(       d    [>        R@                  " U5      m[C        UU 4S jUR5                  5        5       S S9n[E        US5      n[E        US5      n[F        RH                  " URJ                  UTRL                  R)                  5        Vs/ s H  nT RO                  UTRP                  5      PM!     snUS9n[S        UTRT                  R)                  5       S5      nTRV                  R)                  5       n[Y        UUS5      nT R[                  U[]        U5      5      n[_        [a        [b        UUS9/S9n[F        Rd                  " UUUU[        Rf                  " U5       Vs/ s H  oRh                  PM     snUU	UT R                  R0                  Rj                  S9	nT Rm                  UTRn                  R)                  5       5      n[Y        UUS5      nUT R                  Rp                  U'   [F        Rr                  " U5      sSSS5        sSSS5        sSSS5        $ s  snf s  snf ! , (       d  f       O= f S5       e! , (       d  f       O= fSSS5        g! , (       d  f       g= f)z Generate schema for a dataclass.Nr  r7   r   )r  r  FzField zd has `init=False` and dataclass has config setting `extra="allow"`. This combination is not allowed.z dataclass-init-false-extra-allowr   r  c              3  L   >#    U  H  u  pTR                  XT5      v   M     g 7fr   )r{  )r  rj  rk  r   r   s      r   r  3GenerateSchema._dataclass_schema.<locals>.<genexpr>  s%     aR`$!T33A*EER`s   !$c                (    U R                  S5      SL$ )Nrx  Fr   )r  s    r   rK  2GenerateSchema._dataclass_schema.<locals>.<lambda>   s    !%%	"2%"?r   )key__post_init__	__slots__)r  collect_init_onlyr  r  r  )r  rU  r   slotsr  rV  rp  r  r  ):r  r   r  r  rm   r   r   r   rU  enter_contextr   reversedr   r
  r  r  r&  r   r   __pydantic_fields__rc  apply_typevars_mapr!  rk   r   extrard  rv  rB   __dict__r   r_   r  sortedhasattrr/   dataclass_args_schemar   r  r  r  r   r  r  r  r  rQ   rT   r
   r   dataclass_schemar   rj  rp  r  r  r  r  )r   	dataclassr  dataclass_refr  r  dataclass_bases_stackdataclass_baser  r  r   r   r   r   r  has_post_init	has_slotsr  args_schemar   r  r   rV  	dc_schemar   r   s   `                        @r   rV   GenerateSchema._dataclass_schema  s0    ""''	2DII4O4OPY4Z _
'# 5[4Z22 5Y?L!"	 5&/&7&7N"//??-;;D<W<W<\<\]k<lm '8
 &.y/@/@&AN"//??!(9NPT!U-;;D<V<V<[<[\b<cd 'B
 #22>>yI44?(33%i&C&CDF#%+]]_E!44\4CXCXY &5 6!--%1F --2288GC-3\\^)
 ::."3"( 5C !D%G#  .< '//334MNqR`RfRfgpRq
 aRXR^R^R`a? !(	? C#I{;	)??&& ",!;!;!B!B!D%!DA 33Az7S7ST!D% '4  0Z=W=W=^=^=`bfg#-#>#>#E#E#G 5lDTV]^99)]SYEZ[.")*B	Y^"_!` (88 +%4?4F4Fy4QR4Q5JJ4QR#&%  55::AA	 66y*B^B^BeBeBgh/8H'R7=		%%m4">>}Mq  5[4Z22D%, S[ x (-'5O 5[4Z222s{   R0R	R0R/)Q>A!Q>D Q>%B<Q>!&Q4B0Q>7Q9BQ>	R!	R04
Q>>
RR
R$	 R00
R>c           	        [        U5      n[        R                  " XR                  S9n[        R
                  S[        R                  S[        R                  S0n/ nSnSnUR                  R                  5        GH  u  pU	R                  UR                  L a   [        R                  " [        [        5      n
OX8   n
UR                  U	R                   5      nUb0  U R#                  XU	R$                  U5      nUR'                  U5        M  U	R                   [        R(                  :X  a  U R+                  U
5      nM  U	R                   [        R,                  :X  d   U	R                   5       eU R+                  U
5      nGM     SnU R.                  nUR0                  (       a%  UR                  S5      nUb  U R+                  U5      n[2        R4                  " [2        R6                  " UUUUR8                  S9UUS9$ )	zcGenerate schema for a Callable.

TODO support functional validators once we support them in Config
)r   positional_onlypositional_or_keywordkeyword_onlyNr   )var_args_schemavar_kwargs_schemapopulate_by_name)r4  )r   rP   get_function_type_hintsr!  r   POSITIONAL_ONLYPOSITIONAL_OR_KEYWORDKEYWORD_ONLY
parametersrd  r  r  rO  r%   r   r   kindr  r  r   VAR_POSITIONALr1  VAR_KEYWORDr  validate_returnr/   r  r  rb  )r   functionsig
type_hintsmode_lookuparguments_listr`  ra  rj  pr  parameter_mode
arg_schemar4  r  return_hints                   r   rR  GenerateSchema._callable_schemaO  s   
 !"::8UjUjk
 %%'8++-D""Nr
 @B9=;?~~++-GD||syy(#[[c2
'-
(__QVV4N)!<<TqyyZhi
%%j19333"&"6"6z"Bvv!6!66>>6$($8$8$D! .  8<--))$..2K& $ 4 4[ A&&(( /"3!/!@!@	 '	
 		
r   c                j   [        U[        R                  5      (       d   eUR                  nUR                  n UR                  5       nUS L[        U5      S:g  -   U-   S:  a  [        S5      eU(       a  U R                  UR                  5      $ U(       a"  U R                  [        R                  U   5      $ U(       a?  U R                  U5      n[        R                  " S [        R                   " 5       S9US'   U$ [        R                   " 5       $ ! [         a    [        USS 5      S Ln Nf = f)N__default__r   rK   zZPydantic does not support mixing more than one of TypeVar bounds, constraints and defaultsc                    U" U 5      $ r   r  )rJ  hs     r   rK  >GenerateSchema._unsubstituted_typevar_schema.<locals>.<lambda>  s    QqTr   )r   r   )ry  rO  r#   r  r  has_defaultr  r   r  NotImplementedErrorr1  rw  r_  r$   r/   r(  r   )r   typevarr   constraintstypevar_has_defaultr   s         r   rQ  ,GenerateSchema._unsubstituted_typevar_schema  s%   '6>>2222!!--	T")"5"5"7
 #k"2a"78;NNQRR%l  ''(;(;<<%%fll;&?@@))%0F&1&U&U!+*@*@*B'F?# M))++)  	T")'=$"Gt"S	Ts   D D21D2c                d  ^  [         R                  " TR                  TR                  R                  U R
                  5      nU[        L a
  [        SSS9e[        X0R                  5      n[        R                  " TR                  US9Tl        U R                  U5      nU R!                  U[#        UR%                  5       TR&                  5      SS9nU R(                  R*                  nUb%  U R-                  UTR                  TR&                  S9  U R/                  U R(                  TR                  TR&                  5        SU4S jjn[1        U/S	9n[2        R4                  " TR&                  UTR                  R6                  US
9$ ! [         a  n[        R                  " U5      UeS nAff = f)NzComputed field is missing return type annotation or specifying `return_type` to the `@computed_field` decorator (e.g. `@computed_field(return_type=int|str)`)zmodel-field-missing-annotationr   )return_typeTcomputed_field)r  r  r  c                  > U" U 5      nSUS'   TR                   R                  nUb  X2S'   TR                   R                  nUb  XBS'   TR                   R                  (       d  TR                   R                  S:X  a  SUS'   TR                   R                  nUb  [        U5      US'   TR                   R                  nUb  [        X&5        U$ )NTreadOnlyr   r   r  r  r  )r   r   r   r  r  r0   r  add_json_schema_extra)r   r   r   r   r   r  r  r  s          r   set_computed_field_metadataJGenerateSchema._computed_field_schema.<locals>.set_computed_field_metadata  s    !&/K&*K
#FFLLE ',G$&&,,K&-8M*vv  AFF$5$5$;,0L)vvH#*<X*FJ' ! 8 8 ,%kEr   r  )r4  r  rV  )r   rU   r   r<   r   rH   )rM   get_function_return_typefuncr   r  r!  r  rA   r  r-   rB   rp   r  r   replacer1  r  r   rc  r   r  r  r  r  rT   r/   r  r  )	r   r  r  r  r  return_type_schemar  r  rV  s	    `       r   r  %GenerateSchema._computed_field_schema  s   
	H%>>qvvqvvGYGY[_[p[pqK ++#d5  $K1C1CD $$QVVE!11+>!::01B1I1I1KQ^^\ ; 
 ..>>&>> /QVVabaoao ?  	778L8LaffVWVdVde	4 '@[?\]))NN*<AFFLL[c
 	
o  	H-==a@aG	Hs   A F	 	
F/F**F/c                    [        5       nU R                  USS9tp4U R                  X45      nU H   n[        Xb5      (       d  M  [	        Xe5      nM"     U$ )zdGenerate schema for an Annotated type, e.g. `Annotated[int, Field(...)]` or `Annotated[int, Gt(0)]`.Tr  )rr   r  rY  ry  r  )r   r  r}   r[  r   r   r  s          r   r!   GenerateSchema._annotated_schema  sc    ,.	$($I$I %J %
! ((B &J*00%j9 & r   c                    SSK JnJnJn   [	        U5        [        U5      =(       d    UnU[        ;   a  U" X5      $ U[        ;   a  U" X5      $ U[        ;   a  U" X5      $ g ! [
         a     g f = f)NrK   ))deque_schema_prepare_pydantic_annotations)mapping_like_prepare_pydantic_annotations(path_schema_prepare_pydantic_annotations)
_std_types_schemar  r  r  hashr   r5   r   r   MAPPING_TYPES)r   r  r   r  r  r  
obj_origins          r   rX  ?GenerateSchema._get_prepare_pydantic_annotations_for_known_type  sx    	
 	
	I  _+
#;CMM;&<SNN=(<SNN!  		s   A" "
A/.A/c                    U $ r   r  rI  s    r   rK  GenerateSchema.<lambda>  s    qr   c                  ^ ^^ [        [        R                  " U5      5      nT R                  T[	        U5      5      nUb  Uu  mn/ nSU UU4S jjn[        UT 5      nU H  nUc  M  T R                  XxU5      nM     U" T5      n	U(       a6  [        U	5      R                  n
U
R                  S/ 5      R                  U5        [        T R                  R                  TU	5      $ )ad  Apply arguments from `Annotated` or from `FieldInfo` to a schema.

This gets called by `GenerateSchema._annotated_schema` but differs from it in that it does
not expect `source_type` to be an `Annotated` object, it expects it to be  the first argument of that
(in other words, `GenerateSchema._annotated_schema` just unpacks `Annotated`, this process it).
c                   > TR                  U T5      nUc  TR                  U 5      nOUn[        X5      nUb4  [        UTR                  R
                  5      nUb  TR                  XC5        T" U5      $ r   )r  r  r  r  r  r  r  )r  r  r   r  r  r   r[  r  s        r   inner_handler8GenerateSchema._apply_annotations.<locals>.inner_handler%  sv     ??[QM$44S9&#DS#Q #/"9&$))BWBW"X".))/P)&11r    pydantic_js_annotation_functionsr  r   r   r)   )ra  rO   expand_grouped_metadatarX  r   rt   _get_wrapped_inner_schemarS   rV  r  extendr   r  r   )r   r[  r   r  rZ  r  r  get_inner_schemar  r   rV  s   `` `       r   rY  !GenerateSchema._apply_annotations  s     4LL[YZCCKQVWbQcd?'*$KHJ(	2 	2 8tL%J!#== .N  & "+.+*62;;H BBGNNOop;D<P<P<^<^`kmsttr   c                   [        5       n[        X#5      (       aN  UR                   H  nU R                  X5      nM     UR                  b  U R                  XR                  5      nU$ US   S:X  aC  UR                  S[        R                  " 5       5      nU R                  XR5      nU(       a  XQS'   U$ UnUR                  SS 5      nUbX  UR                  5       nUS[        U5       3-   nXR                  R                  ;   a  U R                  R                  U   $ XS'   OUS   S:X  a  US   nXpR                  R                  ;   an  U R                  R                  U   R                  5       nUS[        U5       3-   nXR                  R                  ;   a  U R                  R                  U   $ XS'   [        R                  " X!R                  5       5      n	U	b  U	$ U$ )Nr   r   r   rU  rZ  definition-refr   )rr   ry  rV  _apply_single_annotationr  r  r   r/   r   r   reprr  r  rO   apply_known_metadata)
r   r   rV  r}   field_metadatar  r   rU  new_refmaybe_updated_schemas
             r   r  'GenerateSchema._apply_single_annotationA  s   ,.	h**"*"3"366vN #4 %%1;;FDZDZ[M&>Z'JJx)?)?)ABE11%BE#(x M jj%?[[]FaX/00G))///yy,,W55#5MF^//&Cii+++..s388:!DN#3 44ii333990099 'u8MMhXcXcXef+''r   c                   [        5       n[        X#5      (       a  UR                   H  nU R                  X5      nM     0 nUR                  (       a  UR                  US'   UR
                  (       a  UR
                  US'   UR                  (       a  [        UR                  5      US'   UR                  nU(       d  U(       a=  [        U5      R                  R                  S/ 5      R                  [        XV5      5        U$ )Nr   r   r  r  )rr   ry  rV  $_apply_single_annotation_json_schemar   r   r  r0   r  rS   r  r   r  )r   r   rV  r}   r  json_schema_updater  s          r   r  3GenerateSchema._apply_single_annotation_json_schemak  s     -.	h**"*"3"3BB6Z #424~~.6nn"7+##4<4H4H"=1  1CHDUDU1V":. ( : :!%6#F+44??@bdfgnn/0BV r   c                j   ^ ^^^^ [        TSS 5      =(       d    S mSUUUUU 4S jjn[        UT 5      $ )Nr   c                    U" U 5      $ r   r  )r  r   s     r   rK  :GenerateSchema._get_wrapped_inner_schema.<locals>.<lambda>  s    GFOr   c                   > T" U T5      nTR                  UT5      nTR                  UT5      n[        TU5      nUb  TR                  U5        U$ r   )r  r  r  r   )r  r   r  r  r  metadata_get_schemar  r   s      r   new_handler=GenerateSchema._get_wrapped_inner_schema.<locals>.new_handler  s\    (1ABF226:FF>>vzRF#DZQW#X #/0778LMMr   )r  r   r   core_schema.CoreSchema)r   rt   )r   r  r  r  r  r  s   ```` @r   r  (GenerateSchema._get_wrapped_inner_schema  s9     6=ZIgim5n 6
3 		 	 ,K>>r   c                   U(       Ga  [        U5      nUS   S:X  a  US   nU R                  XB5      US'   U$ [        R                  " SUR	                  SS5      5      nUb.  XR
                  R                  U'   [        R                  " U5      nUS   n[        UR                  UR                  R                  US9u  px [        R                  " UR                  UR                  R                  U R                   5      n	U	[(        L a  SnOU R+                  U	5      nUR                  R                  S	:X  a;  [        R,                  " UR                  UUUUR                  R.                  S
9US'   U$ UR                  R                  S:X  d   e[        R0                  " UR                  UUUUR                  R.                  S
9US'   U$ ! ["         a  n
[$        R&                  " U
5      U
eSn
A
ff = f)z$Apply field serializers to a schema.r   r  r   zstr|NonerU  Nr   r  r   )is_field_serializerr%  r4  r   r   r   )r   r  rO  r%   r   r  r  r/   r  rg   r  r   r  rM   r  r  r!  r  rA   r  r-   r1  r(  r   r   )r   r   serializersr  r   rU  
serializerr  r%  r  r  r4  s               r   r  'GenerateSchema._apply_field_serializers  s    &\Ff~.%h/#'#@#@#[x kk*fjj.EF?17II))#.(DDSIF %RJ,D!5!5n-)L)BBOOZ__%@%@$BWBW // $ $ 4 4[ A##v-*5*Y*YOO(;%"/(oo77+'   "++w666*5*Z*ZOO(;%"/(oo77+' 3  L1AA!D!KLs   A G
 

G0G++G0c                   UR                  SS5      nU(       Ga  [        U5      S   n[        UR                  UR                  R
                  5      n [        R                  " UR                  UR                  R                  U R                  5      nU[        L a  SnOU R                  U5      nUR                  R
                  S:X  a6  [        R                   " UR                  UUUR                  R"                  S9n	O5[        R$                  " UR                  UUUR                  R"                  S9n	XS'   U(       a  X1S'   U$ ! [         a  n[        R                  " U5      UeSnAff = f)z$Apply model serializers to a schema.rU  Nr   r   )r%  r4  r   r   )r   ra  rh   r  r   r  rM   r  r  r!  r  rA   r  r-   r1  r/   r(  r   r   )
r   r   r  rU  r  r%  r  r  r4  
ser_schemas
             r   r  'GenerateSchema._apply_model_serializers  s9    !**UD1k*2.J/
AUAUVHL)BBOOZ__%@%@$BWBW
 // $ $ 4 4[ A##v-4?4c4cOO%"/(oo77	5
 )MMOO%"/(oo77	
 '1?#5M3  L1AA!D!KLs   A E 
E-E((E-)r
  r   r  r  r  r  r   )r  rQ   r   dict[str, Any] | Noner  dict[Any, Any] | Noner   None)r  rR   r  r   r  r  r  r  r  r  r   r	  )r   rQ   )r   r  )r   r	  )r   r*  )r   r)   )r3  r   r   r)   )r8  r   r9  r   r   r)   )r]  z
type[Enum]r   r)   )r   r   r   r)   r  )r   r)   r  zstr | Discriminator | Noner   r)   r  )r  r)   r  Callable[..., Any]r   r  )T)r  r   r  r*  r   r  )r   ztype[BaseModel]r   r  )r  z#type[BaseModel | StandardDataclass]r  zConfigWrapper | Noner   r  )r  r   r  r   r   zcore_schema.CoreSchema | None)r  r   r   r   )r  r   r  zLiteral[True]r   tuple[Any, ...])r  r   r   tuple[Any, ...] | None)F)r  r   r  r*  r   r  )r  r   r   ztuple[Any, Any])r  r   r   r  )r  r   r  r   r   r)   )
rj  rF  rk  r}   r   r_   r  r*  r   zcore_schema.TypedDictField)rj  rF  rk  r}   r   r_   r   zcore_schema.ModelField)rj  rF  rk  r}   r   r_   r   zcore_schema.DataclassField)r  %Callable[[str], str] | AliasGeneratorrk  r}   r   rF  r   r  )r  r  r  r|   r  rF  )r  rQ   rk  zFieldInfo | ComputedFieldInfor   rF  r   r  )rj  rF  rk  r}   r   r_   r   _CommonField)r  r   r   r  )r  r   r   r)   )r  r   r  r   r   r  )r  r   r  r   r   r  )
rj  rF  r  r   r  r   r  zJLiteral['positional_only', 'positional_or_keyword', 'keyword_only'] | Noner   zcore_schema.ArgumentsParameter)r  r   r   r  )r   r  )r  r   r   r  )r3  r   r   r  )r  r   r   zcore_schema.GeneratorSchema)r8  r   r   r  )rS  ztype[StandardDataclass]r  ztype[StandardDataclass] | Noner   r  )rl  r  r   zcore_schema.CallSchema)r}  ztyping.TypeVarr   r  )r  zDecorator[ComputedFieldInfo]r  z2dict[str, Decorator[FieldSerializerDecoratorInfo]]r   zcore_schema.ComputedField)r  r   r   r  )r  r   r   r  r   ztuple[Any, list[Any]] | None)r[  r   r   z	list[Any]r  z"Callable[[CoreSchema], CoreSchema]r   r)   )r   r  rV  r   r   r  )r  r;   r  r   r  zlist[GetJsonSchemaFunction]r   rt   )r   r  r  z-list[Decorator[FieldSerializerDecoratorInfo]]r  r*  r   r  )r   r  r  z1Iterable[Decorator[ModelSerializerDecoratorInfo]]r   r  )Pr   r   r   r   r   rF  r   classmethodr%  r  r  r!  r&  r*  r-  r4  r:  r>  rB  rn  r  r  r  r  	Exceptionr  r  r  r  r1  r  staticmethodr  r  r  r  r&   r  r  r  r  r#  rW  rm  r  r{  r  r  r  r  r_  r>  rC  rD  rF  r   r  r  r<  r?  rT  r  r`  r=  rb  rK  rP  rV  rR  rQ  r  r!  rX  rY  r  r  r  r  r  r  r  r   r   r	  r	  e  sE   fI /3	#%# /# ,	#
 
# 0  3 *	
 ,  
 " / / 0 0 
 
 < <(IkHNFP
>
2	
 1K	$9 	
	6 -1-- &*- 
 	-^dJL [_2DX	 &	5n, i iW W $2k.Z/.n 

 
 #	
 
 
$
&

 
 #	

 
 
"

 
 #	

 
$
* /[>/[LU/[cf/[	/[ /[b (\>(\.(\ !(\ (\T %%%3P%^a%	% %*j
j
%.j
<Jj
	j
X6@@ 
@,hOT#eR ![_! !  !  	! 
 Y!  
(! F_<

0d
>.
.Mr8
k(0k(:Xk(	k(Z3
j,<@
'@
 N@
 
#	@
D %4	%D FQ	-u-u -u !C	-u
 
-u^(T,8;	.?.? ? +F	?
 
&?4  %	6&6 C6 	6
 
 6p&,&;l&	&r   r	  c                .    [         R                  " X5      $ r   )r/   !no_info_before_validator_functionfr   rZ  s      r   rK  rK    s    0]0]^_0hr   c                .    [         R                  " X5      $ r   )r/   rh  r  s      r   rK  rK    s    {/[/[\]/fr   c                .    [         R                  " U 5      $ r   )r/   r  )r  r  r  s      r   rK  rK    s    K,X,XYZ,[r   c                .    [         R                  " X5      $ r   )r/   r'  r  s      r   rK  rK   	  s    k.Y.YZ[.dr   c                ,    [         R                  " XUS9$ N)r   )r/   #with_info_before_validator_functionr  r   r   s      r   rK  rK  	  s    ;;j;j	j<r   c                ,    [         R                  " XUS9$ r  )r/   "with_info_after_validator_functionr  s      r   rK  rK  	  s    +:h:h	j;r   c                *    [         R                  " XS9$ r  )r/   r  )r  rZ  r   s      r   rK  rK  	  s    [5c5c	6r   c                ,    [         R                  " XUS9$ r  )r/   !with_info_wrap_validator_functionr  s      r   rK  rK  
	  s    9f9f	j:r   ))r   no-info)r   r  )r   r  )r   r  )r   	with-info)r   r  )r   r  )r   r  zMapping[tuple[FieldValidatorModes, Literal['no-info', 'with-info']], Callable[[Callable[..., Any], core_schema.CoreSchema, str | None], core_schema.CoreSchema]]_VALIDATOR_F_MATCHc                    U Hh  n[        UR                  UR                  R                  5      nU(       a  SOSn[        UR                  R                  U4   " UR                  X5      n Mj     U $ )zApply validators to a schema.

Args:
    schema: The schema to apply validators on.
    validators: An iterable of validators.
    field_name: The name of the field if validators are being applied to a model field.

Returns:
    The updated schema.
r  r  )ri   r  r   r  r  )r   r  r   	validatorr%  val_types         r   r   r   	  s]    "  	$Y^^Y^^5H5HI"*;	#Y^^%8%8($CDY^^U[h	  
 Mr   c                P    U  H   nUR                   R                  (       d  M     g   g)a'  In v1, if any of the validators for a field had `always=True`, the default value would be validated.

This serves as an auxiliary function for re-implementing that logic, by looping over a provided
collection of (v1-style) ValidatorDecoratorInfo's and checking if any of them have `always=True`.

We should be able to drop this function and the associated logic calling it once we drop support
for v1-style validator decorators. (Or we can extend it and keep it if we add something equivalent
to the v1-validator `always` kwarg to `field_validator`.)
TF)r   always)r  r  s     r   r  r  +	  s&      	>>      r   c                   U R                  SS5      nU GH  nUS:X  a  UR                  R                  S:w  a  M&  US:X  a  UR                  R                  S:X  a  MH  [        UR                  UR                  R                  5      nUR                  R                  S:X  aI  U(       a!  [
        R                  " UR                  U S9n M  [
        R                  " UR                  U S9n M  UR                  R                  S:X  aK  U(       a"  [
        R                  " UR                  U S9n GM  [
        R                  " UR                  U S9n GM:  UR                  R                  S:X  d   eU(       a"  [
        R                  " UR                  U S9n GM  [
        R                  " UR                  U S9n GM     U(       a  X0S'   U $ )	ak  Apply model validators to a schema.

If mode == 'inner', only "before" validators are applied
If mode == 'outer', validators other than "before" are applied
If mode == 'all', all validators are applied

Args:
    schema: The schema to apply validators on.
    validators: An iterable of validators.
    mode: The validator mode.

Returns:
    The updated schema.
rU  Nr  r   r  r   )rl  r   r   )r   r   r  ri   r  r/   r  r'  r  r  r  rh  )r   r  r  rU  r  r%  s         r   r  r  ;	  sZ   & jj-C	7?y~~22h>7?y~~22h>$Y^^Y^^5H5HI>>&($FFPYP^P^gmn$DDinnekl^^  H,$HHR[R`R`iop$FFPYP^P^gmn>>&&'111$GGQZQ_Q_hno$EEy~~flm+  , uMr   c                    U R                   (       a)  [        R                  " XR                   U R                  S9$ U R                  [
        La)  [        R                  " XR                  U R                  S9$ U$ )zWrap schema with default schema if default value or `default_factory` are available.

Args:
    field_info: The field info object.
    schema: The schema to apply default on.

Returns:
    Updated schema by default value or `default_factory`.
)default_factoryr  )r  r  )r  r/   with_default_schemar  r  r-   )rk  r   s     r   r  r  j	  sn     !!..$>$>Q[QlQl
 	
 
		#4	4....A\A\
 	
 r   c                   [        U SS5      n[        U S5      (       aj  [        5       nUSL=(       a&    UR                  R                  U[        USS5      4;  nU(       d(  [        U SS5      n[        SU(       a  SU S3OS	 S
3SS9e[        U S5      (       a&  [        U 5      (       d  [        U R                  U5      $ Uc  gU$ )z`Extract `__get_pydantic_json_schema__` from a type, handling the deprecated `__modify_schema__`.__get_pydantic_json_schema__N__modify_schema__rQ  r   zjThe `__modify_schema__` method is not supported in Pydantic v2. Use `__get_pydantic_json_schema__` insteadz in class ``r  r   zcustom-json-schemar   
__origin__)	r   rP  rq   r  rQ  rB   rv   r  r  )r   r   js_modify_functionr~   has_custom_v2_modify_js_funccls_names         r   r  r  	  s     %CTJr&'',.	 d* W66??&0BJPT(UVW 	% ,r:t4H#=Zb{8*TU=Vhj<kkln)  r<  b)9)90GG!r   c                (   ^ ^       SUU 4S jjnU$ )Nc                8   > 0 U" U 5      ETEn[        UT5        U$ r   )r  )core_schema_or_fieldr   r   r  r  s      r   json_schema_update_func<get_json_schema_update_func.<locals>.json_schema_update_func	  s-     N!56M:LMk+<=r   )r  rU   r   r<   r   rH   r  )r  r  r  s   `` r   r  r  	  s-    /:N	  #"r   c                    [        U[        5      (       a  U R                  [        U5      5        g [	        U5      (       a	  U" U 5        g g r   )ry  r   r   r0   callable)r   r  s     r   r  r  	  s@     #T**-.?@A	#	$	$+& 
%r   c                  R    \ rS rSr% S\S'   S\S'   S\S'   S\S	'   S\S
'   S\S'   Srg)r  i	  r  r   4str | list[str | int] | list[list[str | int]] | Nonerf  r  rg  bool | Nonere  rp  zdict[str, Any]rV  r  N)r   r   r   r   r  r  r  r   r   r  r  	  s&    ""JJ##&&r   r  )rf  rg  re  rp  rV  c                   U UUUUUS.$ )Nr   rf  rg  re  rp  rV  r  r  s         r   r  r  	  s      ,2!6 r   c                  6    \ rS rSrSrSS jr\SS j5       rSrg)	r  i	  z*Keeps track of references and definitions.c                0    [        5       U l        0 U l        g r   )r   seenr  r   s    r   r   _Definitions.__init__	  s    !e	>@r   c              #  N  #    [        U5      nX R                  ;   d  X R                  ;   a  U[        R                  " U5      4v   gU R                  R                  U5         US4v   U R                  R                  U5        g! U R                  R                  U5        f = f7f)a  Get a definition for `tp` if one exists.

If a definition exists, a tuple of `(ref_string, CoreSchema)` is returned.
If no definition exists yet, a tuple of `(ref_string, None)` is returned.

Note that the returned `CoreSchema` will always be a `DefinitionReferenceSchema`,
not the actual definition itself.

This should be called for any type that can be identified by reference.
This includes any recursive types.

At present the following types can be named/recursive:

- BaseModel
- Dataclasses
- TypedDict
- TypeAliasType
N)rY   r  r  r/   r  adddiscard)r   r   rU  s      r   r  _Definitions.get_schema_or_ref	  s     ( 2))s&6&66??DEEIIMM#'Dk!		!!#&		!!#&s   A B%#B )B%B""B%)r  r  Nr   r  )r   r   r   z3Iterator[tuple[str, None] | tuple[str, CoreSchema]])	r   r   r   r   r   r   r   r  r  r  r   r   r  r  	  s    4A ' 'r   r  c                ^    U S   S:X  a  UR                  U S   S 5      $ U S   S:X  a  U S   $ U $ )Nr   r  r   r  r   rB  )r   r  s     r   r  r  	  sA    f~))vl3T::	=	(hr   c                  @    \ rS rSrSrSS jr\SS j5       rS	S jrSr	g)
r  i
  _stackc                    / U l         g r   r  r   s    r   r   _FieldNameStack.__init__
  s	    !#r   c              #  ~   #    U R                   R                  U5        S v   U R                   R                  5         g 7fr   r  r   r   )r   r   s     r   r   _FieldNameStack.push
  s(     :&   ;=c                D    U R                   (       a  U R                   S   $ g r   r  r   s    r   r   _FieldNameStack.get
      ;;;;r?"r   Nr  )r   rF  r   Iterator[None])r   r  
r   r   r   r   rF  r   r   r   r   r  r  r   r   r  r  
  s%    I$  
r   r  c                  @    \ rS rSrSrSS jr\SS j5       rS	S jrSr	g)
r  i
  r  c                    / U l         g r   r  r   s    r   r   _ModelTypeStack.__init__
  s	    "$r   c              #  ~   #    U R                   R                  U5        S v   U R                   R                  5         g 7fr   r  )r   type_objs     r   r   _ModelTypeStack.push
  s(     8$r  c                D    U R                   (       a  U R                   S   $ g r   r  r   s    r   r   _ModelTypeStack.get 
  r  r   Nr  )r  r   r   r  )r   ztype | Noner  r  r   r   r  r  
  s%    I%  
r   r  )r   FieldDecoratorInfor   rF  r   r*  )r   zIterable[AnyFieldDecorator]r   zIterable[str]r   r  )r   z+Iterable[Decorator[FieldDecoratorInfoType]]r   rF  r   z'list[Decorator[FieldDecoratorInfoType]])r   r  r   z'list[Decorator[ValidatorDecoratorInfo]]r   r  r   r  )
r   rU   r   r<   r   r   r   r  r   rH   )r   zJsonEncoders | Noner   r   r   r)   r   r)   )r  r   r  r   r   r   )r   r  r  zIterable[Decorator[RootValidatorDecoratorInfo]] | Iterable[Decorator[ValidatorDecoratorInfo]] | Iterable[Decorator[FieldValidatorDecoratorInfo]]r   r  r   r  )r  z+Iterable[Decorator[ValidatorDecoratorInfo]]r   r*  )r   r  r  z0Iterable[Decorator[ModelValidatorDecoratorInfo]]r  z Literal['inner', 'outer', 'all']r   r  )rk  r}   r   r  r   r  )r   r   r   r)   r   zGetJsonSchemaFunction | None)r  rH   r  3JsonDict | typing.Callable[[JsonDict], None] | Noner   r   )r   rH   r  r!  )r   r  rf  r  rg  r  re  r  rp  r  rV  r   r   r  )r   r)   r  zdict[str, CoreSchema]r   zCoreSchema | None)r   
__future__r   _annotationscollections.abcrL  r   r.  r   ospathlibrI  r  rO  r   
contextlibr   r   r   r   decimalr   enumr	   	functoolsr
   r   r   r   	ipaddressr   r   r   r   r   r   	itertoolsr   operatorr   typesr   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   uuidr'   r(   typing_extensionspydantic_corer)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   aliasesr8   r9   r:   annotated_handlersr;   r<   r  r=   r>   r?   errorsr@   rA   rB   functional_validatorsrC   rD   rE   rF   rG   r   rH   versionrI   rJ   r  rL   rM   rN   rO   rP   _configrQ   rR   _core_metadatarS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   _docs_extractionrj   r  rk   _forward_refrl   	_genericsrm   rn   ro   rp   _import_utilsrq   rr   _mock_val_serrs   _schema_generation_sharedrt   ru   rv   rw   rx   ry   _utilsrz   r{   r   r|   r}   mainr~   r   r   r   r   r  r  r   r   AnyFieldDecoratorModifyCoreSchemaWrapHandlerGetCoreSchemaFunctionr   Tupler   r  ra  ListrM  MutableSequencer   r   Set
MutableSetr   	frozenset	FrozenSetr   r   r   r   r"  r   PathLikePathPurePath	PosixPathPurePosixPathPureWindowsPathr   MutableMappingOrderedDictDefaultDictdefaultdictCounterr  dequeDequer   r   r   r   r   r   r   JsonEncodersr   rF  r   r   r  r	  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   <module>rY     s   3 2     	  	 
   0     8 8 f f   6 6       	 	 	 d c = = K 6 6 b b w w ) # 0 f f 6 D
 
 
    : - . t t M ) C p p 65 %/@&&'1 13NPllm  !9AST $%)**+-  3  #'B!C[E[E[![\  &,,/Z /[__-L-LM
J Mfjj+//*D*DE	: E )6+;+;[__=P=PQ * Q,
J ,#]Km]hi* i$oo{/G/GH
 HKKLL
J  NN
OOOO""!!

NN ',,fll;Z ; .Zgh   i

 
*6nDnMPn,n"""A" " 	"T $&$!$ 
	$
 $ $N DI{*+&,/9CD tCH~t+,. .*%Q Qp< if[d   2"7
  2 ,",@, +, 	,^,>
#'
#<o
#
#' '5h'9  NR&*)-" K $	
 '   &$' $'N & r   