ó
    Ú°›jÉ  ã                   óø   • S SK JrJr  S SKJrJrJrJrJr  S SK	J
r
  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr   " S S\5      r " S S5      r\" S5      rS\S\4S jr\" S5      rg)é    )ÚCallableÚMapping)Ú	AnnotatedÚAnyÚBinaryIOÚTypeVarÚcast)ÚDoc)ÚGetJsonSchemaHandler)ÚURL)ÚAddress)ÚFormData)ÚHeaders)ÚQueryParams)ÚState)Ú
UploadFilec            	       ó  ^ • \ rS rSr% Sr\\\" S5      4   \S'   \\	S-  \" S5      4   \S'   \\
S-  \" S5      4   \S	'   \\\" S
5      4   \S'   \\	S-  \" S5      4   \S'   S\\\" S5      4   SS4U 4S jjr S!S	\\
\" S5      4   S\4U 4S jjjrS\\
\" S5      4   SS4U 4S jjrS"U 4S jjr\S\S\SS 4S j5       r\S\\	\4   S\S\\	\4   4S j5       r\S\\   S\\/\\	\4   4   S\\	\4   4S j5       rS rU =r$ )#r   é   añ  
A file uploaded in a request.

Define it as a *path operation function* (or dependency) parameter.

If you are using a regular `def` function, you can use the `upload_file.file`
attribute to access the raw standard Python file (blocking, not async), useful and
needed for non-async code.

Read more about it in the
[FastAPI docs for Request Files](https://fastapi.tiangolo.com/tutorial/request-files/).

## Example

```python
from typing import Annotated

from fastapi import FastAPI, File, UploadFile

app = FastAPI()


@app.post("/files/")
async def create_file(file: Annotated[bytes, File()]):
    return {"file_size": len(file)}


@app.post("/uploadfile/")
async def create_upload_file(file: UploadFile):
    return {"filename": file.filename}
```
z,The standard Python file object (non-async).ÚfileNzThe original file name.ÚfilenamezThe size of the file in bytes.ÚsizezThe headers of the request.Úheadersz2The content type of the request, from the headers.Úcontent_typeÚdatazA
                The bytes to write to the file.
                Úreturnc              ƒ   ó>   >#   • [         TU ]  U5      I Sh  v•N $  N7f)z¦
Write some bytes to the file.

You normally wouldn't use this from a file you read in a request.

To be awaitable, compatible with async, this is run in threadpool.
N)ÚsuperÚwrite)Úselfr   Ú	__class__s     €ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/fastapi/datastructures.pyr   ÚUploadFile.writeB   s   øé € ô$ ‘W‘] 4Ó(×(Ð(Ñ(ùó   ƒ–—zL
                The number of bytes to read from the file.
                c              ƒ   ó>   >#   • [         TU ]  U5      I Sh  v•N $  N7f)zd
Read some bytes from the file.

To be awaitable, compatible with async, this is run in threadpool.
N)r   Úread)r   r   r    s     €r!   r%   ÚUploadFile.readV   s   øé € ô  ‘W‘\ $Ó'×'Ð'Ñ'ùr#   ÚoffsetzO
                The position in bytes to seek to in the file.
                c              ƒ   ó>   >#   • [         TU ]  U5      I Sh  v•N $  N7f)zž
Move to a position in the file.

Any next read or write will be done from that position.

To be awaitable, compatible with async, this is run in threadpool.
N)r   Úseek)r   r'   r    s     €r!   r)   ÚUploadFile.seekh   s   øé € ô$ ‘W‘\ &Ó)×)Ð)Ñ)ùr#   c              ƒ   ó<   >#   • [         TU ]  5       I Sh  v•N $  N7f)zU
Close the file.

To be awaitable, compatible with async, this is run in threadpool.
N)r   Úclose)r   r    s    €r!   r,   ÚUploadFile.close|   s   øé € ô ‘W‘]“_×$Ð$Ñ$ùs   ƒ•–Ú_UploadFile__input_valueÚ_c                 óz   • [        U[        5      (       d  [        S[        U5       35      e[	        [
        U5      $ )NzExpected UploadFile, received: )Ú
isinstanceÚStarletteUploadFileÚ
ValueErrorÚtyper	   r   )Úclsr.   r/   s      r!   Ú	_validateÚUploadFile._validate„   s6   € ä˜-Ô)<×=Ñ=ÜÐ>¼tÀMÓ?RÐ>SÐTÓUÐUÜ”J Ó.Ð.ó    Úcore_schemaÚhandlerc                 ó   • SSS.$ )NÚstringzapplication/octet-stream)r4   ÚcontentMediaType© )r5   r9   r:   s      r!   Ú__get_pydantic_json_schema__Ú'UploadFile.__get_pydantic_json_schema__Š   s   € ð !Ð6PÑQÐQr8   Úsourcec                 ó2   • SSK Jn  U" U R                  5      $ )Né   )Ú"with_info_plain_validator_function)Ú
_compat.v2rD   r6   )r5   rA   r:   rD   s       r!   Ú__get_pydantic_core_schema__Ú'UploadFile.__get_pydantic_core_schema__�   s   € õ 	Cá1°#·-±-Ó@Ð@r8   r>   )éÿÿÿÿ)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r
   Ú__annotations__ÚstrÚintr   Úbytesr   r%   r)   r,   Úclassmethodr   r6   r   r   Údictr?   r4   r   rF   Ú__static_attributes__Ú__classcell__)r    s   @r!   r   r      sô  ø‡ ñðB ØÙÐ:Ó;ð	=ñó ð ˜˜d™
¡CÐ(AÓ$BÐBÑCÓCØ
�C˜$‘J¡Ð$DÓ EÐEÑ
FÓFØ�w¡Ð$AÓ BÐBÑCÓCØØˆd‰
‘CÐLÓMÐMñó ð)àØÙðóðñ
ð)ð 
÷)ð: ñ(àØÙðóðñ
ð(ð 
÷(ð (ð$*àØÙðóðñ
ð*ð 
÷*÷(%ð ð/ cð /¨cð /°ló /ó ð/ð
 ðRØ! # s (Ñ+ðRØ6JðRà	ˆc�3ˆh‰óRó ðRð
 ðAØ˜#‘YðAØ)1°3°%¸ÀÀcÀÑ9JÐ2JÑ)KðAà	��c�Ñ	óAó öAr8   r   c                   óF   • \ rS rSrSrS\4S jrS\4S jrS\	S\4S jr
S	rg
)ÚDefaultPlaceholderé™   z§
You shouldn't use this class directly.

It's used internally to recognize when a default value has been overwritten, even
if the overridden default value was truthy.
Úvaluec                 ó   • Xl         g ©N©rY   )r   rY   s     r!   Ú__init__ÚDefaultPlaceholder.__init__¡   s   € Ø�
r8   r   c                 ó,   • [        U R                  5      $ r[   )ÚboolrY   )r   s    r!   Ú__bool__ÚDefaultPlaceholder.__bool__¤   s   € Ü�D—J‘JÓÐr8   Úoc                 ób   • [        U[        5      =(       a    UR                  U R                  :H  $ r[   )r1   rW   rY   )r   rc   s     r!   Ú__eq__ÚDefaultPlaceholder.__eq__§   s"   € Ü˜!Ô/Ó0×J°Q·W±WÀÇ
Á
Ñ5JÐJr8   r\   N)rI   rJ   rK   rL   rM   r   r]   r`   ra   Úobjectre   rT   r>   r8   r!   rW   rW   ™   s5   † ñð˜cô ð ˜$ô  ðK˜ð K 4÷ Kr8   rW   ÚDefaultTyperY   r   c                 ó   • [        U 5      $ )zª
You shouldn't use this function directly.

It's used internally to recognize when a default value has been overwritten, even
if the overridden default value was truthy.
)rW   r\   s    r!   ÚDefaultrj   ®   s   € ô ˜eÓ$Ð$r8   N)Úcollections.abcr   r   Útypingr   r   r   r   r	   Úannotated_docr
   Úpydanticr   Ústarlette.datastructuresr   r   r   r   r   r   r   r2   rW   rh   rj   Ú_Unsetr>   r8   r!   Ú<module>rq      sw   ðß -÷õ õ Ý )Ý /Ý 7Ý 9Ý 7Ý ?Ý 3Ý FôAAÐ$ô AA÷HKñ Kñ$ �mÓ$€ð%�;ð % ;ô %ñ 
�‹�r8   