# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .file_upload_write_mode import FileUploadWriteMode


class SingleFileUploadResponse(UniversalBaseModel):
    """
    Response model for single-file upload operations.
    """

    archive_version: str = pydantic.Field()
    """
    New archive version token after this commit.
    """

    created: bool = pydantic.Field()
    """
    True when the upload created a previously missing file.
    """

    file_version: str = pydantic.Field()
    """
    New per-file version token (SHA256 of file content).
    """

    filesystem_id: str = pydantic.Field()
    """
    The filesystem ID.
    """

    path: str = pydantic.Field()
    """
    Normalized relative path written.
    """

    size_bytes: int = pydantic.Field()
    """
    Uploaded file size in bytes.
    """

    write_mode: FileUploadWriteMode = pydantic.Field()
    """
    Applied upload write mode.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
