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

from __future__ import annotations

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, UnionMetadata
from .created_at import CreatedAt
from .updated_at import UpdatedAt


class BatchRunEntity_Extractor(UncheckedBaseModel):
    """
    The extractor, classifier, or splitter that was run.

    **Availability:** Present when an entity was provided when creating the batch run.
    """

    object: typing.Literal["extractor"] = "extractor"
    id: str
    name: str
    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


class BatchRunEntity_Classifier(UncheckedBaseModel):
    """
    The extractor, classifier, or splitter that was run.

    **Availability:** Present when an entity was provided when creating the batch run.
    """

    object: typing.Literal["classifier"] = "classifier"
    id: str
    name: str
    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


class BatchRunEntity_Splitter(UncheckedBaseModel):
    """
    The extractor, classifier, or splitter that was run.

    **Availability:** Present when an entity was provided when creating the batch run.
    """

    object: typing.Literal["splitter"] = "splitter"
    id: str
    name: str
    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


BatchRunEntity = typing_extensions.Annotated[
    typing.Union[BatchRunEntity_Extractor, BatchRunEntity_Classifier, BatchRunEntity_Splitter],
    UnionMetadata(discriminant="object"),
]
