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

from __future__ import annotations
from .bankstatementfields import BankStatementFields, BankStatementFieldsTypedDict
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 BankStatementValidationErrorsTypedDict(TypedDict):
    message: str


class BankStatementValidationErrors(BaseModel):
    message: str


class BankStatementTypedDict(TypedDict):
    r"""Extracted Bank Statement Data Response"""

    meta: DocumentTypedDict
    r"""Represents a document that has been submitted for processing."""
    fields: NotRequired[BankStatementFieldsTypedDict]
    r"""Fields extracted from a bank statement"""
    validation_errors: NotRequired[List[BankStatementValidationErrorsTypedDict]]
    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 BankStatement(BaseModel):
    r"""Extracted Bank Statement Data Response"""

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

    fields: Optional[BankStatementFields] = None
    r"""Fields extracted from a bank statement"""

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