# coding: utf-8

"""
    Selling Partner API for Retail Procurement Orders

    The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.

    The version of the OpenAPI document: v1
    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 VendorOrdersApi(object):
    """NOTE: This class is auto generated by the openapi generator.

    Do not edit the class manually.
    """

    api_models_module = "spapi.models.vendor_orders_v1"

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

    def get_purchase_order(self, purchase_order_number, **kwargs):  # noqa: E501
        """get_purchase_order  # noqa: E501

        Returns a purchase order based on the `purchaseOrderNumber` value that you specify.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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_purchase_order(purchase_order_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str purchase_order_number: The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code. (required)
        :return: GetPurchaseOrderResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_purchase_order_with_http_info(purchase_order_number, **kwargs)  # noqa: E501
        else:
            (data) = self.get_purchase_order_with_http_info(purchase_order_number, **kwargs)  # noqa: E501
            return data

    def get_purchase_order_with_http_info(self, purchase_order_number, **kwargs):  # noqa: E501
        """get_purchase_order  # noqa: E501

        Returns a purchase order based on the `purchaseOrderNumber` value that you specify.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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_purchase_order_with_http_info(purchase_order_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str purchase_order_number: The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code. (required)
        :return: GetPurchaseOrderResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['purchase_order_number']  # 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_purchase_order" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'purchase_order_number' is set
        if self.api_client.client_side_validation and ('purchase_order_number' not in params or
                                                       params['purchase_order_number'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `purchase_order_number` when calling `get_purchase_order`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'purchase_order_number' in params:
            path_params['purchaseOrderNumber'] = params['purchase_order_number']  # 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(
            '/vendor/orders/v1/purchaseOrders/{purchaseOrderNumber}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPurchaseOrderResponse',  # 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_purchase_orders(self, **kwargs):  # noqa: E501
        """get_purchase_orders  # noqa: E501

        Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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_purchase_orders(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int limit: The limit to the number of records returned. Default value is 100 records.
        :param datetime created_after: Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime created_before: Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format.
        :param str sort_order: Sort in ascending or descending order by purchase order creation date.
        :param str next_token: Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call
        :param bool include_details: When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true.
        :param datetime changed_after: Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime changed_before: Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param str po_item_state: Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero.
        :param bool is_po_changed: When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false.
        :param str purchase_order_state: Filters purchase orders based on the purchase order state.
        :param str ordering_vendor_code: Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned.
        :return: GetPurchaseOrdersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_purchase_orders_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_purchase_orders_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_purchase_orders_with_http_info(self, **kwargs):  # noqa: E501
        """get_purchase_orders  # noqa: E501

        Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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_purchase_orders_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int limit: The limit to the number of records returned. Default value is 100 records.
        :param datetime created_after: Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime created_before: Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format.
        :param str sort_order: Sort in ascending or descending order by purchase order creation date.
        :param str next_token: Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call
        :param bool include_details: When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true.
        :param datetime changed_after: Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime changed_before: Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param str po_item_state: Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero.
        :param bool is_po_changed: When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false.
        :param str purchase_order_state: Filters purchase orders based on the purchase order state.
        :param str ordering_vendor_code: Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned.
        :return: GetPurchaseOrdersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['limit', 'created_after', 'created_before', 'sort_order', 'next_token', 'include_details', 'changed_after', 'changed_before', 'po_item_state', 'is_po_changed', 'purchase_order_state', 'ordering_vendor_code']  # 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_purchase_orders" % key
                )
            params[key] = val
        del params['kwargs']

        if self.api_client.client_side_validation and ('limit' in params and params['limit'] > 100):  # noqa: E501
            raise ValueError("Invalid value for parameter `limit` when calling `get_purchase_orders`, must be a value less than or equal to `100`")  # noqa: E501
        if self.api_client.client_side_validation and ('limit' in params and params['limit'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `limit` when calling `get_purchase_orders`, must be a value greater than or equal to `1`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'created_after' in params:
            query_params.append(('createdAfter', params['created_after']))  # noqa: E501
        if 'created_before' in params:
            query_params.append(('createdBefore', params['created_before']))  # noqa: E501
        if 'sort_order' in params:
            query_params.append(('sortOrder', params['sort_order']))  # noqa: E501
        if 'next_token' in params:
            query_params.append(('nextToken', params['next_token']))  # noqa: E501
        if 'include_details' in params:
            query_params.append(('includeDetails', params['include_details']))  # noqa: E501
        if 'changed_after' in params:
            query_params.append(('changedAfter', params['changed_after']))  # noqa: E501
        if 'changed_before' in params:
            query_params.append(('changedBefore', params['changed_before']))  # noqa: E501
        if 'po_item_state' in params:
            query_params.append(('poItemState', params['po_item_state']))  # noqa: E501
        if 'is_po_changed' in params:
            query_params.append(('isPOChanged', params['is_po_changed']))  # noqa: E501
        if 'purchase_order_state' in params:
            query_params.append(('purchaseOrderState', params['purchase_order_state']))  # noqa: E501
        if 'ordering_vendor_code' in params:
            query_params.append(('orderingVendorCode', params['ordering_vendor_code']))  # 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', 'payload'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/vendor/orders/v1/purchaseOrders', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPurchaseOrdersResponse',  # 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_purchase_orders_status(self, **kwargs):  # noqa: E501
        """get_purchase_orders_status  # noqa: E501

        Returns purchase order statuses based on the filters that you specify. Date range to search must not be more than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase order status by providing the purchase order number.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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_purchase_orders_status(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int limit: The limit to the number of records returned. Default value is 100 records.
        :param str sort_order: Sort in ascending or descending order by purchase order creation date.
        :param str next_token: Used for pagination when there are more purchase orders than the specified result size limit.
        :param datetime created_after: Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime created_before: Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime updated_after: Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime updated_before: Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param str purchase_order_number: Provides purchase order status for the specified purchase order number.
        :param str purchase_order_status: Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
        :param str item_confirmation_status: Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included.
        :param str item_receive_status: Filters purchase orders based on the purchase order's item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included.
        :param str ordering_vendor_code: Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
        :param str ship_to_party_id: Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor group purchase orders.
        :return: GetPurchaseOrdersStatusResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_purchase_orders_status_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_purchase_orders_status_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_purchase_orders_status_with_http_info(self, **kwargs):  # noqa: E501
        """get_purchase_orders_status  # noqa: E501

        Returns purchase order statuses based on the filters that you specify. Date range to search must not be more than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase order status by providing the purchase order number.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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_purchase_orders_status_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int limit: The limit to the number of records returned. Default value is 100 records.
        :param str sort_order: Sort in ascending or descending order by purchase order creation date.
        :param str next_token: Used for pagination when there are more purchase orders than the specified result size limit.
        :param datetime created_after: Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime created_before: Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime updated_after: Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param datetime updated_before: Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
        :param str purchase_order_number: Provides purchase order status for the specified purchase order number.
        :param str purchase_order_status: Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
        :param str item_confirmation_status: Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included.
        :param str item_receive_status: Filters purchase orders based on the purchase order's item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included.
        :param str ordering_vendor_code: Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
        :param str ship_to_party_id: Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor group purchase orders.
        :return: GetPurchaseOrdersStatusResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['limit', 'sort_order', 'next_token', 'created_after', 'created_before', 'updated_after', 'updated_before', 'purchase_order_number', 'purchase_order_status', 'item_confirmation_status', 'item_receive_status', 'ordering_vendor_code', 'ship_to_party_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_purchase_orders_status" % key
                )
            params[key] = val
        del params['kwargs']

        if self.api_client.client_side_validation and ('limit' in params and params['limit'] > 100):  # noqa: E501
            raise ValueError("Invalid value for parameter `limit` when calling `get_purchase_orders_status`, must be a value less than or equal to `100`")  # noqa: E501
        if self.api_client.client_side_validation and ('limit' in params and params['limit'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `limit` when calling `get_purchase_orders_status`, must be a value greater than or equal to `1`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'sort_order' in params:
            query_params.append(('sortOrder', params['sort_order']))  # noqa: E501
        if 'next_token' in params:
            query_params.append(('nextToken', params['next_token']))  # noqa: E501
        if 'created_after' in params:
            query_params.append(('createdAfter', params['created_after']))  # noqa: E501
        if 'created_before' in params:
            query_params.append(('createdBefore', params['created_before']))  # noqa: E501
        if 'updated_after' in params:
            query_params.append(('updatedAfter', params['updated_after']))  # noqa: E501
        if 'updated_before' in params:
            query_params.append(('updatedBefore', params['updated_before']))  # noqa: E501
        if 'purchase_order_number' in params:
            query_params.append(('purchaseOrderNumber', params['purchase_order_number']))  # noqa: E501
        if 'purchase_order_status' in params:
            query_params.append(('purchaseOrderStatus', params['purchase_order_status']))  # noqa: E501
        if 'item_confirmation_status' in params:
            query_params.append(('itemConfirmationStatus', params['item_confirmation_status']))  # noqa: E501
        if 'item_receive_status' in params:
            query_params.append(('itemReceiveStatus', params['item_receive_status']))  # noqa: E501
        if 'ordering_vendor_code' in params:
            query_params.append(('orderingVendorCode', params['ordering_vendor_code']))  # noqa: E501
        if 'ship_to_party_id' in params:
            query_params.append(('shipToPartyId', params['ship_to_party_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(
            '/vendor/orders/v1/purchaseOrdersStatus', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPurchaseOrdersStatusResponse',  # 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 submit_acknowledgement(self, body, **kwargs):  # noqa: E501
        """submit_acknowledgement  # noqa: E501

        Submits acknowledgements for one or more purchase orders.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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.submit_acknowledgement(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SubmitAcknowledgementRequest body: Submits acknowledgements for one or more purchase orders from a vendor. (required)
        :return: SubmitAcknowledgementResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.submit_acknowledgement_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.submit_acknowledgement_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def submit_acknowledgement_with_http_info(self, body, **kwargs):  # noqa: E501
        """submit_acknowledgement  # noqa: E501

        Submits acknowledgements for one or more purchase orders.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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.submit_acknowledgement_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SubmitAcknowledgementRequest body: Submits acknowledgements for one or more purchase orders from a vendor. (required)
        :return: SubmitAcknowledgementResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # 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 submit_acknowledgement" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if self.api_client.client_side_validation and ('body' not in params or
                                                       params['body'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `body` when calling `submit_acknowledgement`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/vendor/orders/v1/acknowledgements', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubmitAcknowledgementResponse',  # 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)
