# 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 .continuous_query_task_status import ContinuousQueryTaskStatus


class ContinuousQueryTaskHistoryEntry(UniversalBaseModel):
    query_id: str
    user_id: str
    status: ContinuousQueryTaskStatus
    scheduled_at: dt.datetime
    started_at: typing.Optional[dt.datetime] = None
    ended_at: typing.Optional[dt.datetime] = None
    error_details: typing.Optional[str] = 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
