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

from __future__ import annotations

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from .file_with_includes import FileWithIncludes
from .file_with_includes_status import FileWithIncludesStatus
from .media_links_collection import MediaLinksCollection
from .metadata_field import MetadataField
from .project_with_includes import ProjectWithIncludes
from .user import User


class AssetWithIncludes_File(UncheckedBaseModel):
    type: typing.Literal["file"] = "file"
    file_size: int
    media_links: typing.Optional[MediaLinksCollection] = None
    media_type: str
    status: FileWithIncludesStatus
    created_at: dt.datetime
    creator: typing.Optional[User] = None
    id: str
    metadata: typing.Optional[typing.List[MetadataField]] = None
    name: str
    parent_id: typing.Optional[str] = None
    project: typing.Optional[ProjectWithIncludes] = None
    project_id: str
    updated_at: dt.datetime
    view_url: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class AssetWithIncludes_Folder(UncheckedBaseModel):
    type: typing.Literal["folder"] = "folder"
    cover_file_id: typing.Optional[str] = None
    parent_id: typing.Optional[str] = None
    created_at: dt.datetime
    creator: typing.Optional[User] = None
    id: str
    metadata: typing.Optional[typing.List[MetadataField]] = None
    name: str
    project: typing.Optional[ProjectWithIncludes] = None
    project_id: str
    updated_at: dt.datetime
    view_url: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class AssetWithIncludes_VersionStack(UncheckedBaseModel):
    type: typing.Literal["version_stack"] = "version_stack"
    head_version: FileWithIncludes
    parent_id: typing.Optional[str] = None
    created_at: dt.datetime
    creator: typing.Optional[User] = None
    id: str
    metadata: typing.Optional[typing.List[MetadataField]] = None
    name: str
    project: typing.Optional[ProjectWithIncludes] = None
    project_id: str
    updated_at: dt.datetime
    view_url: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


AssetWithIncludes = typing_extensions.Annotated[
    typing.Union[AssetWithIncludes_File, AssetWithIncludes_Folder, AssetWithIncludes_VersionStack],
    UnionMetadata(discriminant="type"),
]
