# coding: utf-8

"""
    Selling Partner API for Pricing

    The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products.

    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 ProductPricingApi(object):
    """NOTE: This class is auto generated by the openapi generator.

    Do not edit the class manually.
    """

    api_models_module = "spapi.models.product_pricing_v0"

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

    def get_competitive_pricing(self, marketplace_id, item_type, **kwargs):  # noqa: E501
        """get_competitive_pricing  # noqa: E501

        Returns competitive pricing information for a seller's offer listings based on seller SKU or ASIN.  **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_competitive_pricing(marketplace_id, item_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_type: Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. Possible values: Asin, Sku. (required)
        :param List[str] asins: A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace.
        :param List[str] skus: A list of up to twenty seller SKU values used to identify items in the given marketplace.
        :param str customer_type: Indicates whether to request pricing information from the point of view of Consumer or Business buyers. Default is Consumer.
        :return: GetPricingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_competitive_pricing_with_http_info(marketplace_id, item_type, **kwargs)  # noqa: E501
        else:
            (data) = self.get_competitive_pricing_with_http_info(marketplace_id, item_type, **kwargs)  # noqa: E501
            return data

    def get_competitive_pricing_with_http_info(self, marketplace_id, item_type, **kwargs):  # noqa: E501
        """get_competitive_pricing  # noqa: E501

        Returns competitive pricing information for a seller's offer listings based on seller SKU or ASIN.  **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_competitive_pricing_with_http_info(marketplace_id, item_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_type: Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. Possible values: Asin, Sku. (required)
        :param List[str] asins: A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace.
        :param List[str] skus: A list of up to twenty seller SKU values used to identify items in the given marketplace.
        :param str customer_type: Indicates whether to request pricing information from the point of view of Consumer or Business buyers. Default is Consumer.
        :return: GetPricingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        path_params = {}

        query_params = []
        if 'marketplace_id' in params:
            query_params.append(('MarketplaceId', params['marketplace_id']))  # noqa: E501
        if 'asins' in params:
            query_params.append(('Asins', params['asins']))  # noqa: E501
            collection_formats['Asins'] = 'csv'  # noqa: E501
        if 'skus' in params:
            query_params.append(('Skus', params['skus']))  # noqa: E501
            collection_formats['Skus'] = 'csv'  # noqa: E501
        if 'item_type' in params:
            query_params.append(('ItemType', params['item_type']))  # noqa: E501
        if 'customer_type' in params:
            query_params.append(('CustomerType', params['customer_type']))  # 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(
            '/products/pricing/v0/competitivePrice', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPricingResponse',  # 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_item_offers(self, marketplace_id, item_condition, asin, **kwargs):  # noqa: E501
        """get_item_offers  # noqa: E501

        Returns the lowest priced offers for a single item based on ASIN.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_item_offers(marketplace_id, item_condition, asin, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_condition: Filters the offer listings to be considered based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. (required)
        :param str asin: The Amazon Standard Identification Number (ASIN) of the item. (required)
        :param str customer_type: Indicates whether to request Consumer or Business offers. Default is Consumer.
        :return: GetOffersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_item_offers_with_http_info(marketplace_id, item_condition, asin, **kwargs)  # noqa: E501
        else:
            (data) = self.get_item_offers_with_http_info(marketplace_id, item_condition, asin, **kwargs)  # noqa: E501
            return data

    def get_item_offers_with_http_info(self, marketplace_id, item_condition, asin, **kwargs):  # noqa: E501
        """get_item_offers  # noqa: E501

        Returns the lowest priced offers for a single item based on ASIN.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_item_offers_with_http_info(marketplace_id, item_condition, asin, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_condition: Filters the offer listings to be considered based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. (required)
        :param str asin: The Amazon Standard Identification Number (ASIN) of the item. (required)
        :param str customer_type: Indicates whether to request Consumer or Business offers. Default is Consumer.
        :return: GetOffersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'asin' in params:
            path_params['Asin'] = params['asin']  # noqa: E501

        query_params = []
        if 'marketplace_id' in params:
            query_params.append(('MarketplaceId', params['marketplace_id']))  # noqa: E501
        if 'item_condition' in params:
            query_params.append(('ItemCondition', params['item_condition']))  # noqa: E501
        if 'customer_type' in params:
            query_params.append(('CustomerType', params['customer_type']))  # 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(
            '/products/pricing/v0/items/{Asin}/offers', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetOffersResponse',  # 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_item_offers_batch(self, get_item_offers_batch_request_body, **kwargs):  # noqa: E501
        """get_item_offers_batch  # noqa: E501

        Returns the lowest priced offers for a batch of items based on ASIN.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 1 |  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_item_offers_batch(get_item_offers_batch_request_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GetItemOffersBatchRequest get_item_offers_batch_request_body: The request associated with the `getItemOffersBatch` API call. (required)
        :return: GetItemOffersBatchResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_item_offers_batch_with_http_info(get_item_offers_batch_request_body, **kwargs)  # noqa: E501
        else:
            (data) = self.get_item_offers_batch_with_http_info(get_item_offers_batch_request_body, **kwargs)  # noqa: E501
            return data

    def get_item_offers_batch_with_http_info(self, get_item_offers_batch_request_body, **kwargs):  # noqa: E501
        """get_item_offers_batch  # noqa: E501

        Returns the lowest priced offers for a batch of items based on ASIN.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 1 |  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_item_offers_batch_with_http_info(get_item_offers_batch_request_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GetItemOffersBatchRequest get_item_offers_batch_request_body: The request associated with the `getItemOffersBatch` API call. (required)
        :return: GetItemOffersBatchResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'get_item_offers_batch_request_body' in params:
            body_params = params['get_item_offers_batch_request_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(
            '/batches/products/pricing/v0/itemOffers', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetItemOffersBatchResponse',  # 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_listing_offers(self, marketplace_id, item_condition, seller_sku, **kwargs):  # noqa: E501
        """get_listing_offers  # noqa: E501

        Returns the lowest priced offers for a single SKU listing.  **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 |  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](doc: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_listing_offers(marketplace_id, item_condition, seller_sku, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_condition: Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. (required)
        :param str seller_sku: Identifies an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. (required)
        :param str customer_type: Indicates whether to request Consumer or Business offers. Default is Consumer.
        :return: GetOffersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_listing_offers_with_http_info(marketplace_id, item_condition, seller_sku, **kwargs)  # noqa: E501
        else:
            (data) = self.get_listing_offers_with_http_info(marketplace_id, item_condition, seller_sku, **kwargs)  # noqa: E501
            return data

    def get_listing_offers_with_http_info(self, marketplace_id, item_condition, seller_sku, **kwargs):  # noqa: E501
        """get_listing_offers  # noqa: E501

        Returns the lowest priced offers for a single SKU listing.  **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 |  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](doc: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_listing_offers_with_http_info(marketplace_id, item_condition, seller_sku, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_condition: Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club. (required)
        :param str seller_sku: Identifies an item in the given marketplace. SellerSKU is qualified by the seller's SellerId, which is included with every operation that you submit. (required)
        :param str customer_type: Indicates whether to request Consumer or Business offers. Default is Consumer.
        :return: GetOffersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'seller_sku' in params:
            path_params['SellerSKU'] = params['seller_sku']  # noqa: E501

        query_params = []
        if 'marketplace_id' in params:
            query_params.append(('MarketplaceId', params['marketplace_id']))  # noqa: E501
        if 'item_condition' in params:
            query_params.append(('ItemCondition', params['item_condition']))  # noqa: E501
        if 'customer_type' in params:
            query_params.append(('CustomerType', params['customer_type']))  # 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(
            '/products/pricing/v0/listings/{SellerSKU}/offers', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetOffersResponse',  # 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_listing_offers_batch(self, get_listing_offers_batch_request_body, **kwargs):  # noqa: E501
        """get_listing_offers_batch  # noqa: E501

        Returns the lowest priced offers for a batch of listings by SKU.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_listing_offers_batch(get_listing_offers_batch_request_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GetListingOffersBatchRequest get_listing_offers_batch_request_body: The request associated with the `getListingOffersBatch` API call. (required)
        :return: GetListingOffersBatchResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_listing_offers_batch_with_http_info(get_listing_offers_batch_request_body, **kwargs)  # noqa: E501
        else:
            (data) = self.get_listing_offers_batch_with_http_info(get_listing_offers_batch_request_body, **kwargs)  # noqa: E501
            return data

    def get_listing_offers_batch_with_http_info(self, get_listing_offers_batch_request_body, **kwargs):  # noqa: E501
        """get_listing_offers_batch  # noqa: E501

        Returns the lowest priced offers for a batch of listings by SKU.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_listing_offers_batch_with_http_info(get_listing_offers_batch_request_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GetListingOffersBatchRequest get_listing_offers_batch_request_body: The request associated with the `getListingOffersBatch` API call. (required)
        :return: GetListingOffersBatchResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'get_listing_offers_batch_request_body' in params:
            body_params = params['get_listing_offers_batch_request_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(
            '/batches/products/pricing/v0/listingOffers', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetListingOffersBatchResponse',  # 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_pricing(self, marketplace_id, item_type, **kwargs):  # noqa: E501
        """get_pricing  # noqa: E501

        Returns pricing information for a seller's offer listings based on seller SKU or ASIN.  **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_pricing(marketplace_id, item_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_type: Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. (required)
        :param List[str] asins: A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace.
        :param List[str] skus: A list of up to twenty seller SKU values used to identify items in the given marketplace.
        :param str item_condition: Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club.
        :param str offer_type: Indicates whether to request pricing information for the seller's B2C or B2B offers. Default is B2C.
        :return: GetPricingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pricing_with_http_info(marketplace_id, item_type, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pricing_with_http_info(marketplace_id, item_type, **kwargs)  # noqa: E501
            return data

    def get_pricing_with_http_info(self, marketplace_id, item_type, **kwargs):  # noqa: E501
        """get_pricing  # noqa: E501

        Returns pricing information for a seller's offer listings based on seller SKU or ASIN.  **Note:** The parameters associated with this operation may contain special characters that require URL encoding to call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 |  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](doc: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_pricing_with_http_info(marketplace_id, item_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: A marketplace identifier. Specifies the marketplace for which prices are returned. (required)
        :param str item_type: Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter. (required)
        :param List[str] asins: A list of up to twenty Amazon Standard Identification Number (ASIN) values used to identify items in the given marketplace.
        :param List[str] skus: A list of up to twenty seller SKU values used to identify items in the given marketplace.
        :param str item_condition: Filters the offer listings based on item condition. Possible values: New, Used, Collectible, Refurbished, Club.
        :param str offer_type: Indicates whether to request pricing information for the seller's B2C or B2B offers. Default is B2C.
        :return: GetPricingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        path_params = {}

        query_params = []
        if 'marketplace_id' in params:
            query_params.append(('MarketplaceId', params['marketplace_id']))  # noqa: E501
        if 'asins' in params:
            query_params.append(('Asins', params['asins']))  # noqa: E501
            collection_formats['Asins'] = 'csv'  # noqa: E501
        if 'skus' in params:
            query_params.append(('Skus', params['skus']))  # noqa: E501
            collection_formats['Skus'] = 'csv'  # noqa: E501
        if 'item_type' in params:
            query_params.append(('ItemType', params['item_type']))  # noqa: E501
        if 'item_condition' in params:
            query_params.append(('ItemCondition', params['item_condition']))  # noqa: E501
        if 'offer_type' in params:
            query_params.append(('OfferType', params['offer_type']))  # 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(
            '/products/pricing/v0/price', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPricingResponse',  # 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)
