# This file was auto-generated by Fern from our API Definition.

from ...core.pydantic_utilities import UniversalBaseModel
import typing
from .source_or_destination_entity import SourceOrDestinationEntity
from .shipment_address import ShipmentAddress
from ...generated_types.types.country import Country
from .monetary_value import MonetaryValue
from .weight import Weight
from .shipment_identifier import ShipmentIdentifier
from .data_source import DataSource
from .hs_code_info import HsCodeInfo
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class Shipment(UniversalBaseModel):
    id: str
    type: str
    buyer: typing.List[SourceOrDestinationEntity]
    supplier: typing.List[SourceOrDestinationEntity]
    arrival_date: typing.Optional[typing.List[str]] = None
    departure_date: typing.Optional[typing.List[str]] = None
    departure_address: typing.Optional[ShipmentAddress] = None
    arrival_address: typing.Optional[ShipmentAddress] = None
    arrival_country: typing.List[Country]
    departure_country: typing.List[Country]
    transit_country: typing.List[Country]
    countries: typing.List[Country]
    product_origin: typing.List[Country]
    monetary_value: typing.List[MonetaryValue]
    weight: typing.List[Weight]
    identifier: typing.List[ShipmentIdentifier]
    sources: typing.List[DataSource]
    hs_codes: typing.List[HsCodeInfo]
    product_descriptions: typing.List[str]
    record: str = pydantic.Field()
    """
    The unique identifier for a record in the database
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
