
    ziU                       d Z ddlmZ ddlZddlmZmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZmZ ej        rdd
lmZ ddlmZ  ej        dd          ZdZ ej        d          Z G d deej        e                   ZdS )z%RootModel class and type definitions.    )annotationsN)copydeepcopy)PydanticUndefined   )PydanticUserError)_repr)	BaseModel_object_setattr)Any)LiteralModelr
   )bound)	RootModelRootModelRootTypec            
           e Zd ZU dZdZdZdZded<    fdZe	fd-d	Z
de
_        ed.d/ fd            Zd0dZd1dZd2dZd.d3dZej        rdddddddddd	d4d(Zd5 fd*Zd6d,Z xZS )7r   a  Usage docs: https://docs.pydantic.dev/2.5/concepts/models/#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)code )model_configgetr   super__init_subclass__)clskwargsr   	__class__s      ^/var/www/tmov.alphamb/tmov_inventario/venv/lib/python3.11/site-packages/pydantic/root_model.pyr   zRootModel.__init_subclass__/   sa     $$W--#NUg    	"!++F+++++    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)__pydantic_self__r   data__tracebackhide__s       r   __init__zRootModel.__init__7   s[      	,,, u   D0@@Uf@gggggr    r   type[Model]_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   r-   )r   model_construct)r   r   r-   r   s      r   r0   zRootModel.model_constructC   s"     ww&&Dk&JJJr    dict[Any, Any]c                     | j         | j        dS )N__dict____pydantic_fields_set__r3   selfs    r   __getstate__zRootModel.__getstate__S   s    '+'C
 
 	
r    statec                b    t          | d|d                    t          | d|d                    d S )Nr5   r4   )r   )r7   r9   s     r   __setstate__zRootModel.__setstate__Y   s8    7?X9YZZZj%
*;<<<<<r    r7   c                    t          |           }|                    |          }t          |dt          | j                             t          |dt          | j                             |S )z$Returns a shallow copy of the model.r4   r5   )type__new__r   r   r4   r5   )r7   r   ms      r   __copy__zRootModel.__copy__]   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.r4   )rA   r5   )r=   r>   r   r   r4   r   r5   )r7   rA   r   r?   s       r   __deepcopy__zRootModel.__deepcopy__e   sd    4jjKK:xD'I'I'IJJJ 	4d4;W6X6XYYYr    pythonF)	modeincludeexcludeby_aliasexclude_unsetexclude_defaultsexclude_none
round_tripwarningsrF   Literal['json', 'python'] | strrG   r   rH   rI   boolrJ   rK   rL   rM   rN   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.
            Nr   )
r7   rF   rG   rH   rI   rJ   rK   rL   rM   rN   s
             r   
model_dumpzRootModel.model_dumpq   s	    $ Cr    otherc                    t          |t                    st          S | j        d         j        |j        d         j        k    o t                                          |          S Nr   )
isinstancer   NotImplementedmodel_fields
annotationr   __eq__)r7   rS   r   s     r   rZ   zRootModel.__eq__   sW    %++ 	"!! (3u7I&7Q7\\vafahahaoaopuavavvr    _repr.ReprArgsc              #      K   d| j         fV  d S rU   )r   r6   s    r   __repr_args__zRootModel.__repr_args__   s      dir    )r   r   r!   r"   )N)r   r,   r   r   r-   r.   r!   r   )r!   r1   )r9   r1   r!   r"   )r7   r   r!   r   )r7   r   rA   rB   r!   r   )rF   rO   rG   r   rH   r   rI   rP   rJ   rP   rK   rP   rL   rP   rM   rP   rN   rP   r!   r   )rS   r   r!   rP   )r!   r[   )__name__
__module____qualname____doc____pydantic_root_model____pydantic_private____pydantic_extra____annotations__r   r   r+   __pydantic_base_init__classmethodr0   r8   r;   r@   rD   typingTYPE_CHECKINGrR   rZ   r]   __classcell__)r   s   @r   r   r      s        
 
 #, , , , , ?P h h h h h '+H#K K K K K K [K
 
 
 
= = = =         
 5=""'%*!&$!	 	 	 	 	 	(w w w w w w
               r    r   )ra   
__future__r   _annotationsrh   r   r   pydantic_corer    r   	_internalr	   mainr
   r   ri   r   typing_extensionsr   TypeVarr   __all__r   Genericr   r   r    r   <module>ru      s5   + + 2 2 2 2 2 2          + + + + + +             , , , , , , , ,	 7))))))FN7+666E  #FN#677 o  o  o  o  o 	6>*;< o  o  o  o  o r    