HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/fastapi/__pycache__/datastructures.cpython-310.pyc
o

�h��@s�ddlmZmZmZmZmZmZmZmZm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZmZGdd�de�ZGd
d�d�Zed�Zdedefdd�ZdS)�)	�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�Doccs�eZdZUdZeeed�fed<eee	ed�fed<eee
ed�fed<eeed�fed	<eee	ed
�fed<deeed
�fddf�fdd�Z
	d1dee
ed�fdef�fdd�
Zdee
ed�fddf�fdd�Zd2�fdd�Zededdeedeffdd��Zededd edefd!d"��Zed#ed$eddfd%d&��Zes�ed'ee	efddfd(d)��Zed*ed+edefd,d-��Zed.eed+eegefdefd/d0��Z �Z!S)3raA
    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).�filezThe original file name.�filenamezThe size of the file in bytes.�sizezThe 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��|�IdHS)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__��I/usr/local/CyberCP/lib/python3.10/site-packages/fastapi/datastructures.pyr"K��zUploadFile.write���zL
                The number of bytes to read from the file.
                c�r )z|
        Read some bytes from the file.

        To be awaitable, compatible with async, this is run in threadpool.
        N)r!�read)r#rr$r&r'r*_s�zUploadFile.read�offsetzO
                The position in bytes to seek to in the file.
                c�r )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$r&r'r,qr(zUploadFile.seekc�s�t���IdHS)zm
        Close the file.

        To be awaitable, compatible with async, this is run in threadpool.
        N)r!�close�r#r$r&r'r-�s�zUploadFile.close�cls.ccs�|jVdS�N)�validate)r/r&r&r'�__get_validators__�s�zUploadFile.__get_validators__�vcCs t|t�stdt|�����|S�NzExpected UploadFile, received: )�
isinstance�StarletteUploadFile�
ValueError�type)r/r3r&r&r'r1�s
zUploadFile.validate�_UploadFile__input_value�_cCs&t|t�stdt|�����tt|�Sr4)r5r6r7r8r
r)r/r9r:r&r&r'�	_validate�s

zUploadFile._validate�field_schemacCs|�ddd��dS�N�string�binary)r8�format)�update)r/r<r&r&r'�__modify_schema__�szUploadFile.__modify_schema__�core_schema�handlercCs
ddd�Sr=r&)r/rCrDr&r&r'�__get_pydantic_json_schema__��
z'UploadFile.__get_pydantic_json_schema__�sourcecC�
t|j�Sr0)rr;)r/rGrDr&r&r'�__get_pydantic_core_schema__�rFz'UploadFile.__get_pydantic_core_schema__)r))rN)"�__name__�
__module__�__qualname__�__doc__rrr�__annotations__r�str�intr�bytesr"r*r,r-�classmethodrrrrr2r1r;rrrBrr
rrErI�
__classcell__r&r&r$r'rs�
!�������
������
�����
�$������rc@s>eZdZdZdefdd�Zdefdd�Zdedefd	d
�Z	dS)�DefaultPlaceholderz�
    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.
    �valuecCs
||_dSr0�rU)r#rUr&r&r'�__init__��
zDefaultPlaceholder.__init__rcCrHr0)�boolrUr.r&r&r'�__bool__�rXzDefaultPlaceholder.__bool__�ocCst|t�o
|j|jkSr0)r5rTrU)r#r[r&r&r'�__eq__�szDefaultPlaceholder.__eq__N)
rJrKrLrMrrWrYrZ�objectr\r&r&r&r'rT�s
rT�DefaultTyperUrcCst|�S)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.
    )rTrVr&r&r'�Default�sr_N)�typingrrrrrrrr	r
�fastapi._compatrrr
rr�starlette.datastructuresrrrrrrrr6�typing_extensionsrrrTr^r_r&r&r&r'�<module>s,