o
    㥵i                     @  s  d dl mZ d dlmZmZmZmZ d dlmZ d dl	m
Z
 ddlmZ ddlmZ dd	lmZmZmZmZmZ ed
Zefdddddd+ddZefdddddd+ddZefdddddd+ddZefdddddd+ddZefdddddd d,d#d$Zd%d&d-d)d*ZdS ).    )annotations)AnyCallableOptionalTypeVar)Field)	Annotated   )	Undefined   )Depends)InBodyInCookieInHeaderInPathInQueryTNdefault_factoryaliastitledescriptiondefaultr   r   Optional[Callable[[], Any]]r   
str | Noner   r   extrareturnc                K  *   t | f||||d|}tt|t f S q  
    Used to provide extra information about a field.

    :param default: since this is replacing the field’s default, its first argument is used
      to set the default, use ellipsis (``...``) to indicate the field is required
    :param default_factory: callable that will be called when a default value is needed for this field
      If both `default` and `default_factory` are set, an error is raised.
    :param alias: the public name of the field
    :param title: can be any string, used in the schema
    :param description: can be any string, used in the schema
    :param **extra: any pydantic field kwargs
    r   )r   r   r   r   r   r   r   r   r   r   
field_info r"   R/home/ubuntu/.local/lib/python3.10/site-packages/kui/parameters/field_functions.pyPath      r$   c                K  r   r   )r   r   r   r   r    r"   r"   r#   Query/   r%   r&   c                K  s6   t | f||r
| nd||d|}tt|t f S )r   Nr   )r   lowerr   r   r   r    r"   r"   r#   HeaderO   s   r(   c                K  r   r   )r   r   r   r   r    r"   r"   r#   Cookieo   r%   r)   F)r   r   r   r   	exclusiver*   boolc                K  s.   t | f||||d|}tt|t|df S )u  
    Used to provide extra information about a field.

    :param default: since this is replacing the field’s default, its first argument is used
      to set the default, use ellipsis (``...``) to indicate the field is required
    :param default_factory: callable that will be called when a default value is needed for this field
      If both `default` and `default_factory` are set, an error is raised.
    :param alias: the public name of the field
    :param title: can be any string, used in the schema
    :param description: can be any string, used in the schema
    :param exclusive: decide whether this field receives all parameters
    :param **extra: any pydantic field kwargs
    r   )r*   )r   r   r   r   )r   r   r   r   r   r*   r   r!   r"   r"   r#   Body   s   r,   Tcachecallr   c                C  s   t | |dS )z
    Used to provide extra information about a field.

    :param call: callable that will be called when a dependency is needed for this field
    :param cache: whether to cache the result of the dependency call in the request state
    r-   )
DependInfo)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   r   r   r   r   r   r   r*   r+   r   r   r   r   )r/   r   r   r   )
__future__r   typingr   r   r   r   pydanticr   typing_extensionsr   pydantic_compatibler
   fieldsr   r0   r   r   r   r   r   r   r$   r&   r(   r)   r,   r"   r"   r"   r#   <module>   sZ    !!!!"