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

from __future__ import annotations
from .dangerousgoodsdeclarationfields import (
    DangerousGoodsDeclarationFields,
    DangerousGoodsDeclarationFieldsTypedDict,
)
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 DangerousGoodsDeclarationValidationErrorsTypedDict(TypedDict):
    message: str


class DangerousGoodsDeclarationValidationErrors(BaseModel):
    message: str


class DangerousGoodsDeclarationTypedDict(TypedDict):
    r"""Extracted Dangerous Goods Declaration Data Response"""

    meta: DocumentTypedDict
    r"""Represents a document that has been submitted for processing."""
    fields: NotRequired[DangerousGoodsDeclarationFieldsTypedDict]
    r"""Fields extracted from a dangerous goods declaration"""
    validation_errors: NotRequired[
        List[DangerousGoodsDeclarationValidationErrorsTypedDict]
    ]
    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 DangerousGoodsDeclaration(BaseModel):
    r"""Extracted Dangerous Goods Declaration Data Response"""

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

    fields: Optional[DangerousGoodsDeclarationFields] = None
    r"""Fields extracted from a dangerous goods declaration"""

    validation_errors: Annotated[
        Optional[List[DangerousGoodsDeclarationValidationErrors]],
        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."""
