
    ,h                    t   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mZ dd	lmZmZ ej"                  rAdd
lmZmZ ddlmZmZ ddlmZ ddlmZ  edeef       G d dej8                               Znej8                  ZdZ ej>                  d      Z  G d deejB                  e    e      Z"y)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                      e Zd Zy)_RootModelMetaclassN)__name__
__module____qualname__     U/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pydantic/root_model.pyr   r      s    CFr   r   )	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dd	Zdd
ZddZdddZej&                  r(dddddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZd fdZdd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                x    | j                   j                  d      }|t        dd      t        |   di | y )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__7   sD      $$W-#NUg  	!+F+r   c               p    d}|r|t         urt        d      |}| j                  j                  ||        y )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__?   sD     ,, u  D##33D3Mr   c                &    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    _fields_set)r&   model_construct)r(   r    r5   r*   s      r   r6   zRootModel.model_constructK   s     w&Dk&JJr   c                4    | j                   | j                  dS )N__dict____pydantic_fields_set__r8   r0   s    r   __getstate__zRootModel.__getstate__[   s    '+'C'C
 	
r   c                D    t        | d|d          t        | d|d          y )Nr:   r9   )r   )r0   states     r   __setstate__zRootModel.__setstate__a   s&    7?X9YZj%
*;<r   c                    t        |       }|j                  |      }t        |dt        | j                               t        |dt        | j
                               |S )z$Returns a shallow copy of the model.r9   r:   )type__new__r   r   r9   r:   )r0   r(   ms      r   __copy__zRootModel.__copy__e   sK    4jKK:tDMM':;4d4;W;W6XYr   c                    t        |       }|j                  |      }t        |dt        | j                  |             t        |dt        | j                               |S )z!Returns a deep copy of the model.r9   )memor:   )rA   rB   r   r   r9   r   r:   )r0   rF   r(   rC   s       r   __deepcopy__z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                    y)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   )r0   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   s               r   
model_dumpzRootModel.model_dumpy   s    4 r   c                    t        |t              st        S | j                  d   j                  |j                  d   j                  k(  xr t
        |   |      S Nr    )
isinstancer   NotImplemented__pydantic_fields__
annotationr&   __eq__)r0   otherr*   s     r   r\   zRootModel.__eq__   sW    %+!!''/::e>W>W?

* /.	/r   c              #  ,   K   d| j                   f y wrW   )r    r;   s    r   __repr_args__zRootModel.__repr_args__   s     diis   )r    r   returnNone)N)r    r   r5   zset[str] | Noner`   r   )r`   dict[Any, Any])r>   rb   r`   ra   )r`   r   )rF   zdict[int, Any] | Noner`   r   )rI   zLiteral['json', 'python'] | strrJ   r   rK   r   rL   zdict[str, Any] | NonerM   zbool | NonerN   boolrO   rc   rP   rc   rQ   rc   rR   z'bool | Literal['none', 'warn', 'error']rS   rc   r`   r   )r]   r   r`   rc   )r`   z_repr.ReprArgs)r   r   r   __doc____pydantic_root_model____pydantic_private____pydantic_extra____annotations__r'   r   r3   __pydantic_base_init__classmethodr6   r<   r?   rD   rG   typingTYPE_CHECKINGrU   r\   r_   __classcell__)r*   s   @r   r   r   #   s    #
, 5F N '+H#K K
= 
 5=-1$("'%*!&$@D%*	 2	 		
 	 +	 "	  	 #	 	 	 >	 #	 	8/ r   r   )	metaclass)#rd   
__future__r   _annotationsrk   r   r   pydantic_corer    r   	_internalr	   r
   mainr   r   rl   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-<<
"FNN#67 z 	6>>*;<H[ z r   