
    df                        d Z ddlmZ ddlmZmZmZmZm	Z	 ddl
mZ dZerddlmZ  eded	ef   
      Ze	ddd	 	 	 	 	 dd       Ze	dd       Z	 dddd	 	 	 	 	 	 	 ddZy)z(Decorator for validating function calls.    )annotations)TYPE_CHECKINGAnyCallableTypeVaroverload   )_validate_call)validate_call)
ConfigDictAnyCallableT.)boundNFconfigvalidate_returnc                     y N r   s     O/home/api-vastappli/venv/lib/python3.12/site-packages/pydantic/validate_call.pyr   r      s         c                     y r   r   )__funcs    r   r   r      s    r   c               ,    dfd}| r ||       S |S )a  Usage docs: https://docs.pydantic.dev/2.4/concepts/validation_decorator/

    Returns a decorated wrapper around the function that validates the arguments and, optionally, the return value.

    Usage may be either as a plain decorator `@validate_call` or with arguments `@validate_call(...)`.

    Args:
        __func: The function to be decorated.
        config: The configuration dictionary.
        validate_return: Whether to validate the return value.

    Returns:
        The decorated function.
    c                    t        | t        t        f      r't        |       j                  }t        d| d| d      t        j                  |       S )NzThe `@z<` decorator should be applied after `@validate_call` (put `@z	` on top))
isinstanceclassmethodstaticmethodtype__name__	TypeErrorr
   ValidateCallWrapper)functionnamer   r   s     r   validatezvalidate_call.<locals>.validate1   sT    hl ;<>**DfTF*fgkflluvww11(FOTTr   )r"   r   returnr   r   )r   r   r   r$   s    `` r   r   r      s    *U r   )r   ConfigDict | Noner   boolr%   z&Callable[[AnyCallableT], AnyCallableT])r   r   r%   r   r   )r   zAnyCallableT | Noner   r&   r   r'   r%   z5AnyCallableT | Callable[[AnyCallableT], AnyCallableT])__doc__
__future__r   _annotationstypingr   r   r   r   r   	_internalr
   __all__r   r   r   r   r   r   r   <module>r.      s    . 2 B B %
">#s(1CDL 
#' :>+ 
 
 

 #' !%!	  	
 ;r   