
    5h                         S SK JrJrJrJrJrJrJr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Jr   " S S\5      r " S S5      r\" S5      rS\S\4S jrg)    )	AnyBinaryIOCallableDictIterableOptionalTypeTypeVarcast)PYDANTIC_V2
CoreSchemaGetJsonSchemaHandlerJsonSchemaValue"with_info_plain_validator_function)URL)Address)FormData)Headers)QueryParams)State)
UploadFile)	AnnotatedDocc                   r  ^  \ rS rSr% Sr\\\" S5      4   \S'   \\	\
   \" S5      4   \S'   \\	\   \" S5      4   \S'   \\\" S	5      4   \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      4S j5       r\S\S    S\S\4S j5       r\S\S\SS 4S j5       r\(       d  \S \\
\4   SS4S! j5       r\S"\S#\S\4S$ j5       r \S%\\   S#\\/\4   S\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).filez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.
                returnNc                 >   >#    [         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     a/var/www/html/cementerio_25MayoBackend/env/lib/python3.13/site-packages/fastapi/datastructures.pyr%   UploadFile.writeK   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.read_   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(   r0   UploadFile.seekq   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(   r3   UploadFile.close   s      W]_$$$s   cls.c              #   (   #    U R                   v   g 7fN)validate)r5   s    r(   __get_validators__UploadFile.__get_validators__   s     lls   vc                 ^    [        U[        5      (       d  [        S[        U5       35      eU$ NzExpected UploadFile, received: )
isinstanceStarletteUploadFile
ValueErrortype)r5   r;   s     r(   r8   UploadFile.validate   s,    !011>tAwiHII    _UploadFile__input_value_c                 z    [        U[        5      (       d  [        S[        U5       35      e[	        [
        U5      $ r=   )r>   r?   r@   rA   r   r   )r5   rD   rE   s      r(   	_validateUploadFile._validate   s6    -)<==>tM?R>STUUJ..rC   field_schemac                 ,    UR                  SSS.5        g Nstringbinary)rA   format)update)r5   rI   s     r(   __modify_schema__UploadFile.__modify_schema__   s    X FGrC   core_schemahandlerc                     SSS.$ rK    )r5   rR   rS   s      r(   __get_pydantic_json_schema__'UploadFile.__get_pydantic_json_schema__   s     !H55rC   sourcec                 ,    [        U R                  5      $ r7   )r   rG   )r5   rX   rS   s      r(   __get_pydantic_core_schema__'UploadFile.__get_pydantic_core_schema__   s     2#--@@rC   rU   ))r"   N)$__name__
__module____qualname____firstlineno____doc__r   r   r   __annotations__r   strintr   bytesr%   r,   r0   r3   classmethodr	   r   r   r   r9   r8   rG   r   r   rP   r   r   r   rV   rZ   __static_attributes____classcell__)r'   s   @r(   r   r      s`   B :;	=  s+D'EEFF
HSM3'G#HH
IIw$A BBCCsOPP )
) 
): (
( 
( ($*
* 
*(% \ 2 xc@R7S   d<( S S  
 /c /c /l / /
 		Hc3h 	HD 	H 
	H 6$6/C6	6 6
 A#YA)13%2C)DA	A ArC   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 r7   rl   )r&   rl   s     r(   __init__DefaultPlaceholder.__init__   s    
rC   r"   c                 ,    [        U R                  5      $ r7   )boolrl   )r&   s    r(   __bool__DefaultPlaceholder.__bool__   s    DJJrC   oc                 b    [        U[        5      =(       a    UR                  U R                  :H  $ r7   )r>   rj   rl   )r&   ru   s     r(   __eq__DefaultPlaceholder.__eq__   s"    !/0JQWW

5JJrC   rn   N)r]   r^   r_   r`   ra   r   ro   rr   rs   objectrw   rg   rU   rC   r(   rj   rj      s5    c  $  K K4 KrC   rj   DefaultTyperl   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.
)rj   rn   s    r(   Defaultr|      s     e$$rC   N)typingr   r   r   r   r   r   r	   r
   r   fastapi._compatr   r   r   r   r   starlette.datastructuresr   r   r   r   r   r   r   r?   typing_extensionsr   r   rj   rz   r|   rU   rC   r(   <module>r      su   
 
 
  0 7 9 7 ? 3 F ,OA$ OAdK K$ m$%; %; %rC   