# coding: utf-8

"""
    Selling Partner API for Fulfillment Inbound

    The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network.

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

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


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from spapi.api_client import ApiClient


class FbaInboundV0Api(object):
    """NOTE: This class is auto generated by the openapi generator.

    Do not edit the class manually.
    """

    api_models_module = "spapi.models.fulfillment_inbound_v0"

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client
        self.classFileName = 'fba_inbound_v0_api'

    def get_bill_of_lading(self, shipment_id, **kwargs):  # noqa: E501
        """get_bill_of_lading  # noqa: E501

        Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading operation returns PDF document data for printing a bill of lading for an Amazon-partnered Less Than Truckload/Full Truckload (LTL/FTL) inbound shipment.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_bill_of_lading(shipment_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str shipment_id: A shipment identifier originally returned by the createInboundShipmentPlan operation. (required)
        :return: GetBillOfLadingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_bill_of_lading_with_http_info(shipment_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_bill_of_lading_with_http_info(shipment_id, **kwargs)  # noqa: E501
            return data

    def get_bill_of_lading_with_http_info(self, shipment_id, **kwargs):  # noqa: E501
        """get_bill_of_lading  # noqa: E501

        Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading operation returns PDF document data for printing a bill of lading for an Amazon-partnered Less Than Truckload/Full Truckload (LTL/FTL) inbound shipment.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_bill_of_lading_with_http_info(shipment_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str shipment_id: A shipment identifier originally returned by the createInboundShipmentPlan operation. (required)
        :return: GetBillOfLadingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['shipment_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_bill_of_lading" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'shipment_id' is set
        if self.api_client.client_side_validation and ('shipment_id' not in params or
                                                       params['shipment_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `shipment_id` when calling `get_bill_of_lading`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'shipment_id' in params:
            path_params['shipmentId'] = params['shipment_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/fba/inbound/v0/shipments/{shipmentId}/billOfLading', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetBillOfLadingResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats, api_models_module=self.api_models_module)

    def get_labels(self, shipment_id, page_type, label_type, **kwargs):  # noqa: E501
        """get_labels  # noqa: E501

        Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_labels(shipment_id, page_type, label_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str shipment_id: A shipment identifier originally returned by the createInboundShipmentPlan operation. (required)
        :param str page_type: The page type to use to print the labels. Submitting a PageType value that is not supported in your marketplace returns an error. (required)
        :param str label_type: The type of labels requested.  (required)
        :param int number_of_packages: The number of packages in the shipment.
        :param List[str] package_labels_to_print: A list of identifiers that specify packages for which you want package labels printed.  If you provide box content information with the [FBA Inbound Shipment Carton Information Feed](https://developer-docs.amazon.com/sp-api/docs/fulfillment-by-amazon-feed-type-values#fba-inbound-shipment-carton-information-feed), then `PackageLabelsToPrint` must match the `CartonId` values you provide through that feed. If you provide box content information with the Fulfillment Inbound API v2024-03-20, then `PackageLabelsToPrint` must match the `boxID` values from the [`listShipmentBoxes`](https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v2024-03-20-reference#listshipmentboxes) response. If these values do not match as required, the operation returns the `IncorrectPackageIdentifier` error code.
        :param int number_of_pallets: The number of pallets in the shipment. This returns four identical labels for each pallet.
        :param int page_size: The page size for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. Max value:1000.
        :param int page_start_index: The page start index for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments.
        :return: GetLabelsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_labels_with_http_info(shipment_id, page_type, label_type, **kwargs)  # noqa: E501
        else:
            (data) = self.get_labels_with_http_info(shipment_id, page_type, label_type, **kwargs)  # noqa: E501
            return data

    def get_labels_with_http_info(self, shipment_id, page_type, label_type, **kwargs):  # noqa: E501
        """get_labels  # noqa: E501

        Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_labels_with_http_info(shipment_id, page_type, label_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str shipment_id: A shipment identifier originally returned by the createInboundShipmentPlan operation. (required)
        :param str page_type: The page type to use to print the labels. Submitting a PageType value that is not supported in your marketplace returns an error. (required)
        :param str label_type: The type of labels requested.  (required)
        :param int number_of_packages: The number of packages in the shipment.
        :param List[str] package_labels_to_print: A list of identifiers that specify packages for which you want package labels printed.  If you provide box content information with the [FBA Inbound Shipment Carton Information Feed](https://developer-docs.amazon.com/sp-api/docs/fulfillment-by-amazon-feed-type-values#fba-inbound-shipment-carton-information-feed), then `PackageLabelsToPrint` must match the `CartonId` values you provide through that feed. If you provide box content information with the Fulfillment Inbound API v2024-03-20, then `PackageLabelsToPrint` must match the `boxID` values from the [`listShipmentBoxes`](https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v2024-03-20-reference#listshipmentboxes) response. If these values do not match as required, the operation returns the `IncorrectPackageIdentifier` error code.
        :param int number_of_pallets: The number of pallets in the shipment. This returns four identical labels for each pallet.
        :param int page_size: The page size for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments. Max value:1000.
        :param int page_start_index: The page start index for paginating through the total packages' labels. This is a required parameter for Non-Partnered LTL Shipments.
        :return: GetLabelsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['shipment_id', 'page_type', 'label_type', 'number_of_packages', 'package_labels_to_print', 'number_of_pallets', 'page_size', 'page_start_index']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_labels" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'shipment_id' is set
        if self.api_client.client_side_validation and ('shipment_id' not in params or
                                                       params['shipment_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `shipment_id` when calling `get_labels`")  # noqa: E501
        # verify the required parameter 'page_type' is set
        if self.api_client.client_side_validation and ('page_type' not in params or
                                                       params['page_type'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `page_type` when calling `get_labels`")  # noqa: E501
        # verify the required parameter 'label_type' is set
        if self.api_client.client_side_validation and ('label_type' not in params or
                                                       params['label_type'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `label_type` when calling `get_labels`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'shipment_id' in params:
            path_params['shipmentId'] = params['shipment_id']  # noqa: E501

        query_params = []
        if 'page_type' in params:
            query_params.append(('PageType', params['page_type']))  # noqa: E501
        if 'label_type' in params:
            query_params.append(('LabelType', params['label_type']))  # noqa: E501
        if 'number_of_packages' in params:
            query_params.append(('NumberOfPackages', params['number_of_packages']))  # noqa: E501
        if 'package_labels_to_print' in params:
            query_params.append(('PackageLabelsToPrint', params['package_labels_to_print']))  # noqa: E501
            collection_formats['PackageLabelsToPrint'] = 'csv'  # noqa: E501
        if 'number_of_pallets' in params:
            query_params.append(('NumberOfPallets', params['number_of_pallets']))  # noqa: E501
        if 'page_size' in params:
            query_params.append(('PageSize', params['page_size']))  # noqa: E501
        if 'page_start_index' in params:
            query_params.append(('PageStartIndex', params['page_start_index']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/fba/inbound/v0/shipments/{shipmentId}/labels', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetLabelsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats, api_models_module=self.api_models_module)

    def get_prep_instructions(self, ship_to_country_code, **kwargs):  # noqa: E501
        """get_prep_instructions  # noqa: E501

        Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's fulfillment network.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_prep_instructions(ship_to_country_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ship_to_country_code: The country code of the country to which the items will be shipped. Note that labeling requirements and item preparation instructions can vary by country. (required)
        :param List[str] seller_sku_list: A list of SellerSKU values. Used to identify items for which you want labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API.  Note: Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the InvalidSKUList property in the response.
        :param List[str] asin_list: A list of ASIN values. Used to identify items for which you want item preparation instructions to help with item sourcing decisions.  Note: ASINs must be included in the product catalog for at least one of the marketplaces that the seller  participates in. Any ASIN that is not included in the product catalog for at least one of the marketplaces that the seller participates in is returned in the InvalidASINList property in the response. You can find out which marketplaces a seller participates in by calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers.
        :return: GetPrepInstructionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_prep_instructions_with_http_info(ship_to_country_code, **kwargs)  # noqa: E501
        else:
            (data) = self.get_prep_instructions_with_http_info(ship_to_country_code, **kwargs)  # noqa: E501
            return data

    def get_prep_instructions_with_http_info(self, ship_to_country_code, **kwargs):  # noqa: E501
        """get_prep_instructions  # noqa: E501

        Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's fulfillment network.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_prep_instructions_with_http_info(ship_to_country_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ship_to_country_code: The country code of the country to which the items will be shipped. Note that labeling requirements and item preparation instructions can vary by country. (required)
        :param List[str] seller_sku_list: A list of SellerSKU values. Used to identify items for which you want labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API.  Note: Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the InvalidSKUList property in the response.
        :param List[str] asin_list: A list of ASIN values. Used to identify items for which you want item preparation instructions to help with item sourcing decisions.  Note: ASINs must be included in the product catalog for at least one of the marketplaces that the seller  participates in. Any ASIN that is not included in the product catalog for at least one of the marketplaces that the seller participates in is returned in the InvalidASINList property in the response. You can find out which marketplaces a seller participates in by calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers.
        :return: GetPrepInstructionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['ship_to_country_code', 'seller_sku_list', 'asin_list']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_prep_instructions" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'ship_to_country_code' is set
        if self.api_client.client_side_validation and ('ship_to_country_code' not in params or
                                                       params['ship_to_country_code'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `ship_to_country_code` when calling `get_prep_instructions`")  # noqa: E501

        if self.api_client.client_side_validation and ('seller_sku_list' in params and
                                            len(params['seller_sku_list']) > 50):
            raise ValueError("Invalid value for parameter `seller_sku_list` when calling `get_prep_instructions`, number of items must be less than or equal to `50`")  # noqa: E501
        if self.api_client.client_side_validation and ('asin_list' in params and
                                            len(params['asin_list']) > 50):
            raise ValueError("Invalid value for parameter `asin_list` when calling `get_prep_instructions`, number of items must be less than or equal to `50`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'ship_to_country_code' in params:
            query_params.append(('ShipToCountryCode', params['ship_to_country_code']))  # noqa: E501
        if 'seller_sku_list' in params:
            query_params.append(('SellerSKUList', params['seller_sku_list']))  # noqa: E501
            collection_formats['SellerSKUList'] = 'csv'  # noqa: E501
        if 'asin_list' in params:
            query_params.append(('ASINList', params['asin_list']))  # noqa: E501
            collection_formats['ASINList'] = 'csv'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/fba/inbound/v0/prepInstructions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPrepInstructionsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats, api_models_module=self.api_models_module)

    def get_shipment_items(self, query_type, marketplace_id, **kwargs):  # noqa: E501
        """get_shipment_items  # noqa: E501

        Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified time frame.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_shipment_items(query_type, marketplace_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str query_type: Indicates whether items are returned using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items specified in a previous request. (required)
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace where the product would be stored. (required)
        :param datetime last_updated_after: A date used for selecting inbound shipment items that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param datetime last_updated_before: A date used for selecting inbound shipment items that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param str next_token: A string token returned in the response to your previous request.
        :return: GetShipmentItemsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_shipment_items_with_http_info(query_type, marketplace_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_shipment_items_with_http_info(query_type, marketplace_id, **kwargs)  # noqa: E501
            return data

    def get_shipment_items_with_http_info(self, query_type, marketplace_id, **kwargs):  # noqa: E501
        """get_shipment_items  # noqa: E501

        Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified time frame.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_shipment_items_with_http_info(query_type, marketplace_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str query_type: Indicates whether items are returned using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items specified in a previous request. (required)
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace where the product would be stored. (required)
        :param datetime last_updated_after: A date used for selecting inbound shipment items that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param datetime last_updated_before: A date used for selecting inbound shipment items that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param str next_token: A string token returned in the response to your previous request.
        :return: GetShipmentItemsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['query_type', 'marketplace_id', 'last_updated_after', 'last_updated_before', 'next_token']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_shipment_items" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'query_type' is set
        if self.api_client.client_side_validation and ('query_type' not in params or
                                                       params['query_type'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `query_type` when calling `get_shipment_items`")  # noqa: E501
        # verify the required parameter 'marketplace_id' is set
        if self.api_client.client_side_validation and ('marketplace_id' not in params or
                                                       params['marketplace_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `marketplace_id` when calling `get_shipment_items`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'last_updated_after' in params:
            query_params.append(('LastUpdatedAfter', params['last_updated_after']))  # noqa: E501
        if 'last_updated_before' in params:
            query_params.append(('LastUpdatedBefore', params['last_updated_before']))  # noqa: E501
        if 'query_type' in params:
            query_params.append(('QueryType', params['query_type']))  # noqa: E501
        if 'next_token' in params:
            query_params.append(('NextToken', params['next_token']))  # noqa: E501
        if 'marketplace_id' in params:
            query_params.append(('MarketplaceId', params['marketplace_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/fba/inbound/v0/shipmentItems', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetShipmentItemsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats, api_models_module=self.api_models_module)

    def get_shipment_items_by_shipment_id(self, shipment_id, **kwargs):  # noqa: E501
        """get_shipment_items_by_shipment_id  # noqa: E501

        Returns a list of items in a specified inbound shipment.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_shipment_items_by_shipment_id(shipment_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str shipment_id: A shipment identifier used for selecting items in a specific inbound shipment. (required)
        :param str marketplace_id: Deprecated. Do not use.
        :return: GetShipmentItemsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_shipment_items_by_shipment_id_with_http_info(shipment_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_shipment_items_by_shipment_id_with_http_info(shipment_id, **kwargs)  # noqa: E501
            return data

    def get_shipment_items_by_shipment_id_with_http_info(self, shipment_id, **kwargs):  # noqa: E501
        """get_shipment_items_by_shipment_id  # noqa: E501

        Returns a list of items in a specified inbound shipment.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_shipment_items_by_shipment_id_with_http_info(shipment_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str shipment_id: A shipment identifier used for selecting items in a specific inbound shipment. (required)
        :param str marketplace_id: Deprecated. Do not use.
        :return: GetShipmentItemsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['shipment_id', 'marketplace_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_shipment_items_by_shipment_id" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'shipment_id' is set
        if self.api_client.client_side_validation and ('shipment_id' not in params or
                                                       params['shipment_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `shipment_id` when calling `get_shipment_items_by_shipment_id`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'shipment_id' in params:
            path_params['shipmentId'] = params['shipment_id']  # noqa: E501

        query_params = []
        if 'marketplace_id' in params:
            query_params.append(('MarketplaceId', params['marketplace_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/fba/inbound/v0/shipments/{shipmentId}/items', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetShipmentItemsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats, api_models_module=self.api_models_module)

    def get_shipments(self, query_type, marketplace_id, **kwargs):  # noqa: E501
        """get_shipments  # noqa: E501

        Returns a list of inbound shipments based on criteria that you specify.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_shipments(query_type, marketplace_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str query_type: Indicates whether shipments are returned using shipment information (by providing the ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous request. (required)
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace where the product would be stored. (required)
        :param List[str] shipment_status_list: A list of ShipmentStatus values. Used to select shipments with a current status that matches the status values that you specify.
        :param List[str] shipment_id_list: A list of shipment IDs used to select the shipments that you want. If both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are returned.
        :param datetime last_updated_after: A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param datetime last_updated_before: A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param str next_token: A string token returned in the response to your previous request.
        :return: GetShipmentsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_shipments_with_http_info(query_type, marketplace_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_shipments_with_http_info(query_type, marketplace_id, **kwargs)  # noqa: E501
            return data

    def get_shipments_with_http_info(self, query_type, marketplace_id, **kwargs):  # noqa: E501
        """get_shipments  # noqa: E501

        Returns a list of inbound shipments based on criteria that you specify.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 30 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_shipments_with_http_info(query_type, marketplace_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str query_type: Indicates whether shipments are returned using shipment information (by providing the ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous request. (required)
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace where the product would be stored. (required)
        :param List[str] shipment_status_list: A list of ShipmentStatus values. Used to select shipments with a current status that matches the status values that you specify.
        :param List[str] shipment_id_list: A list of shipment IDs used to select the shipments that you want. If both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are returned.
        :param datetime last_updated_after: A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param datetime last_updated_before: A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
        :param str next_token: A string token returned in the response to your previous request.
        :return: GetShipmentsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['query_type', 'marketplace_id', 'shipment_status_list', 'shipment_id_list', 'last_updated_after', 'last_updated_before', 'next_token']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_shipments" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'query_type' is set
        if self.api_client.client_side_validation and ('query_type' not in params or
                                                       params['query_type'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `query_type` when calling `get_shipments`")  # noqa: E501
        # verify the required parameter 'marketplace_id' is set
        if self.api_client.client_side_validation and ('marketplace_id' not in params or
                                                       params['marketplace_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `marketplace_id` when calling `get_shipments`")  # noqa: E501

        if self.api_client.client_side_validation and ('shipment_id_list' in params and
                                            len(params['shipment_id_list']) > 999):
            raise ValueError("Invalid value for parameter `shipment_id_list` when calling `get_shipments`, number of items must be less than or equal to `999`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'shipment_status_list' in params:
            query_params.append(('ShipmentStatusList', params['shipment_status_list']))  # noqa: E501
            collection_formats['ShipmentStatusList'] = 'csv'  # noqa: E501
        if 'shipment_id_list' in params:
            query_params.append(('ShipmentIdList', params['shipment_id_list']))  # noqa: E501
            collection_formats['ShipmentIdList'] = 'csv'  # noqa: E501
        if 'last_updated_after' in params:
            query_params.append(('LastUpdatedAfter', params['last_updated_after']))  # noqa: E501
        if 'last_updated_before' in params:
            query_params.append(('LastUpdatedBefore', params['last_updated_before']))  # noqa: E501
        if 'query_type' in params:
            query_params.append(('QueryType', params['query_type']))  # noqa: E501
        if 'next_token' in params:
            query_params.append(('NextToken', params['next_token']))  # noqa: E501
        if 'marketplace_id' in params:
            query_params.append(('MarketplaceId', params['marketplace_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/fba/inbound/v0/shipments', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetShipmentsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats, api_models_module=self.api_models_module)
