# coding: utf-8

"""
Waybiller External API - with fixes

The **Waybiller External API** is a feature that allows companies to access **Waybiller** data as JSON objects and create **Waybiller** instances out of their own data.  To make integration easier for the companies, the external API provides mapping support - it is possible to create company-specific mappings for object identifiers (such as destination and origin).  These mappings will be used for representing companies data from external API, and for converting the values during the creation of **Waybiller** instances (such as transport orders and waybills).  Most of the API responses contain mapped values, which may be null if the company doesn't have a mapping for this object.  Unique **Waybiller** identifiers and values can be accessed via the `raw_data` key.  The API is HTTPS and JSON based.  ### Pagination  By default, list endpoint responses are presented in pages of 30 items.  It is possible to control the page size using the `limit` parameter: `/external-api/<some-list-endpoint>/?limit=<number>`, where `<number>` is an integer between 1 and 1000.

The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
"""  # noqa: E501

import warnings
from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple, Union

from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
from typing_extensions import Annotated

from pywaybiller.openapi_client.api_client import ApiClient, RequestSerialized
from pywaybiller.openapi_client.api_response import ApiResponse
from pywaybiller.openapi_client.models.external_api_transport_order import (
    ExternalAPITransportOrder,
)
from pywaybiller.openapi_client.models.external_api_transport_order_cancel import (
    ExternalAPITransportOrderCancel,
)
from pywaybiller.openapi_client.models.external_api_transport_order_cancel_request import (
    ExternalAPITransportOrderCancelRequest,
)
from pywaybiller.openapi_client.models.external_api_transport_order_request import (
    ExternalAPITransportOrderRequest,
)
from pywaybiller.openapi_client.models.external_api_transport_order_update import (
    ExternalAPITransportOrderUpdate,
)
from pywaybiller.openapi_client.models.external_api_transport_order_update_request import (
    ExternalAPITransportOrderUpdateRequest,
)
from pywaybiller.openapi_client.models.paginated_external_api_transport_order_list_list import (
    PaginatedExternalAPITransportOrderListList,
)
from pywaybiller.openapi_client.rest import RESTResponseType


class TransportOrdersApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_call
    def transport_orders_cancel_create(
        self,
        id: Annotated[
            StrictInt,
            Field(
                description="A unique integer value identifying this Transport order."
            ),
        ],
        external_api_transport_order_cancel_request: ExternalAPITransportOrderCancelRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ExternalAPITransportOrderCancel:
        """Cancellation of a transport order

        Cancels a transport order.

        :param id: A unique integer value identifying this Transport order. (required)
        :type id: int
        :param external_api_transport_order_cancel_request: (required)
        :type external_api_transport_order_cancel_request: ExternalAPITransportOrderCancelRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_cancel_create_serialize(
            id=id,
            external_api_transport_order_cancel_request=external_api_transport_order_cancel_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrderCancel",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def transport_orders_cancel_create_with_http_info(
        self,
        id: Annotated[
            StrictInt,
            Field(
                description="A unique integer value identifying this Transport order."
            ),
        ],
        external_api_transport_order_cancel_request: ExternalAPITransportOrderCancelRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ExternalAPITransportOrderCancel]:
        """Cancellation of a transport order

        Cancels a transport order.

        :param id: A unique integer value identifying this Transport order. (required)
        :type id: int
        :param external_api_transport_order_cancel_request: (required)
        :type external_api_transport_order_cancel_request: ExternalAPITransportOrderCancelRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_cancel_create_serialize(
            id=id,
            external_api_transport_order_cancel_request=external_api_transport_order_cancel_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrderCancel",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def transport_orders_cancel_create_without_preload_content(
        self,
        id: Annotated[
            StrictInt,
            Field(
                description="A unique integer value identifying this Transport order."
            ),
        ],
        external_api_transport_order_cancel_request: ExternalAPITransportOrderCancelRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Cancellation of a transport order

        Cancels a transport order.

        :param id: A unique integer value identifying this Transport order. (required)
        :type id: int
        :param external_api_transport_order_cancel_request: (required)
        :type external_api_transport_order_cancel_request: ExternalAPITransportOrderCancelRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_cancel_create_serialize(
            id=id,
            external_api_transport_order_cancel_request=external_api_transport_order_cancel_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrderCancel",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _transport_orders_cancel_create_serialize(
        self,
        id,
        external_api_transport_order_cancel_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if external_api_transport_order_cancel_request is not None:
            _body_params = external_api_transport_order_cancel_request

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(
                ["application/json"]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(
                ["application/json"]
            )
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ApiKeyAuth"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/external-api/transport-orders/{id}/cancel/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def transport_orders_create(
        self,
        external_api_transport_order_request: ExternalAPITransportOrderRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ExternalAPITransportOrder:
        """Creation of a transport order

        Creates a new transport order.<br><br>         **NB!** All posted IDs are IDs in your system and these are used to match objects in your system with objects in Waybiller.

        :param external_api_transport_order_request: (required)
        :type external_api_transport_order_request: ExternalAPITransportOrderRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_create_serialize(
            external_api_transport_order_request=external_api_transport_order_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ExternalAPITransportOrder",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def transport_orders_create_with_http_info(
        self,
        external_api_transport_order_request: ExternalAPITransportOrderRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ExternalAPITransportOrder]:
        """Creation of a transport order

        Creates a new transport order.<br><br>         **NB!** All posted IDs are IDs in your system and these are used to match objects in your system with objects in Waybiller.

        :param external_api_transport_order_request: (required)
        :type external_api_transport_order_request: ExternalAPITransportOrderRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_create_serialize(
            external_api_transport_order_request=external_api_transport_order_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ExternalAPITransportOrder",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def transport_orders_create_without_preload_content(
        self,
        external_api_transport_order_request: ExternalAPITransportOrderRequest,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creation of a transport order

        Creates a new transport order.<br><br>         **NB!** All posted IDs are IDs in your system and these are used to match objects in your system with objects in Waybiller.

        :param external_api_transport_order_request: (required)
        :type external_api_transport_order_request: ExternalAPITransportOrderRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_create_serialize(
            external_api_transport_order_request=external_api_transport_order_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ExternalAPITransportOrder",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _transport_orders_create_serialize(
        self,
        external_api_transport_order_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if external_api_transport_order_request is not None:
            _body_params = external_api_transport_order_request

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(
                ["application/json"]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(
                ["application/json"]
            )
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ApiKeyAuth"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/external-api/transport-orders/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def transport_orders_list(
        self,
        destination_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of destination IDs from your system. Multiple values may be separated by commas."
            ),
        ] = None,
        end_date: Annotated[
            Optional[datetime],
            Field(
                description="Filters transport orders that have transport date on or before the specified date."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(description="Maximum number of objects to return per page"),
        ] = None,
        number: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified number (case sensitive)."
            ),
        ] = None,
        number__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which numbers contain this keyword (case sensitive)."
            ),
        ] = None,
        number__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which numbers contain this keyword (case insensitive)."
            ),
        ] = None,
        number__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified number (case insensitive)."
            ),
        ] = None,
        number__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order numbers. Multiple values may be separated by commas."
            ),
        ] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(strict=True, ge=0)]],
            Field(description="The initial index from which to return the results"),
        ] = None,
        origin_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of origin IDs from your system. Multiple values may be separated by commas."
            ),
        ] = None,
        raw_destination_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of raw destination IDs. Multiple values may be separated by commas."
            ),
        ] = None,
        raw_origin_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of raw origin IDs. Multiple values may be separated by commas."
            ),
        ] = None,
        start_date: Annotated[
            Optional[datetime],
            Field(
                description="Filters transport orders that have transport date after the specified date."
            ),
        ] = None,
        status: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified status (case sensitive)."
            ),
        ] = None,
        status__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which statuses contain this keyword (case sensitive)."
            ),
        ] = None,
        status__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which statuses contain this keyword (case insensitive)."
            ),
        ] = None,
        status__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified status (case insensitive)."
            ),
        ] = None,
        status__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order statuses. Multiple values may be separated by commas."
            ),
        ] = None,
        truck__truck__reg_number: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified truck reg number (case sensitive)."
            ),
        ] = None,
        truck__truck__reg_number__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which truck reg numbers contain this keyword (case sensitive)."
            ),
        ] = None,
        truck__truck__reg_number__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which truck reg numbers contain this keyword (case insensitive)."
            ),
        ] = None,
        truck__truck__reg_number__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified truck reg number (case insensitive)."
            ),
        ] = None,
        truck__truck__reg_number__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order truck reg numbers. Multiple values may be separated by commas."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaginatedExternalAPITransportOrderListList:
        """Querying of transport orders

        Returns transport orders associated with your company, according to the specified filters.

        :param destination_ids: Filters transport orders with a specified list of destination IDs from your system. Multiple values may be separated by commas.
        :type destination_ids: str
        :param end_date: Filters transport orders that have transport date on or before the specified date.
        :type end_date: datetime
        :param limit: Maximum number of objects to return per page
        :type limit: int
        :param number: Filters transport orders with specified number (case sensitive).
        :type number: str
        :param number__contains: Filters transport orders of which numbers contain this keyword (case sensitive).
        :type number__contains: str
        :param number__icontains: Filters transport orders of which numbers contain this keyword (case insensitive).
        :type number__icontains: str
        :param number__iexact: Filters transport orders with specified number (case insensitive).
        :type number__iexact: str
        :param number__in: Filters transport orders with specified list of transport order numbers. Multiple values may be separated by commas.
        :type number__in: str
        :param offset: The initial index from which to return the results
        :type offset: int
        :param origin_ids: Filters transport orders with a specified list of origin IDs from your system. Multiple values may be separated by commas.
        :type origin_ids: str
        :param raw_destination_ids: Filters transport orders with a specified list of raw destination IDs. Multiple values may be separated by commas.
        :type raw_destination_ids: str
        :param raw_origin_ids: Filters transport orders with a specified list of raw origin IDs. Multiple values may be separated by commas.
        :type raw_origin_ids: str
        :param start_date: Filters transport orders that have transport date after the specified date.
        :type start_date: datetime
        :param status: Filters transport orders with specified status (case sensitive).
        :type status: str
        :param status__contains: Filters transport orders of which statuses contain this keyword (case sensitive).
        :type status__contains: str
        :param status__icontains: Filters transport orders of which statuses contain this keyword (case insensitive).
        :type status__icontains: str
        :param status__iexact: Filters transport orders with specified status (case insensitive).
        :type status__iexact: str
        :param status__in: Filters transport orders with specified list of transport order statuses. Multiple values may be separated by commas.
        :type status__in: str
        :param truck__truck__reg_number: Filters transport orders with specified truck reg number (case sensitive).
        :type truck__truck__reg_number: str
        :param truck__truck__reg_number__contains: Filters transport orders of which truck reg numbers contain this keyword (case sensitive).
        :type truck__truck__reg_number__contains: str
        :param truck__truck__reg_number__icontains: Filters transport orders of which truck reg numbers contain this keyword (case insensitive).
        :type truck__truck__reg_number__icontains: str
        :param truck__truck__reg_number__iexact: Filters transport orders with specified truck reg number (case insensitive).
        :type truck__truck__reg_number__iexact: str
        :param truck__truck__reg_number__in: Filters transport orders with specified list of transport order truck reg numbers. Multiple values may be separated by commas.
        :type truck__truck__reg_number__in: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_list_serialize(
            destination_ids=destination_ids,
            end_date=end_date,
            limit=limit,
            number=number,
            number__contains=number__contains,
            number__icontains=number__icontains,
            number__iexact=number__iexact,
            number__in=number__in,
            offset=offset,
            origin_ids=origin_ids,
            raw_destination_ids=raw_destination_ids,
            raw_origin_ids=raw_origin_ids,
            start_date=start_date,
            status=status,
            status__contains=status__contains,
            status__icontains=status__icontains,
            status__iexact=status__iexact,
            status__in=status__in,
            truck__truck__reg_number=truck__truck__reg_number,
            truck__truck__reg_number__contains=truck__truck__reg_number__contains,
            truck__truck__reg_number__icontains=truck__truck__reg_number__icontains,
            truck__truck__reg_number__iexact=truck__truck__reg_number__iexact,
            truck__truck__reg_number__in=truck__truck__reg_number__in,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PaginatedExternalAPITransportOrderListList",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def transport_orders_list_with_http_info(
        self,
        destination_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of destination IDs from your system. Multiple values may be separated by commas."
            ),
        ] = None,
        end_date: Annotated[
            Optional[datetime],
            Field(
                description="Filters transport orders that have transport date on or before the specified date."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(description="Maximum number of objects to return per page"),
        ] = None,
        number: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified number (case sensitive)."
            ),
        ] = None,
        number__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which numbers contain this keyword (case sensitive)."
            ),
        ] = None,
        number__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which numbers contain this keyword (case insensitive)."
            ),
        ] = None,
        number__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified number (case insensitive)."
            ),
        ] = None,
        number__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order numbers. Multiple values may be separated by commas."
            ),
        ] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(strict=True, ge=0)]],
            Field(description="The initial index from which to return the results"),
        ] = None,
        origin_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of origin IDs from your system. Multiple values may be separated by commas."
            ),
        ] = None,
        raw_destination_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of raw destination IDs. Multiple values may be separated by commas."
            ),
        ] = None,
        raw_origin_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of raw origin IDs. Multiple values may be separated by commas."
            ),
        ] = None,
        start_date: Annotated[
            Optional[datetime],
            Field(
                description="Filters transport orders that have transport date after the specified date."
            ),
        ] = None,
        status: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified status (case sensitive)."
            ),
        ] = None,
        status__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which statuses contain this keyword (case sensitive)."
            ),
        ] = None,
        status__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which statuses contain this keyword (case insensitive)."
            ),
        ] = None,
        status__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified status (case insensitive)."
            ),
        ] = None,
        status__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order statuses. Multiple values may be separated by commas."
            ),
        ] = None,
        truck__truck__reg_number: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified truck reg number (case sensitive)."
            ),
        ] = None,
        truck__truck__reg_number__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which truck reg numbers contain this keyword (case sensitive)."
            ),
        ] = None,
        truck__truck__reg_number__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which truck reg numbers contain this keyword (case insensitive)."
            ),
        ] = None,
        truck__truck__reg_number__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified truck reg number (case insensitive)."
            ),
        ] = None,
        truck__truck__reg_number__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order truck reg numbers. Multiple values may be separated by commas."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaginatedExternalAPITransportOrderListList]:
        """Querying of transport orders

        Returns transport orders associated with your company, according to the specified filters.

        :param destination_ids: Filters transport orders with a specified list of destination IDs from your system. Multiple values may be separated by commas.
        :type destination_ids: str
        :param end_date: Filters transport orders that have transport date on or before the specified date.
        :type end_date: datetime
        :param limit: Maximum number of objects to return per page
        :type limit: int
        :param number: Filters transport orders with specified number (case sensitive).
        :type number: str
        :param number__contains: Filters transport orders of which numbers contain this keyword (case sensitive).
        :type number__contains: str
        :param number__icontains: Filters transport orders of which numbers contain this keyword (case insensitive).
        :type number__icontains: str
        :param number__iexact: Filters transport orders with specified number (case insensitive).
        :type number__iexact: str
        :param number__in: Filters transport orders with specified list of transport order numbers. Multiple values may be separated by commas.
        :type number__in: str
        :param offset: The initial index from which to return the results
        :type offset: int
        :param origin_ids: Filters transport orders with a specified list of origin IDs from your system. Multiple values may be separated by commas.
        :type origin_ids: str
        :param raw_destination_ids: Filters transport orders with a specified list of raw destination IDs. Multiple values may be separated by commas.
        :type raw_destination_ids: str
        :param raw_origin_ids: Filters transport orders with a specified list of raw origin IDs. Multiple values may be separated by commas.
        :type raw_origin_ids: str
        :param start_date: Filters transport orders that have transport date after the specified date.
        :type start_date: datetime
        :param status: Filters transport orders with specified status (case sensitive).
        :type status: str
        :param status__contains: Filters transport orders of which statuses contain this keyword (case sensitive).
        :type status__contains: str
        :param status__icontains: Filters transport orders of which statuses contain this keyword (case insensitive).
        :type status__icontains: str
        :param status__iexact: Filters transport orders with specified status (case insensitive).
        :type status__iexact: str
        :param status__in: Filters transport orders with specified list of transport order statuses. Multiple values may be separated by commas.
        :type status__in: str
        :param truck__truck__reg_number: Filters transport orders with specified truck reg number (case sensitive).
        :type truck__truck__reg_number: str
        :param truck__truck__reg_number__contains: Filters transport orders of which truck reg numbers contain this keyword (case sensitive).
        :type truck__truck__reg_number__contains: str
        :param truck__truck__reg_number__icontains: Filters transport orders of which truck reg numbers contain this keyword (case insensitive).
        :type truck__truck__reg_number__icontains: str
        :param truck__truck__reg_number__iexact: Filters transport orders with specified truck reg number (case insensitive).
        :type truck__truck__reg_number__iexact: str
        :param truck__truck__reg_number__in: Filters transport orders with specified list of transport order truck reg numbers. Multiple values may be separated by commas.
        :type truck__truck__reg_number__in: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_list_serialize(
            destination_ids=destination_ids,
            end_date=end_date,
            limit=limit,
            number=number,
            number__contains=number__contains,
            number__icontains=number__icontains,
            number__iexact=number__iexact,
            number__in=number__in,
            offset=offset,
            origin_ids=origin_ids,
            raw_destination_ids=raw_destination_ids,
            raw_origin_ids=raw_origin_ids,
            start_date=start_date,
            status=status,
            status__contains=status__contains,
            status__icontains=status__icontains,
            status__iexact=status__iexact,
            status__in=status__in,
            truck__truck__reg_number=truck__truck__reg_number,
            truck__truck__reg_number__contains=truck__truck__reg_number__contains,
            truck__truck__reg_number__icontains=truck__truck__reg_number__icontains,
            truck__truck__reg_number__iexact=truck__truck__reg_number__iexact,
            truck__truck__reg_number__in=truck__truck__reg_number__in,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PaginatedExternalAPITransportOrderListList",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def transport_orders_list_without_preload_content(
        self,
        destination_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of destination IDs from your system. Multiple values may be separated by commas."
            ),
        ] = None,
        end_date: Annotated[
            Optional[datetime],
            Field(
                description="Filters transport orders that have transport date on or before the specified date."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(description="Maximum number of objects to return per page"),
        ] = None,
        number: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified number (case sensitive)."
            ),
        ] = None,
        number__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which numbers contain this keyword (case sensitive)."
            ),
        ] = None,
        number__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which numbers contain this keyword (case insensitive)."
            ),
        ] = None,
        number__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified number (case insensitive)."
            ),
        ] = None,
        number__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order numbers. Multiple values may be separated by commas."
            ),
        ] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(strict=True, ge=0)]],
            Field(description="The initial index from which to return the results"),
        ] = None,
        origin_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of origin IDs from your system. Multiple values may be separated by commas."
            ),
        ] = None,
        raw_destination_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of raw destination IDs. Multiple values may be separated by commas."
            ),
        ] = None,
        raw_origin_ids: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with a specified list of raw origin IDs. Multiple values may be separated by commas."
            ),
        ] = None,
        start_date: Annotated[
            Optional[datetime],
            Field(
                description="Filters transport orders that have transport date after the specified date."
            ),
        ] = None,
        status: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified status (case sensitive)."
            ),
        ] = None,
        status__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which statuses contain this keyword (case sensitive)."
            ),
        ] = None,
        status__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which statuses contain this keyword (case insensitive)."
            ),
        ] = None,
        status__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified status (case insensitive)."
            ),
        ] = None,
        status__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order statuses. Multiple values may be separated by commas."
            ),
        ] = None,
        truck__truck__reg_number: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified truck reg number (case sensitive)."
            ),
        ] = None,
        truck__truck__reg_number__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which truck reg numbers contain this keyword (case sensitive)."
            ),
        ] = None,
        truck__truck__reg_number__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders of which truck reg numbers contain this keyword (case insensitive)."
            ),
        ] = None,
        truck__truck__reg_number__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified truck reg number (case insensitive)."
            ),
        ] = None,
        truck__truck__reg_number__in: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters transport orders with specified list of transport order truck reg numbers. Multiple values may be separated by commas."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Querying of transport orders

        Returns transport orders associated with your company, according to the specified filters.

        :param destination_ids: Filters transport orders with a specified list of destination IDs from your system. Multiple values may be separated by commas.
        :type destination_ids: str
        :param end_date: Filters transport orders that have transport date on or before the specified date.
        :type end_date: datetime
        :param limit: Maximum number of objects to return per page
        :type limit: int
        :param number: Filters transport orders with specified number (case sensitive).
        :type number: str
        :param number__contains: Filters transport orders of which numbers contain this keyword (case sensitive).
        :type number__contains: str
        :param number__icontains: Filters transport orders of which numbers contain this keyword (case insensitive).
        :type number__icontains: str
        :param number__iexact: Filters transport orders with specified number (case insensitive).
        :type number__iexact: str
        :param number__in: Filters transport orders with specified list of transport order numbers. Multiple values may be separated by commas.
        :type number__in: str
        :param offset: The initial index from which to return the results
        :type offset: int
        :param origin_ids: Filters transport orders with a specified list of origin IDs from your system. Multiple values may be separated by commas.
        :type origin_ids: str
        :param raw_destination_ids: Filters transport orders with a specified list of raw destination IDs. Multiple values may be separated by commas.
        :type raw_destination_ids: str
        :param raw_origin_ids: Filters transport orders with a specified list of raw origin IDs. Multiple values may be separated by commas.
        :type raw_origin_ids: str
        :param start_date: Filters transport orders that have transport date after the specified date.
        :type start_date: datetime
        :param status: Filters transport orders with specified status (case sensitive).
        :type status: str
        :param status__contains: Filters transport orders of which statuses contain this keyword (case sensitive).
        :type status__contains: str
        :param status__icontains: Filters transport orders of which statuses contain this keyword (case insensitive).
        :type status__icontains: str
        :param status__iexact: Filters transport orders with specified status (case insensitive).
        :type status__iexact: str
        :param status__in: Filters transport orders with specified list of transport order statuses. Multiple values may be separated by commas.
        :type status__in: str
        :param truck__truck__reg_number: Filters transport orders with specified truck reg number (case sensitive).
        :type truck__truck__reg_number: str
        :param truck__truck__reg_number__contains: Filters transport orders of which truck reg numbers contain this keyword (case sensitive).
        :type truck__truck__reg_number__contains: str
        :param truck__truck__reg_number__icontains: Filters transport orders of which truck reg numbers contain this keyword (case insensitive).
        :type truck__truck__reg_number__icontains: str
        :param truck__truck__reg_number__iexact: Filters transport orders with specified truck reg number (case insensitive).
        :type truck__truck__reg_number__iexact: str
        :param truck__truck__reg_number__in: Filters transport orders with specified list of transport order truck reg numbers. Multiple values may be separated by commas.
        :type truck__truck__reg_number__in: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_list_serialize(
            destination_ids=destination_ids,
            end_date=end_date,
            limit=limit,
            number=number,
            number__contains=number__contains,
            number__icontains=number__icontains,
            number__iexact=number__iexact,
            number__in=number__in,
            offset=offset,
            origin_ids=origin_ids,
            raw_destination_ids=raw_destination_ids,
            raw_origin_ids=raw_origin_ids,
            start_date=start_date,
            status=status,
            status__contains=status__contains,
            status__icontains=status__icontains,
            status__iexact=status__iexact,
            status__in=status__in,
            truck__truck__reg_number=truck__truck__reg_number,
            truck__truck__reg_number__contains=truck__truck__reg_number__contains,
            truck__truck__reg_number__icontains=truck__truck__reg_number__icontains,
            truck__truck__reg_number__iexact=truck__truck__reg_number__iexact,
            truck__truck__reg_number__in=truck__truck__reg_number__in,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PaginatedExternalAPITransportOrderListList",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _transport_orders_list_serialize(
        self,
        destination_ids,
        end_date,
        limit,
        number,
        number__contains,
        number__icontains,
        number__iexact,
        number__in,
        offset,
        origin_ids,
        raw_destination_ids,
        raw_origin_ids,
        start_date,
        status,
        status__contains,
        status__icontains,
        status__iexact,
        status__in,
        truck__truck__reg_number,
        truck__truck__reg_number__contains,
        truck__truck__reg_number__icontains,
        truck__truck__reg_number__iexact,
        truck__truck__reg_number__in,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if destination_ids is not None:
            _query_params.append(("destination_ids", destination_ids))

        if end_date is not None:
            if isinstance(end_date, datetime):
                _query_params.append(
                    (
                        "end_date",
                        end_date.strftime(
                            self.api_client.configuration.datetime_format
                        ),
                    )
                )
            else:
                _query_params.append(("end_date", end_date))

        if limit is not None:
            _query_params.append(("limit", limit))

        if number is not None:
            _query_params.append(("number", number))

        if number__contains is not None:
            _query_params.append(("number__contains", number__contains))

        if number__icontains is not None:
            _query_params.append(("number__icontains", number__icontains))

        if number__iexact is not None:
            _query_params.append(("number__iexact", number__iexact))

        if number__in is not None:
            _query_params.append(("number__in", number__in))

        if offset is not None:
            _query_params.append(("offset", offset))

        if origin_ids is not None:
            _query_params.append(("origin_ids", origin_ids))

        if raw_destination_ids is not None:
            _query_params.append(("raw_destination_ids", raw_destination_ids))

        if raw_origin_ids is not None:
            _query_params.append(("raw_origin_ids", raw_origin_ids))

        if start_date is not None:
            if isinstance(start_date, datetime):
                _query_params.append(
                    (
                        "start_date",
                        start_date.strftime(
                            self.api_client.configuration.datetime_format
                        ),
                    )
                )
            else:
                _query_params.append(("start_date", start_date))

        if status is not None:
            _query_params.append(("status", status))

        if status__contains is not None:
            _query_params.append(("status__contains", status__contains))

        if status__icontains is not None:
            _query_params.append(("status__icontains", status__icontains))

        if status__iexact is not None:
            _query_params.append(("status__iexact", status__iexact))

        if status__in is not None:
            _query_params.append(("status__in", status__in))

        if truck__truck__reg_number is not None:
            _query_params.append(("truck__truck__reg_number", truck__truck__reg_number))

        if truck__truck__reg_number__contains is not None:
            _query_params.append(
                (
                    "truck__truck__reg_number__contains",
                    truck__truck__reg_number__contains,
                )
            )

        if truck__truck__reg_number__icontains is not None:
            _query_params.append(
                (
                    "truck__truck__reg_number__icontains",
                    truck__truck__reg_number__icontains,
                )
            )

        if truck__truck__reg_number__iexact is not None:
            _query_params.append(
                ("truck__truck__reg_number__iexact", truck__truck__reg_number__iexact)
            )

        if truck__truck__reg_number__in is not None:
            _query_params.append(
                ("truck__truck__reg_number__in", truck__truck__reg_number__in)
            )

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(
                ["application/json"]
            )

        # authentication setting
        _auth_settings: List[str] = ["ApiKeyAuth"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/external-api/transport-orders/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def transport_orders_retrieve(
        self,
        id: Annotated[
            StrictStr, Field(description="The ID of the transport order queried.")
        ],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ExternalAPITransportOrder:
        """Querying of a single transport order

        Returns a transport order with the specified ID. Only companies associated with the transport order can query it.

        :param id: The ID of the transport order queried. (required)
        :type id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_retrieve_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrder",
            "403": "DestinationsList403Response",
            "404": "EmploymentsRetrieve404Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def transport_orders_retrieve_with_http_info(
        self,
        id: Annotated[
            StrictStr, Field(description="The ID of the transport order queried.")
        ],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ExternalAPITransportOrder]:
        """Querying of a single transport order

        Returns a transport order with the specified ID. Only companies associated with the transport order can query it.

        :param id: The ID of the transport order queried. (required)
        :type id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_retrieve_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrder",
            "403": "DestinationsList403Response",
            "404": "EmploymentsRetrieve404Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def transport_orders_retrieve_without_preload_content(
        self,
        id: Annotated[
            StrictStr, Field(description="The ID of the transport order queried.")
        ],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Querying of a single transport order

        Returns a transport order with the specified ID. Only companies associated with the transport order can query it.

        :param id: The ID of the transport order queried. (required)
        :type id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_retrieve_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrder",
            "403": "DestinationsList403Response",
            "404": "EmploymentsRetrieve404Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _transport_orders_retrieve_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(
                ["application/json"]
            )

        # authentication setting
        _auth_settings: List[str] = ["ApiKeyAuth"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/external-api/transport-orders/{id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def transport_orders_update(
        self,
        id: Annotated[
            StrictInt,
            Field(
                description="A unique integer value identifying this Transport order."
            ),
        ],
        external_api_transport_order_update_request: Optional[
            ExternalAPITransportOrderUpdateRequest
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ExternalAPITransportOrderUpdate:
        """Editing of a transport order

        Edits a transport order.

        :param id: A unique integer value identifying this Transport order. (required)
        :type id: int
        :param external_api_transport_order_update_request:
        :type external_api_transport_order_update_request: ExternalAPITransportOrderUpdateRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_update_serialize(
            id=id,
            external_api_transport_order_update_request=external_api_transport_order_update_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrderUpdate",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def transport_orders_update_with_http_info(
        self,
        id: Annotated[
            StrictInt,
            Field(
                description="A unique integer value identifying this Transport order."
            ),
        ],
        external_api_transport_order_update_request: Optional[
            ExternalAPITransportOrderUpdateRequest
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ExternalAPITransportOrderUpdate]:
        """Editing of a transport order

        Edits a transport order.

        :param id: A unique integer value identifying this Transport order. (required)
        :type id: int
        :param external_api_transport_order_update_request:
        :type external_api_transport_order_update_request: ExternalAPITransportOrderUpdateRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_update_serialize(
            id=id,
            external_api_transport_order_update_request=external_api_transport_order_update_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrderUpdate",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def transport_orders_update_without_preload_content(
        self,
        id: Annotated[
            StrictInt,
            Field(
                description="A unique integer value identifying this Transport order."
            ),
        ],
        external_api_transport_order_update_request: Optional[
            ExternalAPITransportOrderUpdateRequest
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Editing of a transport order

        Edits a transport order.

        :param id: A unique integer value identifying this Transport order. (required)
        :type id: int
        :param external_api_transport_order_update_request:
        :type external_api_transport_order_update_request: ExternalAPITransportOrderUpdateRequest
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._transport_orders_update_serialize(
            id=id,
            external_api_transport_order_update_request=external_api_transport_order_update_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPITransportOrderUpdate",
            "403": "DestinationsList403Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _transport_orders_update_serialize(
        self,
        id,
        external_api_transport_order_update_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if external_api_transport_order_update_request is not None:
            _body_params = external_api_transport_order_update_request

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(
                ["application/json"]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(
                ["application/json"]
            )
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ApiKeyAuth"]

        return self.api_client.param_serialize(
            method="PUT",
            resource_path="/external-api/transport-orders/{id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )
