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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
from .project_import_status import ProjectImportStatus
import datetime as dt
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ProjectImport(UniversalBaseModel):
    id: typing.Optional[int] = None
    preannotated_from_fields: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    commit_to_project: typing.Optional[bool] = None
    return_task_ids: typing.Optional[bool] = None
    status: typing.Optional[ProjectImportStatus] = None
    url: typing.Optional[str] = None
    traceback: typing.Optional[str] = None
    error: typing.Optional[str] = None
    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Creation time
    """

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

    finished_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Complete or fail time
    """

    task_count: typing.Optional[int] = None
    annotation_count: typing.Optional[int] = None
    prediction_count: typing.Optional[int] = None
    duration: typing.Optional[int] = None
    file_upload_ids: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    could_be_tasks_list: typing.Optional[bool] = None
    found_formats: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    data_columns: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    tasks: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    task_ids: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    project: typing.Optional[int] = 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
