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

from ...base_types.types.paginated_response import PaginatedResponse
import typing
from .shipment import Shipment
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ShipmentSearchResponse(PaginatedResponse):
    """
    OK

    Examples
    --------
    from sayari.base_types import QualifiedCount
    from sayari.trade import (
        BusinessPurpose,
        DataSource,
        HsCodeInfo,
        MonetaryValue,
        Shipment,
        ShipmentIdentifier,
        ShipmentSearchResponse,
        SourceOrDestinationEntity,
        Weight,
    )

    ShipmentSearchResponse(
        offset=0,
        limit=1,
        size=QualifiedCount(
            count=13,
            qualifier="eq",
        ),
        next=True,
        data=[
            Shipment(
                id="Sdl3aYnJ23Y-3IxgIOkXPA",
                type="shipment",
                buyer=[
                    SourceOrDestinationEntity(
                        id="uWNWgzX-Kvp1j-WeXKmLQw",
                        names=[
                            'ООО "ЭРБЭ ЭЛЕКТРОМЕДИЦИН"',
                            'LLC "ERBE ELECTROMEDICAL"',
                        ],
                        risks={
                            "imports_bis_high_priority_items": 1,
                            "imports_bis_high_priority_items_critical_components": 1,
                        },
                        countries=["RUS"],
                        business_purpose=[
                            BusinessPurpose(
                                value="Торговля розничная лекарственными средствами в специализированных магазинах (аптеках)",
                                code="47.73",
                            )
                        ],
                    )
                ],
                supplier=[
                    SourceOrDestinationEntity(
                        id="yNwunHdFInERKig0Thusgg",
                        names=["ERBE ELEKTROMEDIZIN GMBH", "ERBE ELEKTROMED"],
                        risks={
                            "exports_bis_high_priority_items_critical_components": 1,
                            "exports_bis_high_priority_items": 1,
                        },
                        countries=[
                            "DEU",
                            "USA",
                            "MEX",
                            "BRA",
                            "BEL",
                            "ECU",
                            "ITA",
                            "SGP",
                            "CAN",
                            "SWE",
                            "ZAF",
                        ],
                        business_purpose=[
                            BusinessPurpose(
                                value="Manufacture of irradiation, electromedical and electrotherapeutic equipment",
                                code="2660",
                            )
                        ],
                    )
                ],
                arrival_date="2024-05-14",
                product_origin=["DEU"],
                monetary_value=[
                    MonetaryValue(
                        value=2570.52,
                        currency="USD",
                        context="cost_insurance_and_freight",
                    )
                ],
                weight=[
                    Weight(
                        value=5.5,
                        unit="kilogram",
                        type="net_weight",
                    )
                ],
                identifier=[
                    ShipmentIdentifier(
                        value="10013160/140524/3162513",
                        type="rus_declaration_number",
                    )
                ],
                sources=[
                    DataSource(
                        id="66dfefb726ae00fde8f09f34c5578d35",
                        label="Russia Imports & Exports (January 2023 - Present)",
                    )
                ],
                hs_codes=[
                    HsCodeInfo(
                        code="854231",
                        description="Electronic integrated circuits; processors and controllers, whether or not combined with memories, converters, logic circuits, amplifiers, clock and timing circuits, or other circuits",
                    )
                ],
                product_descriptions=[
                    "СХЕМЫ ИНТЕГРАЛЬНЫЕ МОНОЛИТНЫЕ, ЦИФРОВЫЕ, НЕ ЛОМ ЭЛЕКТРООБОРУДОВАНИЯ, НЕ СОДЕРЖАТ КРИПТОГРАФИЧЕСКИХ МОДУЛЕЙ И ПРИЕМОПЕРЕДАТОЧНЫХ УСТР-В, НЕ ДЛЯ ШИФРОВАНИЯ, ГРАЖДАНСКОГО НАЗНАЧЕНИЯ, ДЛЯ ИСПОЛЬЗОВАНИЯ В СОСТАВЕ МЕДИЦИНСКОГО ОБОРУДОВАНИЯ"
                ],
                record="4337bf42a200a30b90d536c5992167e1/1001325059/1721001600000/0",
            )
        ],
    )
    """

    offset: int
    next: bool
    data: typing.List[Shipment]

    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
