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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .model_run_status_enum import ModelRunStatusEnum
from .project_subset_enum import ProjectSubsetEnum


class ModelRun(UncheckedBaseModel):
    completed_at: typing.Optional[dt.datetime] = None
    created_at: typing.Optional[dt.datetime] = None
    created_by: typing.Optional[int] = None
    id: typing.Optional[int] = None
    job_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Job ID for inference job for a ModelRun e.g. Adala job ID
    """

    organization: typing.Optional[int] = None
    parent_model: typing.Optional[int] = None
    predictions_updated_at: typing.Optional[dt.datetime] = None
    project: int
    project_subset: typing.Optional[ProjectSubsetEnum] = None
    status: typing.Optional[ModelRunStatusEnum] = None
    total_correct_predictions: typing.Optional[int] = None
    total_predictions: typing.Optional[int] = None
    total_tasks: typing.Optional[int] = None
    triggered_at: typing.Optional[dt.datetime] = None

    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
