# 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, UniversalBaseModel


class StateInference_Queued(UniversalBaseModel):
    status: typing.Literal["QUEUED"] = "QUEUED"
    created_timestamp_ms: int

    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 StateInference_InProgress(UniversalBaseModel):
    status: typing.Literal["IN_PROGRESS"] = "IN_PROGRESS"
    created_timestamp_ms: int
    started_timestamp_ms: int

    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 StateInference_Completed(UniversalBaseModel):
    status: typing.Literal["COMPLETED"] = "COMPLETED"
    created_timestamp_ms: int
    started_timestamp_ms: int
    ended_timestamp_ms: int
    num_predictions: int
    num_errors: int

    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 StateInference_Failed(UniversalBaseModel):
    status: typing.Literal["FAILED"] = "FAILED"
    created_timestamp_ms: int
    started_timestamp_ms: int
    ended_timestamp_ms: int
    message: str

    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


StateInference = typing_extensions.Annotated[
    typing.Union[StateInference_Queued, StateInference_InProgress, StateInference_Completed, StateInference_Failed],
    pydantic.Field(discriminator="status"),
]
