"""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 SeaWaybillFieldsShipperTypedDict(TypedDict):
    account_number: NotRequired[str]
    r"""The shipper's account number"""
    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"""
    tax_id: NotRequired[str]
    r"""The shipper's international tax identification number"""


class SeaWaybillFieldsShipper(BaseModel):
    account_number: Annotated[Optional[str], pydantic.Field(alias="accountNumber")] = (
        None
    )
    r"""The shipper's account number"""

    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"""

    tax_id: Annotated[Optional[str], pydantic.Field(alias="taxId")] = None
    r"""The shipper's international tax identification number"""


class SeaWaybillFieldsConsigneeTypedDict(TypedDict):
    account_number: NotRequired[str]
    r"""The consignee's account number"""
    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"""
    tax_id: NotRequired[str]
    r"""The consignee's international tax identification number"""


class SeaWaybillFieldsConsignee(BaseModel):
    account_number: Annotated[Optional[str], pydantic.Field(alias="accountNumber")] = (
        None
    )
    r"""The consignee's account number"""

    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"""

    tax_id: Annotated[Optional[str], pydantic.Field(alias="taxId")] = None
    r"""The consignee's international tax identification number"""


class SeaWaybillFieldsNotifyPartyTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The name of the company to be notified of the arrival of the cargo"""
    address: NotRequired[str]
    r"""The address of the company to be notified of the arrival of the cargo"""
    country: NotRequired[str]
    r"""The country of the company to be notified"""
    state_or_province: NotRequired[str]
    r"""The state or province of the company to be notified"""
    city: NotRequired[str]
    r"""The city of the company to be notified"""
    postal_code: NotRequired[str]
    r"""The postal code of the company to be notified"""
    street: NotRequired[str]
    r"""The street address of the company to be notified"""
    tax_id: NotRequired[str]
    r"""The international tax identification number of the company to be notified"""


class SeaWaybillFieldsNotifyParty(BaseModel):
    name: Optional[str] = None
    r"""The name of the company to be notified of the arrival of the cargo"""

    address: Optional[str] = None
    r"""The address of the company to be notified of the arrival of the cargo"""

    country: Optional[str] = None
    r"""The country of the company to be notified"""

    state_or_province: Annotated[
        Optional[str], pydantic.Field(alias="stateOrProvince")
    ] = None
    r"""The state or province of the company to be notified"""

    city: Optional[str] = None
    r"""The city of the company to be notified"""

    postal_code: Annotated[Optional[str], pydantic.Field(alias="postalCode")] = None
    r"""The postal code of the company to be notified"""

    street: Optional[str] = None
    r"""The street address of the company to be notified"""

    tax_id: Annotated[Optional[str], pydantic.Field(alias="taxId")] = None
    r"""The international tax identification number of the company to be notified"""


class SeaWaybillFieldsContainersTypedDict(TypedDict):
    container_number: NotRequired[str]
    r"""The unique number of the container"""
    seal_number: NotRequired[str]
    r"""The unique number of the container seal"""
    container_type: NotRequired[str]
    r"""The type or size of the container (for example, 20-foot, 40-foot, or 20GP)"""
    quantity: NotRequired[float]
    r"""The number of packages loaded into the container"""
    quantity_uom: NotRequired[str]
    r"""The type of packages loaded into the container"""
    net_weight_kg: NotRequired[float]
    r"""The net weight of the container in kilograms"""
    gross_weight_kg: NotRequired[float]
    r"""The gross weight of the container in kilograms"""
    gross_weight_lb: NotRequired[float]
    r"""The gross weight of the container in pounds"""
    volume_m3: NotRequired[float]
    r"""The volume of the container in cubic meters"""
    volume_ft3: NotRequired[float]
    r"""The volume of the container in cubic feet"""


class SeaWaybillFieldsContainers(BaseModel):
    container_number: Annotated[
        Optional[str], pydantic.Field(alias="containerNumber")
    ] = None
    r"""The unique number of the container"""

    seal_number: Annotated[Optional[str], pydantic.Field(alias="sealNumber")] = None
    r"""The unique number of the container seal"""

    container_type: Annotated[Optional[str], pydantic.Field(alias="containerType")] = (
        None
    )
    r"""The type or size of the container (for example, 20-foot, 40-foot, or 20GP)"""

    quantity: Optional[float] = None
    r"""The number of packages loaded into the container"""

    quantity_uom: Annotated[Optional[str], pydantic.Field(alias="quantityUom")] = None
    r"""The type of packages loaded into the container"""

    net_weight_kg: Annotated[Optional[float], pydantic.Field(alias="netWeightKg")] = (
        None
    )
    r"""The net weight of the container in kilograms"""

    gross_weight_kg: Annotated[
        Optional[float], pydantic.Field(alias="grossWeightKg")
    ] = None
    r"""The gross weight of the container in kilograms"""

    gross_weight_lb: Annotated[
        Optional[float], pydantic.Field(alias="grossWeightLb")
    ] = None
    r"""The gross weight of the container in pounds"""

    volume_m3: Annotated[Optional[float], pydantic.Field(alias="volumeM3")] = None
    r"""The volume of the container in cubic meters"""

    volume_ft3: Annotated[Optional[float], pydantic.Field(alias="volumeFt3")] = None
    r"""The volume of the container in cubic feet"""


class SeaWaybillFieldsLineItemsTypedDict(TypedDict):
    marks_and_numbers: NotRequired[str]
    r"""The numbers of the shipping containers used for the goods"""
    quantity: NotRequired[float]
    r"""The number of pieces"""
    quantity_uom: NotRequired[str]
    r"""The unit of measurement used for the goods (bulk, bags, palettes, etc.)"""
    description: NotRequired[str]
    r"""A description of the goods"""
    gross_weight_kg: NotRequired[float]
    r"""The gross weight of the goods in kilograms"""
    gross_weight_lb: NotRequired[float]
    r"""The gross weight of the goods in pounds"""
    volume_m3: NotRequired[float]
    r"""The volume of the goods in cubic meters"""
    volume_ft3: NotRequired[float]
    r"""The volume of the goods in cubic feet"""


class SeaWaybillFieldsLineItems(BaseModel):
    marks_and_numbers: Annotated[
        Optional[str], pydantic.Field(alias="marksAndNumbers")
    ] = None
    r"""The numbers of the shipping containers used for the goods"""

    quantity: Optional[float] = None
    r"""The number of pieces"""

    quantity_uom: Annotated[Optional[str], pydantic.Field(alias="quantityUom")] = None
    r"""The unit of measurement used for the goods (bulk, bags, palettes, etc.)"""

    description: Optional[str] = None
    r"""A description of the goods"""

    gross_weight_kg: Annotated[
        Optional[float], pydantic.Field(alias="grossWeightKg")
    ] = None
    r"""The gross weight of the goods in kilograms"""

    gross_weight_lb: Annotated[
        Optional[float], pydantic.Field(alias="grossWeightLb")
    ] = None
    r"""The gross weight of the goods in pounds"""

    volume_m3: Annotated[Optional[float], pydantic.Field(alias="volumeM3")] = None
    r"""The volume of the goods in cubic meters"""

    volume_ft3: Annotated[Optional[float], pydantic.Field(alias="volumeFt3")] = None
    r"""The volume of the goods in cubic feet"""


class SeaWaybillFieldsTotalsTypedDict(TypedDict):
    total_quantity: NotRequired[float]
    r"""The total number of pieces"""
    total_quantity_uom: NotRequired[str]
    r"""The unit of measurement used for the goods (bulk, bags, palettes, etc.)"""
    total_weight_kg: NotRequired[float]
    r"""The total weight of the goods in kilograms"""
    total_volume_m3: NotRequired[float]
    r"""The total volume of the goods in cubic meters"""
    total_number_of_containers: NotRequired[float]
    r"""The total number of containers"""
    total_net_weight_kg: NotRequired[float]
    r"""The total net weight of the goods in kilograms"""


class SeaWaybillFieldsTotals(BaseModel):
    total_quantity: Annotated[
        Optional[float], pydantic.Field(alias="totalQuantity")
    ] = None
    r"""The total number of pieces"""

    total_quantity_uom: Annotated[
        Optional[str], pydantic.Field(alias="totalQuantityUom")
    ] = None
    r"""The unit of measurement used for the goods (bulk, bags, palettes, etc.)"""

    total_weight_kg: Annotated[
        Optional[float], pydantic.Field(alias="totalWeightKg")
    ] = None
    r"""The total weight of the goods in kilograms"""

    total_volume_m3: Annotated[
        Optional[float], pydantic.Field(alias="totalVolumeM3")
    ] = None
    r"""The total volume of the goods in cubic meters"""

    total_number_of_containers: Annotated[
        Optional[float], pydantic.Field(alias="totalNumberOfContainers")
    ] = None
    r"""The total number of containers"""

    total_net_weight_kg: Annotated[
        Optional[float], pydantic.Field(alias="totalNetWeightKg")
    ] = None
    r"""The total net weight of the goods in kilograms"""


class FreightAndChargesTypedDict(TypedDict):
    total_prepaid: NotRequired[float]
    r"""The total amount of prepaid charges"""
    currency_prepaid: NotRequired[str]
    r"""The currency of the prepaid charges"""
    total_collect: NotRequired[float]
    r"""The amount payable upon receipt"""
    currency_collect: NotRequired[str]
    r"""The currency of the amount payable upon receipt"""


class FreightAndCharges(BaseModel):
    total_prepaid: Annotated[Optional[float], pydantic.Field(alias="totalPrepaid")] = (
        None
    )
    r"""The total amount of prepaid charges"""

    currency_prepaid: Annotated[
        Optional[str], pydantic.Field(alias="currencyPrepaid")
    ] = None
    r"""The currency of the prepaid charges"""

    total_collect: Annotated[Optional[float], pydantic.Field(alias="totalCollect")] = (
        None
    )
    r"""The amount payable upon receipt"""

    currency_collect: Annotated[
        Optional[str], pydantic.Field(alias="currencyCollect")
    ] = None
    r"""The currency of the amount payable upon receipt"""


class SeaWaybillFieldsTypedDict(TypedDict):
    r"""Fields extracted from a sea waybill"""

    shipper: NotRequired[SeaWaybillFieldsShipperTypedDict]
    consignee: NotRequired[SeaWaybillFieldsConsigneeTypedDict]
    notify_party: NotRequired[SeaWaybillFieldsNotifyPartyTypedDict]
    carrier: NotRequired[str]
    r"""The carrier's name"""
    also_notify_party: NotRequired[str]
    r"""A second party that is notified of goods coming forward for delivery"""
    waybill_number: NotRequired[str]
    r"""The sea waybill number"""
    scac: NotRequired[str]
    r"""The Standard Carrier Alpha Code"""
    ico_number: NotRequired[List[str]]
    vessel_name: NotRequired[str]
    r"""The name of the vessel engaged to carry the goods"""
    voyage_number: NotRequired[str]
    r"""The number of the voyage carrying the goods"""
    port_of_loading: NotRequired[str]
    r"""The port where the goods are to be loaded"""
    port_of_discharge: NotRequired[str]
    r"""The port where the goods are to be discharged"""
    pre_carried_by: NotRequired[str]
    r"""Information about the previous carrier (if any)"""
    place_of_receipt: NotRequired[str]
    r"""The place of receipt of the goods"""
    place_of_delivery: NotRequired[str]
    r"""The place of delivery of the goods"""
    bill_of_lading_number: NotRequired[str]
    r"""The number of the bill of lading accompanying the goods"""
    booking_no: NotRequired[str]
    r"""The booking number"""
    reference: NotRequired[str]
    r"""A reference to the accompanying documents in the customers' databases"""
    origin_of_goods: NotRequired[str]
    r"""The country where the goods were manufactured"""
    containers: NotRequired[List[SeaWaybillFieldsContainersTypedDict]]
    line_items: NotRequired[List[SeaWaybillFieldsLineItemsTypedDict]]
    totals: NotRequired[SeaWaybillFieldsTotalsTypedDict]
    freight_and_charges: NotRequired[FreightAndChargesTypedDict]
    place_of_issue_of_waybill: NotRequired[str]
    r"""The place of issue of the sea waybill"""
    shipped_on_board_date: NotRequired[date]
    r"""The date of loading the cargo"""
    date_of_waybill: NotRequired[date]
    r"""The date of the sea waybill"""


class SeaWaybillFields(BaseModel):
    r"""Fields extracted from a sea waybill"""

    shipper: Optional[SeaWaybillFieldsShipper] = None

    consignee: Optional[SeaWaybillFieldsConsignee] = None

    notify_party: Annotated[
        Optional[SeaWaybillFieldsNotifyParty], pydantic.Field(alias="notifyParty")
    ] = None

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

    also_notify_party: Annotated[
        Optional[str], pydantic.Field(alias="alsoNotifyParty")
    ] = None
    r"""A second party that is notified of goods coming forward for delivery"""

    waybill_number: Annotated[Optional[str], pydantic.Field(alias="waybillNumber")] = (
        None
    )
    r"""The sea waybill number"""

    scac: Optional[str] = None
    r"""The Standard Carrier Alpha Code"""

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

    vessel_name: Annotated[Optional[str], pydantic.Field(alias="vesselName")] = None
    r"""The name of the vessel engaged to carry the goods"""

    voyage_number: Annotated[Optional[str], pydantic.Field(alias="voyageNumber")] = None
    r"""The number of the voyage carrying the goods"""

    port_of_loading: Annotated[Optional[str], pydantic.Field(alias="portOfLoading")] = (
        None
    )
    r"""The port where the goods are to be loaded"""

    port_of_discharge: Annotated[
        Optional[str], pydantic.Field(alias="portOfDischarge")
    ] = None
    r"""The port where the goods are to be discharged"""

    pre_carried_by: Annotated[Optional[str], pydantic.Field(alias="preCarriedBy")] = (
        None
    )
    r"""Information about the previous carrier (if any)"""

    place_of_receipt: Annotated[
        Optional[str], pydantic.Field(alias="placeOfReceipt")
    ] = None
    r"""The place of receipt of the goods"""

    place_of_delivery: Annotated[
        Optional[str], pydantic.Field(alias="placeOfDelivery")
    ] = None
    r"""The place of delivery of the goods"""

    bill_of_lading_number: Annotated[
        Optional[str], pydantic.Field(alias="billOfLadingNumber")
    ] = None
    r"""The number of the bill of lading accompanying the goods"""

    booking_no: Annotated[Optional[str], pydantic.Field(alias="bookingNo")] = None
    r"""The booking number"""

    reference: Optional[str] = None
    r"""A reference to the accompanying documents in the customers' databases"""

    origin_of_goods: Annotated[Optional[str], pydantic.Field(alias="originOfGoods")] = (
        None
    )
    r"""The country where the goods were manufactured"""

    containers: Optional[List[SeaWaybillFieldsContainers]] = None

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

    totals: Optional[SeaWaybillFieldsTotals] = None

    freight_and_charges: Annotated[
        Optional[FreightAndCharges], pydantic.Field(alias="freightAndCharges")
    ] = None

    place_of_issue_of_waybill: Annotated[
        Optional[str], pydantic.Field(alias="placeOfIssueOfWaybill")
    ] = None
    r"""The place of issue of the sea waybill"""

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

    date_of_waybill: Annotated[
        Optional[date], pydantic.Field(alias="dateOfWaybill")
    ] = None
    r"""The date of the sea waybill"""
