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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .action_enum import ActionEnum
import pydantic
import datetime as dt
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class AnnotationHistory(UncheckedBaseModel):
    """
    A ModelSerializer that takes additional arguments for
    "fields", "omit" and "expand" in order to
    control which fields are displayed, and whether to replace simple
    values with complex, nested serializations
    """

    action: typing.Optional[ActionEnum] = None
    annotation_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Corresponding annotation for this historical annotation
    """

    comment: typing.Optional[str] = None
    comment_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Comment id sent with result
    """

    created_at: typing.Optional[dt.datetime] = None
    created_by: typing.Optional[int] = pydantic.Field(default=None)
    """
    Created by user id
    """

    draft_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Corresponding draft for this historical annotation
    """

    id: typing.Optional[int] = None
    lead_time: typing.Optional[float] = pydantic.Field(default=None)
    """
    How much time it took to annotate the task
    """

    organization_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Organization for this annotation history
    """

    project_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Project for this annotation history
    """

    result: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
    """
    Labeling result
    """

    review_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    AnnotationReview ID, using with review field
    """

    started_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The time that a user started working on this revision of the annotation
    """

    task_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Task id
    """

    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
