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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing_extensions
import typing
import datetime as dt
from ..core.serialization import FieldMetadata
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ExternalFile(UniversalBaseModel):
    deleted: bool = pydantic.Field()
    """
    Whether the file has been deleted
    """

    deletion_time: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="deletionTime")] = (
        pydantic.Field(default=None)
    )
    """
    Time when the file was deleted
    """

    expiry_time: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="expiryTime")] = (
        pydantic.Field(default=None)
    )
    """
    Time when the file will be deleted
    """

    file_bytes: typing_extensions.Annotated[int, FieldMetadata(alias="fileBytes")] = pydantic.Field()
    """
    Size of the file in bytes
    """

    file_name: typing_extensions.Annotated[str, FieldMetadata(alias="fileName")] = pydantic.Field()
    """
    Name of the file
    """

    file_type: typing_extensions.Annotated[str, FieldMetadata(alias="fileType")] = pydantic.Field()
    """
    Type of the file
    """

    id: str = pydantic.Field()
    """
    ID of the file
    """

    last_heartbeat_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="lastHeartbeatTime")
    ] = pydantic.Field(default=None)
    """
    Time when the file was last heartbeated
    """

    org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field()
    """
    ID of the organization
    """

    session_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="sessionIds")] = (
        pydantic.Field(default=None)
    )
    """
    IDs of the associated sessions
    """

    status: str = pydantic.Field()
    """
    Status of the file
    """

    upload_complete_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="uploadCompleteTime")
    ] = pydantic.Field(default=None)
    """
    Time when the file was uploaded
    """

    upload_start_time: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="uploadStartTime")] = (
        pydantic.Field()
    )
    """
    Time when the file was uploaded
    """

    visible_in_api: typing_extensions.Annotated[bool, FieldMetadata(alias="visibleInApi")] = pydantic.Field()
    """
    Whether the file is visible in the API
    """

    visible_in_portal: typing_extensions.Annotated[bool, FieldMetadata(alias="visibleInPortal")] = pydantic.Field()
    """
    Whether the file is visible in the portal
    """

    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
