
    o i                    N   d Z ddlmZ ddlmZmZ ddlmZmZm	Z	m
Z
mZ ddlmZ ddlmZmZ ddlmZ dd	lmZmZ dd
lmZmZ er5ddlmZ ddlmZ  edeef           G d dej                              Znej        ZdZ  ed          Z! G d dee	e!         e          Z"dS )z%RootModel class and type definitions.    )annotations)copydeepcopy)TYPE_CHECKINGAnyGenericLiteralTypeVar)PydanticUndefined)Selfdataclass_transform   )PydanticUserError)_model_construction_repr)	BaseModel_object_setattr)Field)PrivateAttrF)kw_only_defaultfield_specifiersc                      e Zd ZdS )_RootModelMetaclassN)__name__
__module____qualname__     J/var/www/findabus/venv/lib/python3.11/site-packages/pydantic/root_model.pyr   r      s        CF3r   r   )	RootModelRootModelRootTypec                       e Zd ZU dZdZdZdZded<    fdZe	fd0d	Z
de
_        ed1d2 fd            Zd3dZd4dZd5dZd1d6dZerdddddddddddddd7d+Zd8 fd-Zd9d/Z xZS ):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                    | j                             d          }|t          dd           t                      j        di | d S )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*   zRootModel.__init_subclass__4   sa     $$W--#NUg    	"!++F+++++r   returnNonec               z    d}|r|t           urt          d          |}| j                            ||            d S )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__zRootModel.__init__<   sZ      	,,, u   D#33D3MMMMMr   _fields_setset[str] | Noner   c                J    t                                          ||          S )aS  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#   r9   )r)   model_construct)r+   r#   r9   r-   s      r   r<   zRootModel.model_constructH   s"     ww&&Dk&JJJr   dict[Any, Any]c                     | j         | j        dS )N__dict____pydantic_fields_set__r?   r5   s    r   __getstate__zRootModel.__getstate__X   s    '+'C
 
 	
r   statec                b    t          | d|d                    t          | d|d                    d S )NrA   r@   )r   )r5   rD   s     r   __setstate__zRootModel.__setstate__^   s8    7?X9YZZZj%
*;<<<<<r   c                    t          |           }|                    |          }t          |dt          | j                             t          |dt          | j                             |S )z$Returns a shallow copy of the model.r@   rA   )type__new__r   r   r@   rA   )r5   r+   ms      r   __copy__zRootModel.__copy__b   s]    4jjKK:tDM':':;;;4d4;W6X6XYYYr   memodict[int, Any] | Nonec                    t          |           }|                    |          }t          |dt          | j        |                     t          |dt          | j                             |S )z!Returns a deep copy of the model.r@   )rL   rA   )rH   rI   r   r   r@   r   rA   )r5   rL   r+   rJ   s       r   __deepcopy__zRootModel.__deepcopy__j   sd    4jjKK:xD'I'I'IJJJ 	4d4;W6X6XYYYr   pythonF)modeincludeexcludecontextby_aliasexclude_unsetexclude_defaultsexclude_noneexclude_computed_fields
round_tripwarningsserialize_as_anyrQ   Literal['json', 'python'] | strrR   r   rS   rT   dict[str, Any] | NonerU   bool | NonerV   boolrW   rX   rY   rZ   r[   'bool | Literal['none', 'warn', 'error']r\   c                   dS )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   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   s                r   
model_dumpzRootModel.model_dumpv   s	    6 Cr   otherc                    t          |t                    st          S | j        d         j        |j        d         j        k    o t                                          |          S Nr#   )
isinstancer    NotImplemented__pydantic_fields__
annotationr)   __eq__)r5   rd   r-   s     r   rk   zRootModel.__eq__   s[    %++ 	"!!'/:e>W?

 /..	/r   _repr.ReprArgsc              #      K   d| j         fV  d S rf   )r#   rB   s    r   __repr_args__zRootModel.__repr_args__   s      dir   )r#   r!   r.   r/   )N)r#   r!   r9   r:   r.   r   )r.   r=   )rD   r=   r.   r/   )r.   r   )rL   rM   r.   r   )rQ   r]   rR   r   rS   r   rT   r^   rU   r_   rV   r`   rW   r`   rX   r`   rY   r`   rZ   r`   r[   ra   r\   r`   r.   r   )rd   r   r.   r`   )r.   rl   )r   r   r   __doc____pydantic_root_model____pydantic_private____pydantic_extra____annotations__r*   r   r8   __pydantic_base_init__classmethodr<   rC   rF   rK   rO   r   rc   rk   rn   __classcell__)r-   s   @r   r    r        s          #, , , , , 5F N N N N N '+H#K K K K K K [K
 
 
 
= = = =         
 5=-1$("'%*!&,1$@D%*	 	 	 	 	 	:/ / / / / /               r   r    )	metaclassN)#ro   
__future__r   _annotationsr   r   typingr   r   r   r	   r
   pydantic_corer   typing_extensionsr   r    r   	_internalr   r   mainr   r   fieldsr   PydanticModelFieldr   PydanticModelPrivateAttrModelMetaclassr   __all__r!   r    r   r   r   <module>r      s   + + 2 2 2 2 2 2         @ @ @ @ @ @ @ @ @ @ @ @ @ @ + + + + + + 7 7 7 7 7 7 7 7       1 1 1 1 1 1 1 1 , , , , , , , , 
=333333??????
 BTVnAopppFFFFF1@FF qpFF-<
G/00 {  {  {  {  { 	7#45AT {  {  {  {  {  { r   