"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .airwaybillfields import AirWaybillFields, AirWaybillFieldsTypedDict
from .document import Document, DocumentTypedDict
from abbyy_document_ai.types import BaseModel
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class AirWaybillValidationErrorsTypedDict(TypedDict):
    message: str


class AirWaybillValidationErrors(BaseModel):
    message: str


class AirWaybillTypedDict(TypedDict):
    r"""Extracted Air Waybill Data Response"""

    meta: DocumentTypedDict
    r"""Represents a document that has been submitted for processing."""
    fields: NotRequired[AirWaybillFieldsTypedDict]
    r"""Fields extracted from an air waybill"""
    validation_errors: NotRequired[List[AirWaybillValidationErrorsTypedDict]]
    r"""An array of validation errors that occurred while processing the document. These typically do not prevent field extraction, but rather indicate issues extracting key fields."""


class AirWaybill(BaseModel):
    r"""Extracted Air Waybill Data Response"""

    meta: Document
    r"""Represents a document that has been submitted for processing."""

    fields: Optional[AirWaybillFields] = None
    r"""Fields extracted from an air waybill"""

    validation_errors: Annotated[
        Optional[List[AirWaybillValidationErrors]],
        pydantic.Field(alias="validationErrors"),
    ] = None
    r"""An array of validation errors that occurred while processing the document. These typically do not prevent field extraction, but rather indicate issues extracting key fields."""
