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

from __future__ import annotations
from abbyy_document_ai.types import BaseModel
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class DangerousGoodsDeclarationFieldsShipperTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The name of the shipper"""
    address: NotRequired[str]
    r"""The address of the shipper"""


class DangerousGoodsDeclarationFieldsShipper(BaseModel):
    name: Optional[str] = None
    r"""The name of the shipper"""

    address: Optional[str] = None
    r"""The address of the shipper"""


class DangerousGoodsDeclarationFieldsConsigneeTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The name of the consignee"""
    address: NotRequired[str]
    r"""The address of the consignee"""


class DangerousGoodsDeclarationFieldsConsignee(BaseModel):
    name: Optional[str] = None
    r"""The name of the consignee"""

    address: Optional[str] = None
    r"""The address of the consignee"""


class DangerousGoodsDeclarationFieldsCarrierTypedDict(TypedDict):
    name: NotRequired[str]
    r"""The name of the carrier"""
    address: NotRequired[str]
    r"""The address of the carrier"""


class DangerousGoodsDeclarationFieldsCarrier(BaseModel):
    name: Optional[str] = None
    r"""The name of the carrier"""

    address: Optional[str] = None
    r"""The address of the carrier"""


class DangerousGoodsDeclarationFieldsLineItemsTypedDict(TypedDict):
    un_number: NotRequired[str]
    r"""UN-assigned four-digit number identifying the specific types of hazardous substances and materials"""
    proper_shipping_name: NotRequired[str]
    r"""Standard UN-assigned technical name describing the hazard properties and composition of dangerous goods"""
    number_of_pieces: NotRequired[float]
    r"""The number of separate packages of dangerous goods"""
    package_type: NotRequired[str]
    r"""The UN packaging identification code"""
    quantity_per_package: NotRequired[float]
    r"""The number of items in a single package"""
    unit_of_measure: NotRequired[str]
    r"""The unit of measurement for the goods"""
    class_or_division: NotRequired[str]
    r"""The ADR hazard class and subclass of dangerous goods"""
    packing_group: NotRequired[str]
    r"""The packing group of the dangerous goods (I, II, or III)"""
    packing_instruction: NotRequired[str]
    r"""The UN-assigned packing instruction number"""
    overpack_used: NotRequired[bool]
    r"""Specifies whether the packages containing dangerous goods have been placed inside an overpack"""


class DangerousGoodsDeclarationFieldsLineItems(BaseModel):
    un_number: Annotated[Optional[str], pydantic.Field(alias="unNumber")] = None
    r"""UN-assigned four-digit number identifying the specific types of hazardous substances and materials"""

    proper_shipping_name: Annotated[
        Optional[str], pydantic.Field(alias="properShippingName")
    ] = None
    r"""Standard UN-assigned technical name describing the hazard properties and composition of dangerous goods"""

    number_of_pieces: Annotated[
        Optional[float], pydantic.Field(alias="numberOfPieces")
    ] = None
    r"""The number of separate packages of dangerous goods"""

    package_type: Annotated[Optional[str], pydantic.Field(alias="packageType")] = None
    r"""The UN packaging identification code"""

    quantity_per_package: Annotated[
        Optional[float], pydantic.Field(alias="quantityPerPackage")
    ] = None
    r"""The number of items in a single package"""

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

    class_or_division: Annotated[
        Optional[str], pydantic.Field(alias="classOrDivision")
    ] = None
    r"""The ADR hazard class and subclass of dangerous goods"""

    packing_group: Annotated[Optional[str], pydantic.Field(alias="packingGroup")] = None
    r"""The packing group of the dangerous goods (I, II, or III)"""

    packing_instruction: Annotated[
        Optional[str], pydantic.Field(alias="packingInstruction")
    ] = None
    r"""The UN-assigned packing instruction number"""

    overpack_used: Annotated[Optional[bool], pydantic.Field(alias="overpackUsed")] = (
        None
    )
    r"""Specifies whether the packages containing dangerous goods have been placed inside an overpack"""


class CertificationTypedDict(TypedDict):
    name_of_signatory: NotRequired[str]
    r"""The name of the shipper's signatory"""
    place_and_date: NotRequired[str]
    r"""The place and date of signing"""


class Certification(BaseModel):
    name_of_signatory: Annotated[
        Optional[str], pydantic.Field(alias="nameOfSignatory")
    ] = None
    r"""The name of the shipper's signatory"""

    place_and_date: Annotated[Optional[str], pydantic.Field(alias="placeAndDate")] = (
        None
    )
    r"""The place and date of signing"""


class DangerousGoodsDeclarationFieldsTypedDict(TypedDict):
    r"""Fields extracted from a dangerous goods declaration"""

    shipper: NotRequired[DangerousGoodsDeclarationFieldsShipperTypedDict]
    consignee: NotRequired[DangerousGoodsDeclarationFieldsConsigneeTypedDict]
    carrier: NotRequired[DangerousGoodsDeclarationFieldsCarrierTypedDict]
    transportation_document_number: NotRequired[str]
    r"""The transportation document number"""
    aircraft_type: NotRequired[str]
    r"""The aircraft type"""
    airport_of_departure: NotRequired[str]
    r"""The airport of departure or port of loading"""
    airport_of_destination: NotRequired[str]
    r"""The airport of destination or port of discharge"""
    additional_handling_information: NotRequired[str]
    r"""Any additional information pertaining to safe handling of the goods"""
    shipment_type: NotRequired[str]
    r"""Specifies whether the shipment contains radioactive material (Radioactive/Non-radioactive)"""
    shippers_reference_number: NotRequired[str]
    r"""Reference number or code for tracking the goods"""
    line_items: NotRequired[List[DangerousGoodsDeclarationFieldsLineItemsTypedDict]]
    certification: NotRequired[CertificationTypedDict]
    emergency_telephone_number: NotRequired[str]
    r"""An emergency hazardous material response number"""


class DangerousGoodsDeclarationFields(BaseModel):
    r"""Fields extracted from a dangerous goods declaration"""

    shipper: Optional[DangerousGoodsDeclarationFieldsShipper] = None

    consignee: Optional[DangerousGoodsDeclarationFieldsConsignee] = None

    carrier: Optional[DangerousGoodsDeclarationFieldsCarrier] = None

    transportation_document_number: Annotated[
        Optional[str], pydantic.Field(alias="transportationDocumentNumber")
    ] = None
    r"""The transportation document number"""

    aircraft_type: Annotated[Optional[str], pydantic.Field(alias="aircraftType")] = None
    r"""The aircraft type"""

    airport_of_departure: Annotated[
        Optional[str], pydantic.Field(alias="airportOfDeparture")
    ] = None
    r"""The airport of departure or port of loading"""

    airport_of_destination: Annotated[
        Optional[str], pydantic.Field(alias="airportOfDestination")
    ] = None
    r"""The airport of destination or port of discharge"""

    additional_handling_information: Annotated[
        Optional[str], pydantic.Field(alias="additionalHandlingInformation")
    ] = None
    r"""Any additional information pertaining to safe handling of the goods"""

    shipment_type: Annotated[Optional[str], pydantic.Field(alias="shipmentType")] = None
    r"""Specifies whether the shipment contains radioactive material (Radioactive/Non-radioactive)"""

    shippers_reference_number: Annotated[
        Optional[str], pydantic.Field(alias="shippersReferenceNumber")
    ] = None
    r"""Reference number or code for tracking the goods"""

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

    certification: Optional[Certification] = None

    emergency_telephone_number: Annotated[
        Optional[str], pydantic.Field(alias="emergencyTelephoneNumber")
    ] = None
    r"""An emergency hazardous material response number"""
