# 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.

    **Availability:** Present when `status` is `"PROCESSED"`.
    """

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

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

    field_count: typing_extensions.Annotated[int, FieldMetadata(alias="fieldCount")] = pydantic.Field(
        alias="fieldCount"
    )
    """
    The total number of fields in the schema.
    """

    fields_detected_count: typing_extensions.Annotated[int, FieldMetadata(alias="fieldsDetectedCount")] = (
        pydantic.Field(alias="fieldsDetectedCount")
    )
    """
    The number of fields that were automatically detected.
    """

    fields_annotated_count: typing_extensions.Annotated[int, FieldMetadata(alias="fieldsAnnotatedCount")] = (
        pydantic.Field(alias="fieldsAnnotatedCount")
    )
    """
    The number of fields that were annotated with bounding boxes.
    """

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

    field_annotation_time_ms: typing_extensions.Annotated[float, FieldMetadata(alias="fieldAnnotationTimeMs")] = (
        pydantic.Field(alias="fieldAnnotationTimeMs")
    )
    """
    The time taken to annotate field positions in the document, in milliseconds.
    """

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

    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
