"""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
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class InternationalConsignmentNoteFieldsShipperTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The shipper's name"""
    address: NotRequired[str]
    r"""The shipper's address"""
    country: NotRequired[str]
    r"""The shipper's country"""
    state_or_province: NotRequired[str]
    r"""The shipper's state or province"""
    city: NotRequired[str]
    r"""The shipper's city"""
    postal_code: NotRequired[str]
    r"""The shipper's postal code"""
    street: NotRequired[str]
    r"""The shipper's street address"""
    signature_and_stamp: NotRequired[str]
    r"""The shipper's signature and stamp"""


class InternationalConsignmentNoteFieldsShipper(BaseModel):
    name: Optional[str] = None
    r"""The shipper's name"""

    address: Optional[str] = None
    r"""The shipper's address"""

    country: Optional[str] = None
    r"""The shipper's country"""

    state_or_province: Annotated[
        Optional[str], pydantic.Field(alias="stateOrProvince")
    ] = None
    r"""The shipper's state or province"""

    city: Optional[str] = None
    r"""The shipper's city"""

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

    street: Optional[str] = None
    r"""The shipper's street address"""

    signature_and_stamp: Annotated[
        Optional[str], pydantic.Field(alias="signatureAndStamp")
    ] = None
    r"""The shipper's signature and stamp"""


class InternationalConsignmentNoteFieldsConsigneeTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The consignee's name"""
    address: NotRequired[str]
    r"""The consignee's address"""
    country: NotRequired[str]
    r"""The consignee's country"""
    state_or_province: NotRequired[str]
    r"""The consignee's state or province"""
    city: NotRequired[str]
    r"""The consignee's city"""
    postal_code: NotRequired[str]
    r"""The consignee's postal code"""
    street: NotRequired[str]
    r"""The consignee's street address"""
    signature_and_stamp: NotRequired[str]
    r"""The consignee's signature and stamp"""


class InternationalConsignmentNoteFieldsConsignee(BaseModel):
    name: Optional[str] = None
    r"""The consignee's name"""

    address: Optional[str] = None
    r"""The consignee's address"""

    country: Optional[str] = None
    r"""The consignee's country"""

    state_or_province: Annotated[
        Optional[str], pydantic.Field(alias="stateOrProvince")
    ] = None
    r"""The consignee's state or province"""

    city: Optional[str] = None
    r"""The consignee's city"""

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

    street: Optional[str] = None
    r"""The consignee's street address"""

    signature_and_stamp: Annotated[
        Optional[str], pydantic.Field(alias="signatureAndStamp")
    ] = None
    r"""The consignee's signature and stamp"""


class InternationalConsignmentNoteFieldsCarrierTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The carrier's name"""
    address: NotRequired[str]
    r"""The carrier's address"""
    country: NotRequired[str]
    r"""The carrier's country"""
    state_or_province: NotRequired[str]
    r"""The carrier's state or province"""
    city: NotRequired[str]
    r"""The carrier's city"""
    postal_code: NotRequired[str]
    r"""The carrier's postal code"""
    street: NotRequired[str]
    r"""The carrier's street address"""
    signature_and_stamp: NotRequired[str]
    r"""The carrier's signature and stamp"""


class InternationalConsignmentNoteFieldsCarrier(BaseModel):
    name: Optional[str] = None
    r"""The carrier's name"""

    address: Optional[str] = None
    r"""The carrier's address"""

    country: Optional[str] = None
    r"""The carrier's country"""

    state_or_province: Annotated[
        Optional[str], pydantic.Field(alias="stateOrProvince")
    ] = None
    r"""The carrier's state or province"""

    city: Optional[str] = None
    r"""The carrier's city"""

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

    street: Optional[str] = None
    r"""The carrier's street address"""

    signature_and_stamp: Annotated[
        Optional[str], pydantic.Field(alias="signatureAndStamp")
    ] = None
    r"""The carrier's signature and stamp"""


class SuccessiveCarrierTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The successive carrier's name"""
    address: NotRequired[str]
    r"""The successive carrier's address"""
    country: NotRequired[str]
    r"""The successive carrier's country"""
    state_or_province: NotRequired[str]
    r"""The successive carrier's state or province"""
    city: NotRequired[str]
    r"""The successive carrier's city"""
    postal_code: NotRequired[str]
    r"""The successive carrier's postal code"""
    street: NotRequired[str]
    r"""The successive carrier's street address"""


class SuccessiveCarrier(BaseModel):
    name: Optional[str] = None
    r"""The successive carrier's name"""

    address: Optional[str] = None
    r"""The successive carrier's address"""

    country: Optional[str] = None
    r"""The successive carrier's country"""

    state_or_province: Annotated[
        Optional[str], pydantic.Field(alias="stateOrProvince")
    ] = None
    r"""The successive carrier's state or province"""

    city: Optional[str] = None
    r"""The successive carrier's city"""

    postal_code: Annotated[Optional[str], pydantic.Field(alias="postalCode")] = None
    r"""The successive carrier's postal code"""

    street: Optional[str] = None
    r"""The successive carrier's street address"""


class PlaceOfDeliveryOfGoodsTypedDict(TypedDict):
    address: NotRequired[str]
    r"""The delivery location address"""
    country: NotRequired[str]
    r"""The delivery location country"""


class PlaceOfDeliveryOfGoods(BaseModel):
    address: Optional[str] = None
    r"""The delivery location address"""

    country: Optional[str] = None
    r"""The delivery location country"""


class PlaceAndDateOfTakingOverOfGoodsTypedDict(TypedDict):
    address: NotRequired[str]
    r"""The loading location address"""
    country: NotRequired[str]
    r"""The loading location country"""
    date_: NotRequired[date]
    r"""The date of loading"""


class PlaceAndDateOfTakingOverOfGoods(BaseModel):
    address: Optional[str] = None
    r"""The loading location address"""

    country: Optional[str] = None
    r"""The loading location country"""

    date_: Annotated[Optional[date], pydantic.Field(alias="date")] = None
    r"""The date of loading"""


class InternationalConsignmentNoteFieldsLineItemsTypedDict(TypedDict):
    marks_and_numbers: NotRequired[str]
    r"""Special numbering and marking on the packaging"""
    number_of_packages: NotRequired[float]
    r"""The number of packages of the goods"""
    type_of_packaging: NotRequired[str]
    r"""The package type"""
    nature_of_goods: NotRequired[str]
    r"""The name of the types of goods"""
    hs_code: NotRequired[str]
    r"""The HS code of the goods"""
    gross_weight: NotRequired[float]
    r"""The gross weight of the goods"""
    weight_uom: NotRequired[str]
    r"""The unit of measurement used for the weight"""
    volume: NotRequired[float]
    r"""The volume of the goods"""
    volume_uom: NotRequired[str]
    r"""The unit of measurement used for the volume"""


class InternationalConsignmentNoteFieldsLineItems(BaseModel):
    marks_and_numbers: Annotated[
        Optional[str], pydantic.Field(alias="marksAndNumbers")
    ] = None
    r"""Special numbering and marking on the packaging"""

    number_of_packages: Annotated[
        Optional[float], pydantic.Field(alias="numberOfPackages")
    ] = None
    r"""The number of packages of the goods"""

    type_of_packaging: Annotated[
        Optional[str], pydantic.Field(alias="typeOfPackaging")
    ] = None
    r"""The package type"""

    nature_of_goods: Annotated[Optional[str], pydantic.Field(alias="natureOfGoods")] = (
        None
    )
    r"""The name of the types of goods"""

    hs_code: Annotated[Optional[str], pydantic.Field(alias="hsCode")] = None
    r"""The HS code of the goods"""

    gross_weight: Annotated[Optional[float], pydantic.Field(alias="grossWeight")] = None
    r"""The gross weight of the goods"""

    weight_uom: Annotated[Optional[str], pydantic.Field(alias="weightUom")] = None
    r"""The unit of measurement used for the weight"""

    volume: Optional[float] = None
    r"""The volume of the goods"""

    volume_uom: Annotated[Optional[str], pydantic.Field(alias="volumeUom")] = None
    r"""The unit of measurement used for the volume"""


class InternationalConsignmentNoteFieldsTotalsTypedDict(TypedDict):
    total_number_of_packages: NotRequired[float]
    r"""The total number of packages of the goods"""
    total_packages_uom: NotRequired[str]
    r"""The unit of measurement for the goods"""
    total_weight: NotRequired[float]
    r"""The total weight of the shipment"""
    total_weight_uom: NotRequired[str]
    r"""The unit of measurement used for the weight"""
    total_volume: NotRequired[float]
    r"""The total volume of the shipment"""
    total_volume_uom: NotRequired[str]
    r"""The unit of measurement used for the volume"""


class InternationalConsignmentNoteFieldsTotals(BaseModel):
    total_number_of_packages: Annotated[
        Optional[float], pydantic.Field(alias="totalNumberOfPackages")
    ] = None
    r"""The total number of packages of the goods"""

    total_packages_uom: Annotated[
        Optional[str], pydantic.Field(alias="totalPackagesUom")
    ] = None
    r"""The unit of measurement for the goods"""

    total_weight: Annotated[Optional[float], pydantic.Field(alias="totalWeight")] = None
    r"""The total weight of the shipment"""

    total_weight_uom: Annotated[
        Optional[str], pydantic.Field(alias="totalWeightUom")
    ] = None
    r"""The unit of measurement used for the weight"""

    total_volume: Annotated[Optional[float], pydantic.Field(alias="totalVolume")] = None
    r"""The total volume of the shipment"""

    total_volume_uom: Annotated[
        Optional[str], pydantic.Field(alias="totalVolumeUom")
    ] = None
    r"""The unit of measurement used for the volume"""


class LoadingTypedDict(TypedDict):
    arrival_date: NotRequired[date]
    r"""The arrival date of the transport for loading"""
    arrival_time: NotRequired[str]
    r"""The arrival time of the transport for loading"""
    departure_date: NotRequired[date]
    r"""The departure date of the transport after loading"""
    departure_time: NotRequired[str]
    r"""The departure time of the transport after loading"""


class Loading(BaseModel):
    arrival_date: Annotated[Optional[date], pydantic.Field(alias="arrivalDate")] = None
    r"""The arrival date of the transport for loading"""

    arrival_time: Annotated[Optional[str], pydantic.Field(alias="arrivalTime")] = None
    r"""The arrival time of the transport for loading"""

    departure_date: Annotated[Optional[date], pydantic.Field(alias="departureDate")] = (
        None
    )
    r"""The departure date of the transport after loading"""

    departure_time: Annotated[Optional[str], pydantic.Field(alias="departureTime")] = (
        None
    )
    r"""The departure time of the transport after loading"""


class DischargeTypedDict(TypedDict):
    arrival_date: NotRequired[date]
    r"""The arrival date of the transport for discharge"""
    arrival_time: NotRequired[str]
    r"""The arrival time of the transport for discharge"""
    departure_date: NotRequired[date]
    r"""The departure date of the transport after discharge"""
    departure_time: NotRequired[str]
    r"""The departure time of the transport after discharge"""


class Discharge(BaseModel):
    arrival_date: Annotated[Optional[date], pydantic.Field(alias="arrivalDate")] = None
    r"""The arrival date of the transport for discharge"""

    arrival_time: Annotated[Optional[str], pydantic.Field(alias="arrivalTime")] = None
    r"""The arrival time of the transport for discharge"""

    departure_date: Annotated[Optional[date], pydantic.Field(alias="departureDate")] = (
        None
    )
    r"""The departure date of the transport after discharge"""

    departure_time: Annotated[Optional[str], pydantic.Field(alias="departureTime")] = (
        None
    )
    r"""The departure time of the transport after discharge"""


class InternationalConsignmentNoteFieldsTypedDict(TypedDict):
    r"""Fields extracted from an international consignment note"""

    shipper: NotRequired[InternationalConsignmentNoteFieldsShipperTypedDict]
    consignee: NotRequired[InternationalConsignmentNoteFieldsConsigneeTypedDict]
    carrier: NotRequired[InternationalConsignmentNoteFieldsCarrierTypedDict]
    successive_carrier: NotRequired[SuccessiveCarrierTypedDict]
    place_of_delivery_of_goods: NotRequired[PlaceOfDeliveryOfGoodsTypedDict]
    place_and_date_of_taking_over_of_goods: NotRequired[
        PlaceAndDateOfTakingOverOfGoodsTypedDict
    ]
    list_of_annexed_documents: NotRequired[List[str]]
    line_items: NotRequired[List[InternationalConsignmentNoteFieldsLineItemsTypedDict]]
    totals: NotRequired[InternationalConsignmentNoteFieldsTotalsTypedDict]
    document_number: NotRequired[str]
    r"""The consignment note number"""
    place_of_issue: NotRequired[str]
    r"""The consignment note place of issue"""
    date_of_issue: NotRequired[date]
    r"""The consignment note date of issue"""
    loading: NotRequired[LoadingTypedDict]
    discharge: NotRequired[DischargeTypedDict]
    terms_of_delivery: NotRequired[str]
    r"""The delivery terms. This field can contain any names, three-letter codes, or Incoterms rule names in full: EXW (EX Works), FCA (Free Carrier), FAS (Free Alongside Ship), FOB (Free On Board), CFR (Cost And Freight), CNF (another variant for Cost And Freight), CIF (Cost Insurance Freight), DAP (Delivered At Place), DTU (another variant for Delivered At Place, replace with DAP), DPU (Delivered at Place Unloaded), CPT (Carriage Paid To), CIP (Carriage Insurance Paid), DDP (Delivered Duty Paid), DDU (Delivered Duty Unpaid)"""
    value_of_goods: NotRequired[float]
    r"""The declared value of the goods"""
    currency: NotRequired[str]
    r"""The currency of the amounts in the consignment note"""
    senders_instructions: NotRequired[str]
    r"""The shipper's special instructions"""
    carrier_remarks: NotRequired[str]
    r"""The remarks of the carrier regarding the state and packaging of the goods"""
    special_agreements_of_carriage: NotRequired[str]
    r"""Special shipping agreements"""
    number_plate: NotRequired[str]
    r"""The registration number of the transport"""
    trailer_number_plate: NotRequired[str]
    r"""The registration number of the trailer"""
    goods_received_date: NotRequired[date]
    r"""The date on which the goods are received"""


class InternationalConsignmentNoteFields(BaseModel):
    r"""Fields extracted from an international consignment note"""

    shipper: Optional[InternationalConsignmentNoteFieldsShipper] = None

    consignee: Optional[InternationalConsignmentNoteFieldsConsignee] = None

    carrier: Optional[InternationalConsignmentNoteFieldsCarrier] = None

    successive_carrier: Annotated[
        Optional[SuccessiveCarrier], pydantic.Field(alias="successiveCarrier")
    ] = None

    place_of_delivery_of_goods: Annotated[
        Optional[PlaceOfDeliveryOfGoods], pydantic.Field(alias="placeOfDeliveryOfGoods")
    ] = None

    place_and_date_of_taking_over_of_goods: Annotated[
        Optional[PlaceAndDateOfTakingOverOfGoods],
        pydantic.Field(alias="placeAndDateOfTakingOverOfGoods"),
    ] = None

    list_of_annexed_documents: Annotated[
        Optional[List[str]], pydantic.Field(alias="listOfAnnexedDocuments")
    ] = None

    line_items: Annotated[
        Optional[List[InternationalConsignmentNoteFieldsLineItems]],
        pydantic.Field(alias="lineItems"),
    ] = None

    totals: Optional[InternationalConsignmentNoteFieldsTotals] = None

    document_number: Annotated[
        Optional[str], pydantic.Field(alias="documentNumber")
    ] = None
    r"""The consignment note number"""

    place_of_issue: Annotated[Optional[str], pydantic.Field(alias="placeOfIssue")] = (
        None
    )
    r"""The consignment note place of issue"""

    date_of_issue: Annotated[Optional[date], pydantic.Field(alias="dateOfIssue")] = None
    r"""The consignment note date of issue"""

    loading: Optional[Loading] = None

    discharge: Optional[Discharge] = None

    terms_of_delivery: Annotated[
        Optional[str], pydantic.Field(alias="termsOfDelivery")
    ] = None
    r"""The delivery terms. This field can contain any names, three-letter codes, or Incoterms rule names in full: EXW (EX Works), FCA (Free Carrier), FAS (Free Alongside Ship), FOB (Free On Board), CFR (Cost And Freight), CNF (another variant for Cost And Freight), CIF (Cost Insurance Freight), DAP (Delivered At Place), DTU (another variant for Delivered At Place, replace with DAP), DPU (Delivered at Place Unloaded), CPT (Carriage Paid To), CIP (Carriage Insurance Paid), DDP (Delivered Duty Paid), DDU (Delivered Duty Unpaid)"""

    value_of_goods: Annotated[Optional[float], pydantic.Field(alias="valueOfGoods")] = (
        None
    )
    r"""The declared value of the goods"""

    currency: Optional[str] = None
    r"""The currency of the amounts in the consignment note"""

    senders_instructions: Annotated[
        Optional[str], pydantic.Field(alias="sendersInstructions")
    ] = None
    r"""The shipper's special instructions"""

    carrier_remarks: Annotated[
        Optional[str], pydantic.Field(alias="carrierRemarks")
    ] = None
    r"""The remarks of the carrier regarding the state and packaging of the goods"""

    special_agreements_of_carriage: Annotated[
        Optional[str], pydantic.Field(alias="specialAgreementsOfCarriage")
    ] = None
    r"""Special shipping agreements"""

    number_plate: Annotated[Optional[str], pydantic.Field(alias="numberPlate")] = None
    r"""The registration number of the transport"""

    trailer_number_plate: Annotated[
        Optional[str], pydantic.Field(alias="trailerNumberPlate")
    ] = None
    r"""The registration number of the trailer"""

    goods_received_date: Annotated[
        Optional[date], pydantic.Field(alias="goodsReceivedDate")
    ] = None
    r"""The date on which the goods are received"""
