
    h                    r   S r SSKJr  SSKrSSKJrJr  SSKJr  SSK	J
r
  SSKJrJr  SS	KJrJr  \R"                  (       a>  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\\4S9 " S S\R8                  5      5       rO\R8                  rSr\R>                  " S5      r  " S S\\RB                  \    \S9r"g)z%RootModel class and type definitions.    )annotationsN)copydeepcopy)PydanticUndefined   )PydanticUserError)_model_construction_repr)	BaseModel_object_setattr)AnyLiteral)Selfdataclass_transform)Field)PrivateAttrF)kw_only_defaultfield_specifiersc                      \ rS rSrSrg)_RootModelMetaclass    N)__name__
__module____qualname____firstlineno____static_attributes__r       E/var/www/html/env/lib/python3.13/site-packages/pydantic/root_model.pyr   r      s    CFr   r   )	RootModelRootModelRootTypec                  <  ^  \ rS rSr% SrSrSrSrS\S'   U 4S jr	\
4SS jjrS\l        \SSU 4S	 jjj5       rSS
 jrSS jrSS jrSSS jjr\R(                  (       a*  SSSSSSSSSSSS.                       SS jjrSU 4S jjrSS jrSrU =r$ )r    #   a  !!! abstract "Usage Documentation"
    [`RootModel` and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

A Pydantic `BaseModel` for the root object of the model.

Attributes:
    root: The root object of the model.
    __pydantic_root_model__: Whether the model is a RootModel.
    __pydantic_private__: Private fields in the model.
    __pydantic_extra__: Extra fields in the model.

TNr!   rootc                v   > U R                   R                  S5      nUb
  [        SSS9e[        TU ]  " S0 UD6  g )Nextraz<`RootModel` does not support setting `model_config['extra']`zroot-model-extra)coder   )model_configgetr   super__init_subclass__)clskwargsr&   	__class__s      r   r+   RootModel.__init_subclass__7   sD      $$W-#NUg  	!+F+r   c               t    SnU(       a  U[         La  [        S5      eUnU R                  R                  XS9  g )NTz_"RootModel.__init__" accepts either a single positional argument or arbitrary keyword arguments)self_instance)r   
ValueError__pydantic_validator__validate_python)selfr$   data__tracebackhide__s       r   __init__RootModel.__init__?   sB     ,, u  D##33D3Mr   c                   > [         TU ]  XS9$ )a  Create a new model using the provided root object and update fields set.

Args:
    root: The root object of the model.
    _fields_set: The set of fields to be updated.

Returns:
    The new model.

Raises:
    NotImplemented: If the model is not a subclass of `RootModel`.
)r$   _fields_set)r*   model_construct)r,   r$   r;   r.   s      r   r<   RootModel.model_constructK   s     w&D&JJr   c                4    U R                   U R                  S.$ )N__dict____pydantic_fields_set__r?   r5   s    r   __getstate__RootModel.__getstate__[   s    '+'C'C
 	
r   c                D    [        U SUS   5        [        U SUS   5        g )NrA   r@   )r   )r5   states     r   __setstate__RootModel.__setstate__a   s&    7?X9YZj%
*;<r   c                    [        U 5      nUR                  U5      n[        US[        U R                  5      5        [        US[        U R
                  5      5        U$ )z$Returns a shallow copy of the model.r@   rA   )type__new__r   r   r@   rA   )r5   r,   ms      r   __copy__RootModel.__copy__e   sK    4jKK:tDMM':;4d4;W;W6XYr   c           	         [        U 5      nUR                  U5      n[        US[        U R                  US95        [        US[        U R                  5      5        U$ )z!Returns a deep copy of the model.r@   )memorA   )rJ   rK   r   r   r@   r   rA   )r5   rP   r,   rL   s       r   __deepcopy__RootModel.__deepcopy__m   sO    4jKK:xD'IJ 	4d4;W;W6XYr   pythonF)modeincludeexcludecontextby_aliasexclude_unsetexclude_defaultsexclude_none
round_tripwarningsserialize_as_anyc                   g)a  This method is included just to get a more accurate return type for type checkers.
It is included in this `if TYPE_CHECKING:` block since no override is actually necessary.

See the documentation of `BaseModel.model_dump` for more details about the arguments.

Generally, this method will have a return type of `RootModelRootType`, assuming that `RootModelRootType` is
not a `BaseModel` subclass. If `RootModelRootType` is a `BaseModel` subclass, then the return
type will likely be `dict[str, Any]`, as `model_dump` calls are recursive. The return type could
even be something different, in the case of a custom serializer.
Thus, `Any` is used here to catch all of these cases.
Nr   )r5   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s               r   
model_dumpRootModel.model_dumpy   s    4 r   c                   > [        U[        5      (       d  [        $ U R                  S   R                  UR                  S   R                  :H  =(       a    [
        TU ]  U5      $ Nr$   )
isinstancer    NotImplemented__pydantic_fields__
annotationr*   __eq__)r5   otherr.   s     r   rh   RootModel.__eq__   sZ    %++!!''/::e>W>W?

* /.	/r   c              #  ,   #    SU R                   4v   g 7frc   )r$   rB   s    r   __repr_args__RootModel.__repr_args__   s     diis   r   )r$   r!   returnNone)N)r$   r!   r;   zset[str] | Nonern   r   )rn   dict[Any, Any])rF   rp   rn   ro   )rn   r   )rP   zdict[int, Any] | Nonern   r   )rT   zLiteral['json', 'python'] | strrU   r   rV   r   rW   zdict[str, Any] | NonerX   zbool | NonerY   boolrZ   rq   r[   rq   r\   rq   r]   z'bool | Literal['none', 'warn', 'error']r^   rq   rn   r   )ri   r   rn   rq   )rn   z_repr.ReprArgs)r   r   r   r   __doc____pydantic_root_model____pydantic_private____pydantic_extra____annotations__r+   r   r8   __pydantic_base_init__classmethodr<   rC   rG   rM   rQ   typingTYPE_CHECKINGr`   rh   rl   r   __classcell__)r.   s   @r   r    r    #   s%    #
, 5F N '+H#K K K
= 
 5=-1$("'%*!&$@D%*	 2	 		
 	 +	 "	  	 #	 	 	 >	 #	 	8/   r   r    )	metaclass)#rr   
__future__r   _annotationsry   r   r   pydantic_corer    r   	_internalr	   r
   mainr   r   rz   r   r   typing_extensionsr   r   fieldsr   PydanticModelFieldr   PydanticModelPrivateAttrModelMetaclassr   __all__TypeVarr!   Genericr    r   r   r   <module>r      s    + 2   +  1 ,	#;3?
 BTVnAopF1@@F qF-<<
NN#67 z 	6>>*;<H[ z r   