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

import datetime as dt
import typing
import uuid

import pydantic

from ...core.pydantic_utilities import UniversalBaseModel
from .ocr_page import OcrPage


class OcrJobStatus(UniversalBaseModel):
    job_id: uuid.UUID = pydantic.Field()
    """
    OCR job id.
    """

    file_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Original file name.
    """

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

    num_pages: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of pages detected.
    """

    status: str = pydantic.Field()
    """
    Job status (PENDING, PROCESSING, COMPLETED).
    """

    pages: typing.List[OcrPage] = pydantic.Field()
    """
    OCR output by page.
    """

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
