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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel
from .created_at import CreatedAt
from .file_metadata import FileMetadata
from .file_type import FileType
from .updated_at import UpdatedAt


class FileSummary(UncheckedBaseModel):
    object: typing.Literal["file"] = pydantic.Field(default="file")
    """
    The type of object. Will always be `"file"`.
    """

    id: str = pydantic.Field()
    """
    ID for the file.
    
    Example: `"file_xK9mLPqRtN3vS8wF5hB2cQ"`
    """

    name: str = pydantic.Field()
    """
    The name of the file
    
    Example: `"Invoices.pdf"`
    """

    type: typing.Optional[FileType] = pydantic.Field(default=None)
    """
    The type of the file.
    
    **Availability:** Present when the file type could be determined.
    """

    parent_file_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="parentFileId")] = (
        pydantic.Field(alias="parentFileId", default=None)
    )
    """
    ID of the parent file.
    
    **Availability:** Present for files created via a Splitter in a workflow.
    """

    metadata: FileMetadata
    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")] = pydantic.Field(
        alias="createdAt"
    )
    updated_at: typing_extensions.Annotated[UpdatedAt, FieldMetadata(alias="updatedAt")] = pydantic.Field(
        alias="updatedAt"
    )

    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
