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

from ..core.pydantic_utilities import UniversalBaseModel
import typing_extensions
from ..core.serialization import FieldMetadata
import pydantic
import typing
import datetime as dt
from .get_file_v1file_type import GetFileV1FileType
from .get_file_v1status import GetFileV1Status
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class GetFileV1(UniversalBaseModel):
    download_url: typing_extensions.Annotated[str, FieldMetadata(alias="downloadUrl")] = pydantic.Field()
    """
    URL to download the file
    """

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

    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[GetFileV1FileType, FieldMetadata(alias="fileType")] = pydantic.Field()
    """
    Type of the file
    """

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

    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: GetFileV1Status = pydantic.Field()
    """
    Status of the file
    """

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

    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
