# 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


class EvaluationSetRunEntityVersion_ExtractorVersion(UncheckedBaseModel):
    """
    The version of the extractor, classifier, or splitter that was run.
    """

    object: typing.Literal["extractor_version"] = "extractor_version"
    id: str
    description: typing.Optional[str] = None
    version: str
    extractor_id: typing_extensions.Annotated[str, FieldMetadata(alias="extractorId")] = pydantic.Field(
        alias="extractorId"
    )
    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")] = pydantic.Field(
        alias="createdAt"
    )

    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 EvaluationSetRunEntityVersion_ClassifierVersion(UncheckedBaseModel):
    """
    The version of the extractor, classifier, or splitter that was run.
    """

    object: typing.Literal["classifier_version"] = "classifier_version"
    id: str
    description: typing.Optional[str] = None
    version: str
    classifier_id: typing_extensions.Annotated[str, FieldMetadata(alias="classifierId")] = pydantic.Field(
        alias="classifierId"
    )
    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")] = pydantic.Field(
        alias="createdAt"
    )

    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 EvaluationSetRunEntityVersion_SplitterVersion(UncheckedBaseModel):
    """
    The version of the extractor, classifier, or splitter that was run.
    """

    object: typing.Literal["splitter_version"] = "splitter_version"
    id: str
    description: typing.Optional[str] = None
    version: str
    splitter_id: typing_extensions.Annotated[str, FieldMetadata(alias="splitterId")] = pydantic.Field(
        alias="splitterId"
    )
    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")] = pydantic.Field(
        alias="createdAt"
    )

    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


EvaluationSetRunEntityVersion = typing_extensions.Annotated[
    typing.Union[
        EvaluationSetRunEntityVersion_ExtractorVersion,
        EvaluationSetRunEntityVersion_ClassifierVersion,
        EvaluationSetRunEntityVersion_SplitterVersion,
    ],
    UnionMetadata(discriminant="object"),
]
