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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
import datetime as dt
from .annotations_dm_field_last_action import AnnotationsDmFieldLastAction
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class AnnotationsDmField(UniversalBaseModel):
    id: typing.Optional[int] = None
    result: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None)
    """
    List of annotation results for the task
    """

    created_username: typing.Optional[str] = pydantic.Field(default=None)
    """
    Username string
    """

    created_ago: typing.Optional[str] = pydantic.Field(default=None)
    """
    Time delta from creation time
    """

    completed_by: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    User details who completed this annotation.
    """

    unique_id: typing.Optional[str] = None
    was_cancelled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    User skipped the task
    """

    ground_truth: typing.Optional[bool] = pydantic.Field(default=None)
    """
    This annotation is a Ground Truth (ground_truth)
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Creation time
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last updated time
    """

    draft_created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Draft creation time
    """

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

    import_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Original annotation ID that was at the import step or NULL if this annotation wasn't imported
    """

    last_action: typing.Optional[AnnotationsDmFieldLastAction] = pydantic.Field(default=None)
    """
    Action which was performed in the last annotation history item
    """

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

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

    updated_by: typing.Optional[int] = pydantic.Field(default=None)
    """
    Last user who updated this annotation
    """

    parent_prediction: typing.Optional[int] = pydantic.Field(default=None)
    """
    Points to the prediction from which this annotation was created
    """

    parent_annotation: typing.Optional[int] = pydantic.Field(default=None)
    """
    Points to the parent annotation from which this annotation was created
    """

    last_created_by: typing.Optional[int] = pydantic.Field(default=None)
    """
    User who created the last annotation history item
    """

    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
