o
    $6d                     @  s   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r0ddlmZ eded	ef d
Ze	ddddddZe	dddZ	dddddddZdS )z(Decorator for validating function calls.    )annotations)TYPE_CHECKINGAnyCallableTypeVaroverload   )_validate_call)validate_call)
ConfigDictAnyCallableT.)boundNFconfigvalidate_returnr   ConfigDict | Noner   boolreturn&Callable[[AnyCallableT], AnyCallableT]c                 C     d S N r   r   r   mC:\Users\jesus\OneDrive\Desktop\erpjis_fastapi\backend\jisbackend\Lib\site-packages\pydantic/validate_call.pyr
      s   r
   __funcc                 C  r   r   r   )r   r   r   r   r
      s   AnyCallableT | None5AnyCallableT | Callable[[AnyCallableT], AnyCallableT]c                  s    d fdd}| r|| S |S )a  Usage docs: https://docs.pydantic.dev/2.2/usage/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.
    functionr   r   c                   s<   t | ttfrt| j}td| d| dt|  S )NzThe `@z<` decorator should be applied after `@validate_call` (put `@z	` on top))
isinstanceclassmethodstaticmethodtype__name__	TypeErrorr	   ZValidateCallWrapper)r   namer   r   r   validate1   s   
zvalidate_call.<locals>.validateN)r   r   r   r   r   )r   r   r   r$   r   r   r   r
      s   )r   r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   r   r   r   )__doc__
__future__r   Z_annotationstypingr   r   r   r   r   	_internalr	   __all__r   r   r   r
   r   r   r   r   <module>   s$    