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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel


class EditRunMetrics(UncheckedBaseModel):
    """
    Metrics about the editing process.
    """

    processing_time_ms: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="processingTimeMs")] = (
        pydantic.Field(alias="processingTimeMs", default=None)
    )
    """
    Total processing time in milliseconds
    """

    field_count: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="fieldCount")] = pydantic.Field(
        alias="fieldCount", default=None
    )
    """
    The number of fields detected in the document.
    """

    page_count: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="pageCount")] = pydantic.Field(
        alias="pageCount", default=None
    )
    """
    The number of pages in the document.
    """

    field_filling_time_ms: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="fieldFillingTimeMs")
    ] = pydantic.Field(alias="fieldFillingTimeMs", default=None)
    """
    The time taken to fill the fields in the document.
    """

    field_detection_time_ms: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="fieldDetectionTimeMs")
    ] = pydantic.Field(alias="fieldDetectionTimeMs", default=None)
    """
    The time taken to detect the fields in the document.
    """

    field_annotation_time_ms: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="fieldAnnotationTimeMs")
    ] = pydantic.Field(alias="fieldAnnotationTimeMs", default=None)
    """
    The time taken to annotate the fields in the document.
    """

    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
