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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
from .extract_agent import ExtractAgent
from .status_enum import StatusEnum
import typing
from .file import File
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ExtractJob(UniversalBaseModel):
    id: str = pydantic.Field()
    """
    The id of the extraction job
    """

    extraction_agent: ExtractAgent = pydantic.Field()
    """
    The agent that the job was run on.
    """

    status: StatusEnum = pydantic.Field()
    """
    The status of the extraction job
    """

    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    The error that occurred during extraction
    """

    file: File = pydantic.Field()
    """
    The file that the extract was extracted from
    """

    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
