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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .task_annotators_item import TaskAnnotatorsItem
import datetime as dt
from .task_comment_authors_item import TaskCommentAuthorsItem
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Task(UniversalBaseModel):
    id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Unique ID of the task
    """

    predictions: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(
        default=None
    )
    """
    Predictions for this task
    """

    annotations: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(
        default=None
    )
    """
    Annotations for this task
    """

    drafts: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None)
    """
    Drafts for this task
    """

    annotators: typing.Optional[typing.List[TaskAnnotatorsItem]] = pydantic.Field(default=None)
    """
    List of annotators for this task
    """

    inner_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Inner ID of the task
    """

    cancelled_annotations: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of cancelled annotations for this task
    """

    total_annotations: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of annotations for this task
    """

    total_predictions: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of predictions for this task
    """

    completed_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Completion time of the task
    """

    file_upload: typing.Optional[str] = pydantic.Field(default=None)
    """
    File upload ID for this task
    """

    storage_filename: typing.Optional[str] = pydantic.Field(default=None)
    """
    Storage filename for this task
    """

    avg_lead_time: typing.Optional[float] = pydantic.Field(default=None)
    """
    Average lead time for this task
    """

    draft_exists: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether a draft exists for this task or not
    """

    updated_by: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(
        default=None
    )
    """
    List of annotators' info who updated this task
    """

    data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Data of the task
    """

    meta: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Meta information of the task
    """

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

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

    is_labeled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the task is labeled or not
    """

    overlap: typing.Optional[float] = pydantic.Field(default=None)
    """
    Overlap for the task
    """

    comment_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of comments for this task
    """

    unresolved_comment_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of unresolved comments for this task
    """

    last_comment_updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last updated time of the comments for this task
    """

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

    comment_authors: typing.Optional[typing.List[TaskCommentAuthorsItem]] = pydantic.Field(default=None)
    """
    List of comment authors for this task
    """

    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
