o
    ɝi                     @   s   d dl Z d dlZd dlmZmZ d dlmZ d dlmZm	Z	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 ejd	krJd d
l mZ nd d
lmZ eG dd dZeG dd dZdS )    N)	dataclassfield)cached_property)AnyCallableListOptionalSequenceUnion)
ModelField)SecurityBase)DependencyCacheKey)Literal)      )iscoroutinefunctionc                   @   s*   e Zd ZU eed< dZeee  ed< dS )SecurityRequirementsecurity_schemeNscopes)	__name__
__module____qualname__r   __annotations__r   r   r	   str r   r   W/var/www/html/ocr-read/venv/lib/python3.10/site-packages/fastapi/dependencies/models.pyr      s   
 r   c                   @   s  e Zd ZU eedZee ed< eedZ	ee ed< eedZ
ee ed< eedZee ed< eedZee ed< eedZed  ed< eedZee ed< d	Zee ed
< d	Zeedef  ed< d	Zee ed< d	Zee ed< d	Zee ed< d	Zee ed< d	Zee ed< d	Zee ed< d	Zeee  ed< dZeed< d	Zee ed< d	Z e!e"d d	f ed< e#de$fddZ%e#defddZ&e#defddZ'e#defd d!Z(e#de!ed	f fd"d#Z)d	S )$	Dependant)default_factorypath_paramsquery_paramsheader_paramscookie_paramsbody_paramsdependenciessecurity_requirementsNname.callrequest_param_namewebsocket_param_namehttp_connection_param_nameresponse_param_namebackground_tasks_param_namesecurity_scopes_param_namesecurity_scopesT	use_cachepath)functionrequestscopereturnc                 C   s$   | j ttt| jp	g | jpdfS )N )r&   tuplesortedsetr-   computed_scopeselfr   r   r   	cache_key.   s   zDependant.cache_keyc                 C   (   t | jrdS t| jdd }t |S NT__call__)inspectisgeneratorfunctionr&   getattrr:   dunder_callr   r   r   is_gen_callable6      
zDependant.is_gen_callablec                 C   r<   r=   )r?   isasyncgenfunctionr&   rA   rB   r   r   r   is_async_gen_callable=   rE   zDependant.is_async_gen_callablec                 C   s<   t | jrt| jS t | jrdS t| jdd }t|S )NFr>   )r?   	isroutiner&   r   isclassrA   rB   r   r   r   is_coroutine_callableD   s   
zDependant.is_coroutine_callablec                 C   s    | j r| j S | js| jrdS d S )Nr1   )r2   rD   rG   r9   r   r   r   r8   M   s
   zDependant.computed_scope)*r   r   r   r   listr   r   r   r   r   r    r!   r"   r#   r$   r   r%   r   r   r&   r   r   r'   r(   r)   r*   r+   r,   r-   r.   boolr/   r2   r
   r   r   r   r;   rD   rG   rJ   r8   r   r   r   r   r      s<   
 r   )r?   sysdataclassesr   r   	functoolsr   typingr   r   r   r   r	   r
   fastapi._compatr   fastapi.security.baser   fastapi.typesr   typing_extensionsr   version_infor   asyncior   r   r   r   r   r   <module>   s      
