# 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 typing import Any, Dict, List, Optional, Tuple, Union

from pydantic import Field, StrictBool, 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_origin_create import (
    ExternalAPIOriginCreate,
)
from pywaybiller.openapi_client.models.external_api_origin_create_request import (
    ExternalAPIOriginCreateRequest,
)
from pywaybiller.openapi_client.models.external_api_origin_retrieve import (
    ExternalAPIOriginRetrieve,
)
from pywaybiller.openapi_client.models.external_api_origin_update import (
    ExternalAPIOriginUpdate,
)
from pywaybiller.openapi_client.models.external_api_origin_update_request import (
    ExternalAPIOriginUpdateRequest,
)
from pywaybiller.openapi_client.models.paginated_external_api_origin_list_list import (
    PaginatedExternalAPIOriginListList,
)
from pywaybiller.openapi_client.rest import RESTResponseType


class OriginsApi:
    """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 origins_create(
        self,
        external_api_origin_create_request: ExternalAPIOriginCreateRequest,
        _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,
    ) -> ExternalAPIOriginCreate:
        """Creation of an origin

        Creates a new origin          **NB!** All provided identifiers must be valid Waybiller IDs.

        :param external_api_origin_create_request: (required)
        :type external_api_origin_create_request: ExternalAPIOriginCreateRequest
        :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._origins_create_serialize(
            external_api_origin_create_request=external_api_origin_create_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ExternalAPIOriginCreate",
            "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 origins_create_with_http_info(
        self,
        external_api_origin_create_request: ExternalAPIOriginCreateRequest,
        _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[ExternalAPIOriginCreate]:
        """Creation of an origin

        Creates a new origin          **NB!** All provided identifiers must be valid Waybiller IDs.

        :param external_api_origin_create_request: (required)
        :type external_api_origin_create_request: ExternalAPIOriginCreateRequest
        :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._origins_create_serialize(
            external_api_origin_create_request=external_api_origin_create_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ExternalAPIOriginCreate",
            "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 origins_create_without_preload_content(
        self,
        external_api_origin_create_request: ExternalAPIOriginCreateRequest,
        _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 an origin

        Creates a new origin          **NB!** All provided identifiers must be valid Waybiller IDs.

        :param external_api_origin_create_request: (required)
        :type external_api_origin_create_request: ExternalAPIOriginCreateRequest
        :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._origins_create_serialize(
            external_api_origin_create_request=external_api_origin_create_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _origins_create_serialize(
        self,
        external_api_origin_create_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_origin_create_request is not None:
            _body_params = external_api_origin_create_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/origins/",
            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 origins_list(
        self,
        company__reg_code: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to the company with the specified registration code (case-sensitive)"
            ),
        ] = None,
        company__reg_code__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to companies whose registration codes contain this keyword (case-sensitive)"
            ),
        ] = None,
        company__reg_code__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to companies whose registration codes contain this keyword (case-insensitive)"
            ),
        ] = None,
        company__reg_code__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to the company with the specified registration code (case-insensitive)"
            ),
        ] = None,
        explicitly_viewable: Annotated[
            Optional[StrictBool],
            Field(
                description="Filters origins that belong to your company or where your company was added as a partner"
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(description="Maximum number of objects to return per page"),
        ] = None,
        location__address: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified address (case-sensitive)"
            ),
        ] = None,
        location__address__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose addresses contain this keyword (case-sensitive)"
            ),
        ] = None,
        location__address__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose addresses contain this keyword (case-insensitive)"
            ),
        ] = None,
        location__address__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified address (case-insensitive)"
            ),
        ] = None,
        name: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified name (case-sensitive)"
            ),
        ] = None,
        name__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose names contain this keyword (case-sensitive)"
            ),
        ] = None,
        name__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose names contain this keyword (case-insensitive)"
            ),
        ] = None,
        name__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified name (case-insensitive)"
            ),
        ] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(strict=True, ge=0)]],
            Field(description="The initial index from which to return the results"),
        ] = 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,
    ) -> PaginatedExternalAPIOriginListList:
        """Querying origins

        Returns all origins associated with your company, according to the specified filters

        :param company__reg_code: Filters origins that belong to the company with the specified registration code (case-sensitive)
        :type company__reg_code: str
        :param company__reg_code__contains: Filters origins that belong to companies whose registration codes contain this keyword (case-sensitive)
        :type company__reg_code__contains: str
        :param company__reg_code__icontains: Filters origins that belong to companies whose registration codes contain this keyword (case-insensitive)
        :type company__reg_code__icontains: str
        :param company__reg_code__iexact: Filters origins that belong to the company with the specified registration code (case-insensitive)
        :type company__reg_code__iexact: str
        :param explicitly_viewable: Filters origins that belong to your company or where your company was added as a partner
        :type explicitly_viewable: bool
        :param limit: Maximum number of objects to return per page
        :type limit: int
        :param location__address: Filters origins with the specified address (case-sensitive)
        :type location__address: str
        :param location__address__contains: Filters origins whose addresses contain this keyword (case-sensitive)
        :type location__address__contains: str
        :param location__address__icontains: Filters origins whose addresses contain this keyword (case-insensitive)
        :type location__address__icontains: str
        :param location__address__iexact: Filters origins with the specified address (case-insensitive)
        :type location__address__iexact: str
        :param name: Filters origins with the specified name (case-sensitive)
        :type name: str
        :param name__contains: Filters origins whose names contain this keyword (case-sensitive)
        :type name__contains: str
        :param name__icontains: Filters origins whose names contain this keyword (case-insensitive)
        :type name__icontains: str
        :param name__iexact: Filters origins with the specified name (case-insensitive)
        :type name__iexact: str
        :param offset: The initial index from which to return the results
        :type offset: int
        :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._origins_list_serialize(
            company__reg_code=company__reg_code,
            company__reg_code__contains=company__reg_code__contains,
            company__reg_code__icontains=company__reg_code__icontains,
            company__reg_code__iexact=company__reg_code__iexact,
            explicitly_viewable=explicitly_viewable,
            limit=limit,
            location__address=location__address,
            location__address__contains=location__address__contains,
            location__address__icontains=location__address__icontains,
            location__address__iexact=location__address__iexact,
            name=name,
            name__contains=name__contains,
            name__icontains=name__icontains,
            name__iexact=name__iexact,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PaginatedExternalAPIOriginListList",
            "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 origins_list_with_http_info(
        self,
        company__reg_code: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to the company with the specified registration code (case-sensitive)"
            ),
        ] = None,
        company__reg_code__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to companies whose registration codes contain this keyword (case-sensitive)"
            ),
        ] = None,
        company__reg_code__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to companies whose registration codes contain this keyword (case-insensitive)"
            ),
        ] = None,
        company__reg_code__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to the company with the specified registration code (case-insensitive)"
            ),
        ] = None,
        explicitly_viewable: Annotated[
            Optional[StrictBool],
            Field(
                description="Filters origins that belong to your company or where your company was added as a partner"
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(description="Maximum number of objects to return per page"),
        ] = None,
        location__address: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified address (case-sensitive)"
            ),
        ] = None,
        location__address__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose addresses contain this keyword (case-sensitive)"
            ),
        ] = None,
        location__address__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose addresses contain this keyword (case-insensitive)"
            ),
        ] = None,
        location__address__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified address (case-insensitive)"
            ),
        ] = None,
        name: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified name (case-sensitive)"
            ),
        ] = None,
        name__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose names contain this keyword (case-sensitive)"
            ),
        ] = None,
        name__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose names contain this keyword (case-insensitive)"
            ),
        ] = None,
        name__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified name (case-insensitive)"
            ),
        ] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(strict=True, ge=0)]],
            Field(description="The initial index from which to return the results"),
        ] = 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[PaginatedExternalAPIOriginListList]:
        """Querying origins

        Returns all origins associated with your company, according to the specified filters

        :param company__reg_code: Filters origins that belong to the company with the specified registration code (case-sensitive)
        :type company__reg_code: str
        :param company__reg_code__contains: Filters origins that belong to companies whose registration codes contain this keyword (case-sensitive)
        :type company__reg_code__contains: str
        :param company__reg_code__icontains: Filters origins that belong to companies whose registration codes contain this keyword (case-insensitive)
        :type company__reg_code__icontains: str
        :param company__reg_code__iexact: Filters origins that belong to the company with the specified registration code (case-insensitive)
        :type company__reg_code__iexact: str
        :param explicitly_viewable: Filters origins that belong to your company or where your company was added as a partner
        :type explicitly_viewable: bool
        :param limit: Maximum number of objects to return per page
        :type limit: int
        :param location__address: Filters origins with the specified address (case-sensitive)
        :type location__address: str
        :param location__address__contains: Filters origins whose addresses contain this keyword (case-sensitive)
        :type location__address__contains: str
        :param location__address__icontains: Filters origins whose addresses contain this keyword (case-insensitive)
        :type location__address__icontains: str
        :param location__address__iexact: Filters origins with the specified address (case-insensitive)
        :type location__address__iexact: str
        :param name: Filters origins with the specified name (case-sensitive)
        :type name: str
        :param name__contains: Filters origins whose names contain this keyword (case-sensitive)
        :type name__contains: str
        :param name__icontains: Filters origins whose names contain this keyword (case-insensitive)
        :type name__icontains: str
        :param name__iexact: Filters origins with the specified name (case-insensitive)
        :type name__iexact: str
        :param offset: The initial index from which to return the results
        :type offset: int
        :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._origins_list_serialize(
            company__reg_code=company__reg_code,
            company__reg_code__contains=company__reg_code__contains,
            company__reg_code__icontains=company__reg_code__icontains,
            company__reg_code__iexact=company__reg_code__iexact,
            explicitly_viewable=explicitly_viewable,
            limit=limit,
            location__address=location__address,
            location__address__contains=location__address__contains,
            location__address__icontains=location__address__icontains,
            location__address__iexact=location__address__iexact,
            name=name,
            name__contains=name__contains,
            name__icontains=name__icontains,
            name__iexact=name__iexact,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PaginatedExternalAPIOriginListList",
            "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 origins_list_without_preload_content(
        self,
        company__reg_code: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to the company with the specified registration code (case-sensitive)"
            ),
        ] = None,
        company__reg_code__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to companies whose registration codes contain this keyword (case-sensitive)"
            ),
        ] = None,
        company__reg_code__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to companies whose registration codes contain this keyword (case-insensitive)"
            ),
        ] = None,
        company__reg_code__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins that belong to the company with the specified registration code (case-insensitive)"
            ),
        ] = None,
        explicitly_viewable: Annotated[
            Optional[StrictBool],
            Field(
                description="Filters origins that belong to your company or where your company was added as a partner"
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(description="Maximum number of objects to return per page"),
        ] = None,
        location__address: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified address (case-sensitive)"
            ),
        ] = None,
        location__address__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose addresses contain this keyword (case-sensitive)"
            ),
        ] = None,
        location__address__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose addresses contain this keyword (case-insensitive)"
            ),
        ] = None,
        location__address__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified address (case-insensitive)"
            ),
        ] = None,
        name: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified name (case-sensitive)"
            ),
        ] = None,
        name__contains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose names contain this keyword (case-sensitive)"
            ),
        ] = None,
        name__icontains: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins whose names contain this keyword (case-insensitive)"
            ),
        ] = None,
        name__iexact: Annotated[
            Optional[StrictStr],
            Field(
                description="Filters origins with the specified name (case-insensitive)"
            ),
        ] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(strict=True, ge=0)]],
            Field(description="The initial index from which to return the results"),
        ] = 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 origins

        Returns all origins associated with your company, according to the specified filters

        :param company__reg_code: Filters origins that belong to the company with the specified registration code (case-sensitive)
        :type company__reg_code: str
        :param company__reg_code__contains: Filters origins that belong to companies whose registration codes contain this keyword (case-sensitive)
        :type company__reg_code__contains: str
        :param company__reg_code__icontains: Filters origins that belong to companies whose registration codes contain this keyword (case-insensitive)
        :type company__reg_code__icontains: str
        :param company__reg_code__iexact: Filters origins that belong to the company with the specified registration code (case-insensitive)
        :type company__reg_code__iexact: str
        :param explicitly_viewable: Filters origins that belong to your company or where your company was added as a partner
        :type explicitly_viewable: bool
        :param limit: Maximum number of objects to return per page
        :type limit: int
        :param location__address: Filters origins with the specified address (case-sensitive)
        :type location__address: str
        :param location__address__contains: Filters origins whose addresses contain this keyword (case-sensitive)
        :type location__address__contains: str
        :param location__address__icontains: Filters origins whose addresses contain this keyword (case-insensitive)
        :type location__address__icontains: str
        :param location__address__iexact: Filters origins with the specified address (case-insensitive)
        :type location__address__iexact: str
        :param name: Filters origins with the specified name (case-sensitive)
        :type name: str
        :param name__contains: Filters origins whose names contain this keyword (case-sensitive)
        :type name__contains: str
        :param name__icontains: Filters origins whose names contain this keyword (case-insensitive)
        :type name__icontains: str
        :param name__iexact: Filters origins with the specified name (case-insensitive)
        :type name__iexact: str
        :param offset: The initial index from which to return the results
        :type offset: int
        :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._origins_list_serialize(
            company__reg_code=company__reg_code,
            company__reg_code__contains=company__reg_code__contains,
            company__reg_code__icontains=company__reg_code__icontains,
            company__reg_code__iexact=company__reg_code__iexact,
            explicitly_viewable=explicitly_viewable,
            limit=limit,
            location__address=location__address,
            location__address__contains=location__address__contains,
            location__address__icontains=location__address__icontains,
            location__address__iexact=location__address__iexact,
            name=name,
            name__contains=name__contains,
            name__icontains=name__icontains,
            name__iexact=name__iexact,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _origins_list_serialize(
        self,
        company__reg_code,
        company__reg_code__contains,
        company__reg_code__icontains,
        company__reg_code__iexact,
        explicitly_viewable,
        limit,
        location__address,
        location__address__contains,
        location__address__icontains,
        location__address__iexact,
        name,
        name__contains,
        name__icontains,
        name__iexact,
        offset,
        _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 company__reg_code is not None:
            _query_params.append(("company__reg_code", company__reg_code))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        # 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/origins/",
            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 origins_retrieve(
        self,
        id: Annotated[
            StrictInt,
            Field(description="A unique integer value identifying this origin."),
        ],
        _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,
    ) -> ExternalAPIOriginRetrieve:
        """Querying a single origin

        Returns an origin instance - Public origins are accessible to all companies - Non-public origins are only accessible to the owner company and authorized partners

        :param id: A unique integer value identifying this origin. (required)
        :type id: int
        :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._origins_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": "ExternalAPIOriginRetrieve",
            "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 origins_retrieve_with_http_info(
        self,
        id: Annotated[
            StrictInt,
            Field(description="A unique integer value identifying this origin."),
        ],
        _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[ExternalAPIOriginRetrieve]:
        """Querying a single origin

        Returns an origin instance - Public origins are accessible to all companies - Non-public origins are only accessible to the owner company and authorized partners

        :param id: A unique integer value identifying this origin. (required)
        :type id: int
        :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._origins_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": "ExternalAPIOriginRetrieve",
            "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 origins_retrieve_without_preload_content(
        self,
        id: Annotated[
            StrictInt,
            Field(description="A unique integer value identifying this origin."),
        ],
        _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 a single origin

        Returns an origin instance - Public origins are accessible to all companies - Non-public origins are only accessible to the owner company and authorized partners

        :param id: A unique integer value identifying this origin. (required)
        :type id: int
        :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._origins_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": "ExternalAPIOriginRetrieve",
            "403": "DestinationsList403Response",
            "404": "EmploymentsRetrieve404Response",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _origins_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/origins/{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 origins_update(
        self,
        id: Annotated[
            StrictInt,
            Field(description="A unique integer value identifying this origin."),
        ],
        external_api_origin_update_request: Optional[
            ExternalAPIOriginUpdateRequest
        ] = 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,
    ) -> ExternalAPIOriginUpdate:
        """Updating of an origin

        Modifies an existing origin's details          **NB!** All provided identifiers must be valid Waybiller IDs.

        :param id: A unique integer value identifying this origin. (required)
        :type id: int
        :param external_api_origin_update_request:
        :type external_api_origin_update_request: ExternalAPIOriginUpdateRequest
        :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._origins_update_serialize(
            id=id,
            external_api_origin_update_request=external_api_origin_update_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPIOriginUpdate",
            "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 origins_update_with_http_info(
        self,
        id: Annotated[
            StrictInt,
            Field(description="A unique integer value identifying this origin."),
        ],
        external_api_origin_update_request: Optional[
            ExternalAPIOriginUpdateRequest
        ] = 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[ExternalAPIOriginUpdate]:
        """Updating of an origin

        Modifies an existing origin's details          **NB!** All provided identifiers must be valid Waybiller IDs.

        :param id: A unique integer value identifying this origin. (required)
        :type id: int
        :param external_api_origin_update_request:
        :type external_api_origin_update_request: ExternalAPIOriginUpdateRequest
        :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._origins_update_serialize(
            id=id,
            external_api_origin_update_request=external_api_origin_update_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ExternalAPIOriginUpdate",
            "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 origins_update_without_preload_content(
        self,
        id: Annotated[
            StrictInt,
            Field(description="A unique integer value identifying this origin."),
        ],
        external_api_origin_update_request: Optional[
            ExternalAPIOriginUpdateRequest
        ] = 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:
        """Updating of an origin

        Modifies an existing origin's details          **NB!** All provided identifiers must be valid Waybiller IDs.

        :param id: A unique integer value identifying this origin. (required)
        :type id: int
        :param external_api_origin_update_request:
        :type external_api_origin_update_request: ExternalAPIOriginUpdateRequest
        :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._origins_update_serialize(
            id=id,
            external_api_origin_update_request=external_api_origin_update_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _origins_update_serialize(
        self,
        id,
        external_api_origin_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_origin_update_request is not None:
            _body_params = external_api_origin_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/origins/{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,
        )
