# 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, UniversalBaseModel
from .json_node import JsonNode
from .local_runner_job_metadata import LocalRunnerJobMetadata
from .local_runner_job_status import LocalRunnerJobStatus


class LocalRunnerJob(UniversalBaseModel):
    id: typing.Optional[str] = None
    runner_id: typing.Optional[str] = None
    agent_name: typing.Optional[str] = None
    status: typing.Optional[LocalRunnerJobStatus] = None
    inputs: typing.Optional[JsonNode] = None
    result: typing.Optional[JsonNode] = None
    error: typing.Optional[str] = None
    project_id: typing.Optional[str] = None
    trace_id: typing.Optional[str] = None
    mask_id: typing.Optional[str] = None
    metadata: typing.Optional[LocalRunnerJobMetadata] = None
    timeout: typing.Optional[int] = None
    created_at: typing.Optional[dt.datetime] = None
    started_at: typing.Optional[dt.datetime] = None
    completed_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
