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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
from .evaluation_status_dto import EvaluationStatusDto
import datetime as dt
import typing
from .invoice import Invoice
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Evaluation(UniversalBaseModel):
    """
    An evaluation task information tracking analysis of payloads.
    """

    id: str = pydantic.Field()
    """
    Unique identifier of the evaluation to retrieve
    """

    status: EvaluationStatusDto
    progress: float = pydantic.Field()
    """
    Progress of the evaluation from 0.0 to 100.0
    """

    creation_utc: dt.datetime = pydantic.Field()
    """
    UTC timestamp when the evaluation was created
    """

    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error message if the evaluation failed
    """

    invoices: typing.List[Invoice]

    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
