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

from __future__ import annotations
from abbyy_document_ai.types import BaseModel
from datetime import date
from enum import Enum
import pydantic
from typing import List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class TaxiReceiptFieldsTaxesTypedDict(TypedDict):
    tax_rate: NotRequired[float]
    r"""The tax rate applied to the purchase."""
    tax_amount: NotRequired[float]
    r"""The amount of tax for this rate."""


class TaxiReceiptFieldsTaxes(BaseModel):
    tax_rate: Annotated[Optional[float], pydantic.Field(alias="taxRate")] = None
    r"""The tax rate applied to the purchase."""

    tax_amount: Annotated[Optional[float], pydantic.Field(alias="taxAmount")] = None
    r"""The amount of tax for this rate."""


class PaymentMethod5(str, Enum):
    UNDEFINED = "Undefined"


class PaymentMethod4(str, Enum):
    MIXED = "Mixed"


class PaymentMethod3(str, Enum):
    TRANSFER = "Transfer"


class PaymentMethod2(str, Enum):
    CASH = "Cash"


class PaymentMethod1(str, Enum):
    CARD = "Card"


TaxiReceiptFieldsPaymentMethodTypedDict = TypeAliasType(
    "TaxiReceiptFieldsPaymentMethodTypedDict",
    Union[
        PaymentMethod1, PaymentMethod2, PaymentMethod3, PaymentMethod4, PaymentMethod5
    ],
)
r"""Payment method used for the transaction."""


TaxiReceiptFieldsPaymentMethod = TypeAliasType(
    "TaxiReceiptFieldsPaymentMethod",
    Union[
        PaymentMethod1, PaymentMethod2, PaymentMethod3, PaymentMethod4, PaymentMethod5
    ],
)
r"""Payment method used for the transaction."""


class TaxiReceiptFieldsCardType5(str, Enum):
    UNDEFINED = "Undefined"


class TaxiReceiptFieldsCardType4(str, Enum):
    NATIONAL_CARD = "NationalCard"


class TaxiReceiptFieldsCardType3(str, Enum):
    AMERICAN_EXPRESS = "AmericanExpress"


class TaxiReceiptFieldsCardType2(str, Enum):
    VISA = "VISA"


class TaxiReceiptFieldsCardType1(str, Enum):
    MASTERCARD = "Mastercard"


TaxiReceiptFieldsCardTypeTypedDict = TypeAliasType(
    "TaxiReceiptFieldsCardTypeTypedDict",
    Union[
        TaxiReceiptFieldsCardType1,
        TaxiReceiptFieldsCardType2,
        TaxiReceiptFieldsCardType3,
        TaxiReceiptFieldsCardType4,
        TaxiReceiptFieldsCardType5,
    ],
)
r"""The payment processing network of the card used for payment."""


TaxiReceiptFieldsCardType = TypeAliasType(
    "TaxiReceiptFieldsCardType",
    Union[
        TaxiReceiptFieldsCardType1,
        TaxiReceiptFieldsCardType2,
        TaxiReceiptFieldsCardType3,
        TaxiReceiptFieldsCardType4,
        TaxiReceiptFieldsCardType5,
    ],
)
r"""The payment processing network of the card used for payment."""


class TaxiReceiptFieldsCreditOrDebit2(str, Enum):
    DEBIT = "Debit"


class TaxiReceiptFieldsCreditOrDebit1(str, Enum):
    CREDIT = "Credit"


TaxiReceiptFieldsCreditOrDebitTypedDict = TypeAliasType(
    "TaxiReceiptFieldsCreditOrDebitTypedDict",
    Union[TaxiReceiptFieldsCreditOrDebit1, TaxiReceiptFieldsCreditOrDebit2],
)
r"""Whether a credit or debit card was used."""


TaxiReceiptFieldsCreditOrDebit = TypeAliasType(
    "TaxiReceiptFieldsCreditOrDebit",
    Union[TaxiReceiptFieldsCreditOrDebit1, TaxiReceiptFieldsCreditOrDebit2],
)
r"""Whether a credit or debit card was used."""


class TaxiReceiptFieldsTypedDict(TypedDict):
    r"""Fields extracted from a taxi receipt"""

    date_: NotRequired[date]
    r"""The date when the receipt was issued by the service provider."""
    start_date: NotRequired[date]
    r"""The date when the taxi ride started."""
    end_date: NotRequired[date]
    r"""The date when the taxi ride ended."""
    days: NotRequired[float]
    r"""The number of days for which the taxi services were provided."""
    from_location: NotRequired[str]
    r"""The starting location of the taxi ride."""
    to_location: NotRequired[str]
    r"""The destination of the taxi ride."""
    vendor: NotRequired[str]
    r"""The service provider responsible for the transportation service."""
    address: NotRequired[str]
    r"""The address of the service provider."""
    city: NotRequired[str]
    r"""The city where the service provider is located."""
    state: NotRequired[str]
    r"""The state/province where the service provider is located."""
    postal_code: NotRequired[str]
    r"""The postal code of the service provider's address."""
    country: NotRequired[str]
    r"""The country where the service provider is located."""
    phone: NotRequired[str]
    r"""The phone number of the service provider."""
    currency: NotRequired[str]
    r"""The currency of the payment."""
    total: NotRequired[float]
    r"""The total amount of the receipt."""
    tax_total: NotRequired[float]
    r"""The total amount of tax levied on the purchase."""
    taxes: NotRequired[List[TaxiReceiptFieldsTaxesTypedDict]]
    payment_method: NotRequired[TaxiReceiptFieldsPaymentMethodTypedDict]
    r"""Payment method used for the transaction."""
    card_type: NotRequired[TaxiReceiptFieldsCardTypeTypedDict]
    r"""The payment processing network of the card used for payment."""
    credit_or_debit: NotRequired[TaxiReceiptFieldsCreditOrDebitTypedDict]
    r"""Whether a credit or debit card was used."""
    card_number: NotRequired[str]
    r"""The number of the card used for payment. May be partially masked."""


class TaxiReceiptFields(BaseModel):
    r"""Fields extracted from a taxi receipt"""

    date_: Annotated[Optional[date], pydantic.Field(alias="date")] = None
    r"""The date when the receipt was issued by the service provider."""

    start_date: Annotated[Optional[date], pydantic.Field(alias="startDate")] = None
    r"""The date when the taxi ride started."""

    end_date: Annotated[Optional[date], pydantic.Field(alias="endDate")] = None
    r"""The date when the taxi ride ended."""

    days: Optional[float] = None
    r"""The number of days for which the taxi services were provided."""

    from_location: Annotated[Optional[str], pydantic.Field(alias="fromLocation")] = None
    r"""The starting location of the taxi ride."""

    to_location: Annotated[Optional[str], pydantic.Field(alias="toLocation")] = None
    r"""The destination of the taxi ride."""

    vendor: Optional[str] = None
    r"""The service provider responsible for the transportation service."""

    address: Optional[str] = None
    r"""The address of the service provider."""

    city: Optional[str] = None
    r"""The city where the service provider is located."""

    state: Optional[str] = None
    r"""The state/province where the service provider is located."""

    postal_code: Annotated[Optional[str], pydantic.Field(alias="postalCode")] = None
    r"""The postal code of the service provider's address."""

    country: Optional[str] = None
    r"""The country where the service provider is located."""

    phone: Optional[str] = None
    r"""The phone number of the service provider."""

    currency: Optional[str] = None
    r"""The currency of the payment."""

    total: Optional[float] = None
    r"""The total amount of the receipt."""

    tax_total: Annotated[Optional[float], pydantic.Field(alias="taxTotal")] = None
    r"""The total amount of tax levied on the purchase."""

    taxes: Optional[List[TaxiReceiptFieldsTaxes]] = None

    payment_method: Annotated[
        Optional[TaxiReceiptFieldsPaymentMethod], pydantic.Field(alias="paymentMethod")
    ] = None
    r"""Payment method used for the transaction."""

    card_type: Annotated[
        Optional[TaxiReceiptFieldsCardType], pydantic.Field(alias="cardType")
    ] = None
    r"""The payment processing network of the card used for payment."""

    credit_or_debit: Annotated[
        Optional[TaxiReceiptFieldsCreditOrDebit], pydantic.Field(alias="creditOrDebit")
    ] = None
    r"""Whether a credit or debit card was used."""

    card_number: Annotated[Optional[str], pydantic.Field(alias="cardNumber")] = None
    r"""The number of the card used for payment. May be partially masked."""
