# coding: utf-8

"""
    Browse API

    The Browse API has the following resources:<ul><li><b>item_summary:</b><br>Allows shoppers to search for specific items by keyword, GTIN, category, charity, product, image, or item aspects and refine the results by using filters, such as aspects, compatibility, and fields values, or UI parameters.</li><li><b>item:</b><br>Allows shoppers to retrieve the details of a specific item or all items in an item group, which is an item with variations such as color and size and check if a product is compatible with the specified item, such as if a specific car is compatible with a specific part.<br><br>This resource also provides a bridge between the eBay legacy APIs, such as the <a href=\"/api-docs/user-guides/static/finding-user-guide-landing.html\" target=\"_blank\">Finding</b>, and the RESTful APIs, which use different formats for the item IDs.</li></ul>The <b>item_summary</b>, <b>search_by_image</b>, and <b>item</b> resource calls require an <a href=\"/api-docs/static/oauth-client-credentials-grant.html\" target=\"_blank\">Application access token</a>.  # noqa: E501

    OpenAPI spec version: v1.19.9
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from ...buy_browse.api_client import ApiClient


class ItemSummaryApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

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

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

        This method searches for eBay items by various query parameters and retrieves summaries of the items. You can search by keyword, category, eBay product ID (ePID), or GTIN, charity ID, or a combination of these.<br><br><span class=\"tablenote\"><b>Note:</b> Only listings where <code>FIXED_PRICE</code> (Buy It Now) is a buying option are returned by default. To retrieve listings that do not have <code>FIXED_PRICE</code> as a buying option, the <code>buyingOptions</code> filter can be used to retrieve those listings.<br><br>Note that an auction listing enabled with the <i>Buy it Now</i> feature will initially show <code>AUCTION</code> and <code>FIXED_PRICE</code> as buying options, but if/when that auction listing receives a qualifying bid, only <code>AUCTION</code> remains as a buying option. If this happens, the <code>buyingOptions</code> filter would need to be used to retrieve that auction listing.</span><br>This method also supports the following:<ul><li>Filtering by the value of one or multiple fields, such as listing format, item condition, price range, location, and more. For the fields supported by this method, refer to the <a href=\"#uri.filter\">filter</a> parameter.</li><li>Retrieving the refinements (metadata) of an item, such as item aspects (color, brand) condition, category, etc. using the <a href=\"#uri.fieldgroups\">fieldgroups</a> parameter.</li><li>Filtering by item aspects and other refinements using the <a href=\"#uri.aspect_filter\">aspect_filter</a> parameter.</li><li>Filtering for items that are compatible with a specific product, using the <a href=\"#uri.compatibility_filter\">compatibility_filter</a> parameter.</li><li>Creating aspects histograms, which enables shoppers to drill down in each refinement narrowing the search results.</li></ul>For additional information and examples of these capabilities, refer to <a href=\"/api-docs/buy/static/api-browse.html\" target=\"_blank\">Browse API</a> in the Buying Integration Guide.</br><h3>Pagination and sort controls</h3>There are pagination controls (<b>limit</b> and <b>offset</b> fields) and <b>sort</b> query parameters that control/sort the data that are returned. By default, results are sorted by <i>Best Match</i>. For more information about Best Match, refer to <a href=\"https://pages.ebay.com/help/sell/searchstanding.html \" target=\"_blank\">Best Match</a>.</br><h3>Restrictions</h3>This method can return a maximum of 10,000 items. For a list of supported sites and other restrictions, refer to <a href=\"/api-docs/buy/browse/overview.html#API\">API Restrictions</a>.<br><br><span class=\"tablenote\"><b>eBay Partner Network:</b> In order to receive a commission for your sales, you must use the URL returned in the <code>itemAffiliateWebUrl</code> field to forward your buyer to the ebay.com site.</span>  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str aspect_filter: This field lets you filter by item aspects. The aspect name/value pairs and category, which is required, is used to limit the results to specific aspects of the item. For example, in a clothing category one aspect pair would be Color/Red.<br><br><span class=\"tablenote\"><b>Note:</b> The category ID must be specified <i>twice</i>:<ul><li>Once as a URI parameter in the <code>category_ids</code> field</li><li>Once as part of the <code>aspect_filter</code> field</li></ul>These two values <b>must</b> be the same.</span><br>For example, to return items for a woman's red shirt, issue the following request:<br><pre>/buy/browse/v1/item_summary/search?q=shirt&category_ids=15724&aspect_filter=categoryId:15724,Color:{Red}</pre>To get a list of the aspect pairs and the category, which is returned in the <code>dominantCategoryId</code> field, set <code>fieldgroups</code> to <code>ASPECT_REFINEMENTS</code> as illustrated here:<pre>/buy/browse/v1/item_summary/search?q=shirt&amp;fieldgroups=ASPECT_REFINEMENTS</pre><span class=\"tablenote\"><b> Note:</b> The pipe symbol is used as a delimiter between aspect filter values. If a value contains a pipe symbol (for example, the brand name 'Bed|Stü'), you must enter a backslash before the pipe character to prevent it from being evaluated as a delimiter.<br><br>The following example illustrates the correct format for entering two brand names as aspect filter values, one of which contains a pipe symbol:<pre>/buy/browse/v1/item_summary/search?limit=50&category_ids=3034&filter=buyingOptions:{AUCTION|FIXED_PRICE}&aspect_filter=categoryId:3034,Brand:{Bed&bsol;|Stü|Nike}</pre></span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/gct:AspectFilter
        :param str auto_correct: A query parameter that enables auto correction.<br><br>A sample is shown below:<pre>/buy/browse/v1/item_summary/search?auto_correct=KEYWORD</pre><span class=\"tablenote\"><b>Note:</b> Auto correction is currently supported in the following marketplaces:<ul><li>United States</li><li>Austria</li><li>Australia</li><li>Canada</li><li>Switzerland</li><li>Germany</li><li>Spain</li><li>France</li><li>United Kingdom</li><li>Ireland</li><li>Italy</li></ul></span><br><b>Valid Values:</b> <code>KEYWORD</code>
        :param str category_ids: <a name=\"category_ids\"></a>The category ID is used to limit the results that are returned. This field may pass in one category ID or a comma separated list of IDs as illustrated in the following examples:<pre>/buy/browse/v1/item_summary/search?category_ids=29792</pre><pre>/buy/browse/v1/item_summary/search?category_ids=267,29792</pre><span class=\"tablenote\"><b>Note:</b> Currently, you can pass in only one category ID per request.</span><br>To refine the set of information that is returned, <code>category_ids</code> may be combined with <b>EITHER</b>:<ul><li><code>epid</code> and/or <code>gtin</code> values</li><li><code>q</code> keywords</li></ul>For example, when looking of a toy phone, simply searching for \"phone\" will return mobile phones because that is the \"Best Match\" for the search. To further refine the request to include toy phones, include the <b>Toys &amp; Hobbies</b> category ID as illustrated here:<pre>/buy/browse/v1/item_summary/search?q=phone&category_ids=220</pre>Because the list of eBay category IDs is not published and category IDs are not the same across all eBay marketplaces, category IDs may be determined by:<ul><li>Visiting the <a href=\"https://pages.ebay.com/sellerinformation/news/categorychanges.html \" target=\"_blank\">Category Changes page</a></li><li>Using the Taxonomy API. Refer to <a href=\"/api-docs/buy/buy-categories.html\" target=\"_blank\">Get Categories for Buy APIs</a> for complete information.</li><li>Issuing the following call to retrieve the <code>dominantCategoryId</code> for an item:<pre>/buy/browse/v1/item_summary/search?q=<i> keyword</i>&fieldgroups=ASPECT_REFINEMENTS</pre></li></ul><span class=\"tablenote\"><b>Note:</b> If a top-level (L1) category is specified, you <b>must</b> also include a <code>q</code> query parameter.</span>
        :param str charity_ids: The charity ID filters results to return only those items associated with the specified charity.<br><br><span class=\"tablenote\"><b>Note:</b> <code>charity_ids</code> is only supported by the US and UK marketplaces.</span><br>Charity ID is a charity's unique identification number:<ul><li>In the US, this is the <b>Employer Identification Number (EIN)</b>.</li><li>In the UK, this is the Charity Registration Number (CRN), commonly called <b>Charity Number</b>.</li></ul><br><code>charity_ids</code> may be retrieved/determined as follows:<ul><li>Search for a supported charity using the Charity API's <a href=\"/api-docs/commerce/charity/resources/charity_org/methods/getCharityOrgs \" target=\"_blank\">getCharityOrgs</a> method.<br><br><div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> The value to be passed in as <code>charity_ids</code> is that returned in the <code>registrationId</code> field.</p></div></li><li>Search for a supported charity by visiting <a href=\"https://charity.ebay.com/search \" target=\"_blank\">Charity Search</a>. Click on the charity's name to display its information. The EIN number is included in the charity's information block at the top of the page.<br><br>For example, the charity ID for <a href=\"https://charity.ebay.com/charity/American-Red-Cross/3843 \" target=\"_blank\">American Red Cross</a>, is <code>530196605</code>.</li></ul>Up to 20 comma-separated <code>charity_ids</code> may be specified in each query. Additionally, <code>charity_ids</code> may be combined with <code>category_ids</code> and/or <code>q</code> keyword values to further filter returned results.<br><br>A sample query using <code>charity_ids</code> is:<br><pre>/buy/browse/v1/item_summary/search?charity_ids=13-1788491,300108469</pre>
        :param str compatibility_filter: This field specifies the attributes used to define a specific product. The service searches for items matching the keyword, or matching the keyword and a product attribute value in the title of the item.<br><br><span class=\"tablenote\"><b>Note:</b> The only products supported are cars, trucks, and motorcycles.</span><br>For example, if the keyword is <code>brakes</code> and <code>compatibility-filter=Year:2018;Make:BMW</code>, the items returned are items with <b>brakes</b>, <b>2018</b>, or <b>BMW</b> in the title.<br><br>The service uses the product attributes to determine whether the item is compatible. The service returns the attributes that are compatible and the <a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.compatibilityMatch\">CompatibilityMatchEnum</a> value that indicates how well the item matches the attributes.<br><br><div class=\"msgbox_tip\"><p class=\"msgbox_tipInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #478415;&quot; class=&quot;mcFormatColor&quot;&gt;Tip: &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #478415;\" class=\"mcFormatColor\">Tip:</span></b></span></span> Refer to the <a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#s0-1-21-6-7-7-6-ReturnItemsthatareCompatiblewiththeKeywordandVehicle-9\" target=\"_blank\">Samples</a> section for a detailed example.</p></div><br><b>Best Practice:</b> Submit all of the <a href=\"/api-docs/buy/static/api-browse.html#product-attributes\" target=\"_blank\">product attributes</a> for the specific product.<br><br>To find the attributes and values for a specific marketplace, use the <a href=\"/api-docs/commerce/taxonomy/resources/category_tree/methods/getCompatibilityProperties\" target=\"_blank\">getCompatibilityProperties</a> method in the <a href=\"/api-docs/commerce/taxonomy/resources/methods\" target=\"_blank\">Taxonomy API</a>.<br><br>For more information, refer to <a href=\"/api-docs/buy/static/api-browse.html#Check\" target=\"_blank\">Check compatibility</a> in the Buying Integration Guide.<br><br><span class=\"tablenote\"><b>Note:</b> Testing in Sandbox is only supported using mock data. Refer to <a href=\"/api-docs/buy/static/api-browse.html#sbox-test\" target=\"_blank\">Testing search in the Sandbox</a> for details.</span><br><b>Required:</b><ul><li><code>q</code> (keyword)</li><li>One parts-compatibility-supported category ID (such as <code>33559</code> Brakes)</li><li>At least one <a href=\"/api-docs/buy/static/api-browse.html#product-attributes\" target=\"_blank\">vehicle attribute</a> name/value pair</li></ul> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/gct:CompatibilityFilter
        :param str epid: The ePID is the eBay product identifier of a product from the eBay product catalog. This field limits the results to only items in the specified ePID.<br><br>Use the <a href=\"/api-docs/commerce/catalog/resources/product_summary/methods/search\" target=\"_blank\">product_summary/search</a> method in the <a href=\"/api-docs/commerce/catalog/overview.html\" target=\"_blank\">Catalog</a> API to search for the ePID of the product.<br><br>For example:<pre>/buy/browse/v1/item_summary/search?epid=15032</pre><span class=\"tablenote\"><b>Note:</b> When constructing a query, <code>epid</code> may be combined with a <code>gtin</code> value. However, <i>do not</i> specify keywords using the <code>q</code> parameter — keywords cannot be used in conjunction with an <code>epid</code>.</span>
        :param str fieldgroups: A comma-separated list of values that controls what is returned in the response. The default is <code>MATCHING_ITEMS</code>, which returns the items that match the keyword or category specified. The other values return data that can be used to create histograms or provide additional information.<br><br><b>Valid Values:</b><ul><li><code>ASPECT_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.aspectDistributions\">aspectDistributions</a> container to the response.<br><br><span class=\"tablenote\"><b>Note:</b> Information returned by <code>ASPECT_REFINEMENTS</code> is category specific.</span></li><li><code>BUYING_OPTION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.buyingOptionDistributions\">buyingOptionDistributions</a> container to the response.</li><li><code>CATEGORY_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.categoryDistributions\">categoryDistributions</a> container to the response.</li><li><code>CONDITION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.conditionDistributions\">conditionDistributions</a> containers, such as <code>NEW</code>, <code>USED</code>, etc., to the response. Within these groups are multiple states of the condition.<br><br>For example, <code>NEW</code> can be <i>New without tag</i>, <i>New in box</i>, <i>New without box</i>, etc.</li><li><code>EXTENDED</code><br>This field group adds the following fields to the response:<ul><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.shortDescription\">shortDescription</a></li><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.itemLocation.city\">itemLocation.city</a></li></ul></li><li><code>MATCHING_ITEMS</code> (<b>default value</b>)<br>This field group is intended to be used with one or more of the refinement values listed above. This is used to return the specified refinements and all matching items.</li><li><code>FULL</code><br>This field group returns all refinement containers and all matching items.</li></ul><b>Default:</b> <code>MATCHING_ITEMS</code>
        :param str filter: An array of field filters that can be used to limit/customize the result set.<br><br>Refer to <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html\" target=\"_blank\">Buy API Field Filters</a> for additional information and examples of all supported filters.<br><br>For example, to filter shirts based on a specific range of prices, include the filter illustrated here: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50]</pre>Filters may also be combined within a single request as illustrated in the sample below which further refines results to return only those shirts available from specific sellers: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50],sellers:{rpseller|bigSal}</pre> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:FilterField
        :param str gtin: This field lets you search by the Global Trade Item Number of an item as defined by <a href=\"https://www.gtin.info \" target=\"_blank\">https://www.gtin.info</a>.<br><br>For example:<br><pre>/buy/browse/v1/item_summary/search?gtin=099482432621</pre><span class=\"tablenote\"><b>Note:</b> You can search only by UPC (Universal Product Code). To search using another GTIN format, you must search by keyword.</span><span class=\"tablenote\"><b>Note:</b> When constructing a query, <code>gtin</code> may be combined with an <code>epid</code> value. However, <i>do not</i> specify keywords using the <code>q</code> parameter — keywords cannot be used in conjunction with <code>gtin</code>.</span>
        :param str limit: The number of items from the result set returned in a single page.<br><br><span class=\"tablenote\"><b>Note:</b> If a value is set in the <code>limit</code> field, the value of <code>offset</code> must be either zero or a multiple of the <code>limit</code> value. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min:</b> 1<br><br><b>Max:</b> 200<br><br><b>Default:</b> 50
        :param str offset: Specifies the number of items to skip in the result set. This is used with the <code>limit</code> field to control the pagination of the output.<br><br>For example:<ul><li>If <code>offset</code> is 0 and <code>limit</code> is 10, the method will retrieve items 1-10 from the list of items returned</li><li>If <code>offset</code> is 10 and <code>limit</code> is 10, the method will retrieve items 11-20 from the list of items returned.</li></ul><span class=\"tablenote\"><b>Note:</b> The value of <code>offset</code> must be either zero or a multiple of the value set in the <code>limit</code> field. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min</b>: 0<br><br><b>Max:</b> 9,999<br><br><b>Default:</b> 0
        :param str q: A string consisting of one or more keywords used to search for items on eBay.<br><br><span class=\"tablenote\"><b>Note:</b> The <code>*</code> wildcard character is <b>not</b> allowed in this field.</span><br>When providing two or more keywords in a single query, the string is processed as follows:<ul><li>When successive keywords are separated by a space, the list of keywords is processed as an <code>AND</code> request. For example, to retrieve items that include <b>both</b> of the keywords <b>iphone</b> AND <b>ipad</b>, submit the following query:<br><pre>/buy/browse/v1/item_summary/search?q=iphone ipad</pre></li><li>When successive keywords are comma-separated and surrounded by a single pair of parentheses, OR if the keywords are each URL-encoded, the list of keywords is processed as an <code>OR</code> request. For example, to retrieve items that include <b>iphone</b> OR <b>ipad</b>, submit one of the following queries:<br><pre>/buy/browse/v1/item_summary/search?q=(iphone, ipad)</pre><pre>/buy/browse/v1/item_summary/search?q=%28iphone%2c%20ipad%29</pre></li></ul><br><span class=\"tablenote\"><b>Note:</b> When specifying keywords using the <code>q</code> parameter, <i>do not include</i> an <code>epid</code> or <code>gtin</code> parameter value as neither can be used in conjuction with a keyword search.</span>
        :param str sort: Specifies the criteria on which returned items are to be sorted.<br><br>Items can be sorted in ascending order based on:<ul><li>Price (<code>sort=price</code>)<br>Returned items are sorted based on their total cost (i.e., <i>price + shipping cost</i>).<br><br>Items with the lowest combined price are shown first.<br><br>When sorting by price, it is highly recommended that:<ul><li>The <code>X-EBAY-C-ENDUSERCTX</code> request header is used, <b>and</b></li><li>The <code>contextualLocation</code> parameter specifies the delivery country and postal code.<br><br>These values must be <i>URL-encoded</i>.</li></ul>Refer to the following example:<pre>X-EBAY-C-ENDUSERCTX: contextualLocation=country%3DUS%2Czip%3D19406</pre><b>Descending price order</b><br>To sort items from <i>highest price</i> to <i>lowest price</i> insert a minus sign (-) before <code>price</code> as the search criterion:<pre>sort=-price</pre></li><li>Distance (<code>sort=distance</code>)<br>Returned items are sorted based on their distance from the buyer's location.<br><br>Items that are closest to the buyer are listed first.<br><br><div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> When sorting by distance, all required <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html#pickupCountry\" target=\"_blank\">pickup filters</a> must be included in the request.</p></div></li><li>Date<br>Items can be sorted by date based on:<ul><li>Listing date (<code>sort=newlyListed</code>)<br>Returned items are sorted based on their listing date.<br><br>Newly listed items are shown first.</li><li>End date (<code>sort=endingSoonest</code>)<br>Returned items are sorted based on the date/time on which their listing is scheduled to end.<br><br>Items that are closest to their scheduled ending date/time are shown first.</li></ul>If no sort parameter is submitted, the result set is sorted by \"Best Match\". Refer to <a href=\"https://www.ebay.com/help/selling/listings/listing-tips/optimising-listings-best-match?id=4166 \" target=\"_blank\">Optimizing your listings for Best Match</a> for additional information. For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:SortField
        :param str x_ebay_c_enduserctx: This header is required to support revenue sharing for eBay Partner Network and to improve the accuracy of shipping and delivery time estimations.<br><br>For additional information, refer to <a href=\"/api-docs/buy/static/api-browse.html#Headers\" target=\"_blank \">Use request headers</a> in the <a href=\"/api-docs/buy/static/buying-ig-landing.html\" target=\"_blank\">Buying Integration Guide</a>.
        :param str x_ebay_c_marketplace_id: This header identifies the seller's eBay marketplace. It is required for all marketplaces outside of the US.<br><br><span class=\"tablenote\"><b>Note:</b> If a marketplace ID value is not provided, the default value of <code>EBAY_US</code> is used.</span><br>See <a href=\"/api-docs/buy/browse/types/ba:MarketplaceIdEnum\" target=\"_blank\">MarketplaceIdEnum</a> for supported values.
        :param str accept_language: This header is used to indicate the natural language and locale preferred by the user for the response.<br><br>This header is required when targeting a specific locale of a marketplace that supports multiple locales. For example:<ul><li>When targeting the French locale of the Belgium marketplace, it is required to pass in <code>fr-BE</code> to specify this. If this locale is not specified, the language will default to Dutch.</li><li>When targeting the French locale of the Canadian marketplace, it is required to pass in <code>fr-CA</code> to specify this. If this locale is not specified, the language will default to English.</li></ul>
        :return: SearchPagedCollection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.search_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.search_with_http_info(**kwargs)  # noqa: E501
            return data

    def search_with_http_info(self, **kwargs):  # noqa: E501
        """search  # noqa: E501

        This method searches for eBay items by various query parameters and retrieves summaries of the items. You can search by keyword, category, eBay product ID (ePID), or GTIN, charity ID, or a combination of these.<br><br><span class=\"tablenote\"><b>Note:</b> Only listings where <code>FIXED_PRICE</code> (Buy It Now) is a buying option are returned by default. To retrieve listings that do not have <code>FIXED_PRICE</code> as a buying option, the <code>buyingOptions</code> filter can be used to retrieve those listings.<br><br>Note that an auction listing enabled with the <i>Buy it Now</i> feature will initially show <code>AUCTION</code> and <code>FIXED_PRICE</code> as buying options, but if/when that auction listing receives a qualifying bid, only <code>AUCTION</code> remains as a buying option. If this happens, the <code>buyingOptions</code> filter would need to be used to retrieve that auction listing.</span><br>This method also supports the following:<ul><li>Filtering by the value of one or multiple fields, such as listing format, item condition, price range, location, and more. For the fields supported by this method, refer to the <a href=\"#uri.filter\">filter</a> parameter.</li><li>Retrieving the refinements (metadata) of an item, such as item aspects (color, brand) condition, category, etc. using the <a href=\"#uri.fieldgroups\">fieldgroups</a> parameter.</li><li>Filtering by item aspects and other refinements using the <a href=\"#uri.aspect_filter\">aspect_filter</a> parameter.</li><li>Filtering for items that are compatible with a specific product, using the <a href=\"#uri.compatibility_filter\">compatibility_filter</a> parameter.</li><li>Creating aspects histograms, which enables shoppers to drill down in each refinement narrowing the search results.</li></ul>For additional information and examples of these capabilities, refer to <a href=\"/api-docs/buy/static/api-browse.html\" target=\"_blank\">Browse API</a> in the Buying Integration Guide.</br><h3>Pagination and sort controls</h3>There are pagination controls (<b>limit</b> and <b>offset</b> fields) and <b>sort</b> query parameters that control/sort the data that are returned. By default, results are sorted by <i>Best Match</i>. For more information about Best Match, refer to <a href=\"https://pages.ebay.com/help/sell/searchstanding.html \" target=\"_blank\">Best Match</a>.</br><h3>Restrictions</h3>This method can return a maximum of 10,000 items. For a list of supported sites and other restrictions, refer to <a href=\"/api-docs/buy/browse/overview.html#API\">API Restrictions</a>.<br><br><span class=\"tablenote\"><b>eBay Partner Network:</b> In order to receive a commission for your sales, you must use the URL returned in the <code>itemAffiliateWebUrl</code> field to forward your buyer to the ebay.com site.</span>  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str aspect_filter: This field lets you filter by item aspects. The aspect name/value pairs and category, which is required, is used to limit the results to specific aspects of the item. For example, in a clothing category one aspect pair would be Color/Red.<br><br><span class=\"tablenote\"><b>Note:</b> The category ID must be specified <i>twice</i>:<ul><li>Once as a URI parameter in the <code>category_ids</code> field</li><li>Once as part of the <code>aspect_filter</code> field</li></ul>These two values <b>must</b> be the same.</span><br>For example, to return items for a woman's red shirt, issue the following request:<br><pre>/buy/browse/v1/item_summary/search?q=shirt&category_ids=15724&aspect_filter=categoryId:15724,Color:{Red}</pre>To get a list of the aspect pairs and the category, which is returned in the <code>dominantCategoryId</code> field, set <code>fieldgroups</code> to <code>ASPECT_REFINEMENTS</code> as illustrated here:<pre>/buy/browse/v1/item_summary/search?q=shirt&amp;fieldgroups=ASPECT_REFINEMENTS</pre><span class=\"tablenote\"><b> Note:</b> The pipe symbol is used as a delimiter between aspect filter values. If a value contains a pipe symbol (for example, the brand name 'Bed|Stü'), you must enter a backslash before the pipe character to prevent it from being evaluated as a delimiter.<br><br>The following example illustrates the correct format for entering two brand names as aspect filter values, one of which contains a pipe symbol:<pre>/buy/browse/v1/item_summary/search?limit=50&category_ids=3034&filter=buyingOptions:{AUCTION|FIXED_PRICE}&aspect_filter=categoryId:3034,Brand:{Bed&bsol;|Stü|Nike}</pre></span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/gct:AspectFilter
        :param str auto_correct: A query parameter that enables auto correction.<br><br>A sample is shown below:<pre>/buy/browse/v1/item_summary/search?auto_correct=KEYWORD</pre><span class=\"tablenote\"><b>Note:</b> Auto correction is currently supported in the following marketplaces:<ul><li>United States</li><li>Austria</li><li>Australia</li><li>Canada</li><li>Switzerland</li><li>Germany</li><li>Spain</li><li>France</li><li>United Kingdom</li><li>Ireland</li><li>Italy</li></ul></span><br><b>Valid Values:</b> <code>KEYWORD</code>
        :param str category_ids: <a name=\"category_ids\"></a>The category ID is used to limit the results that are returned. This field may pass in one category ID or a comma separated list of IDs as illustrated in the following examples:<pre>/buy/browse/v1/item_summary/search?category_ids=29792</pre><pre>/buy/browse/v1/item_summary/search?category_ids=267,29792</pre><span class=\"tablenote\"><b>Note:</b> Currently, you can pass in only one category ID per request.</span><br>To refine the set of information that is returned, <code>category_ids</code> may be combined with <b>EITHER</b>:<ul><li><code>epid</code> and/or <code>gtin</code> values</li><li><code>q</code> keywords</li></ul>For example, when looking of a toy phone, simply searching for \"phone\" will return mobile phones because that is the \"Best Match\" for the search. To further refine the request to include toy phones, include the <b>Toys &amp; Hobbies</b> category ID as illustrated here:<pre>/buy/browse/v1/item_summary/search?q=phone&category_ids=220</pre>Because the list of eBay category IDs is not published and category IDs are not the same across all eBay marketplaces, category IDs may be determined by:<ul><li>Visiting the <a href=\"https://pages.ebay.com/sellerinformation/news/categorychanges.html \" target=\"_blank\">Category Changes page</a></li><li>Using the Taxonomy API. Refer to <a href=\"/api-docs/buy/buy-categories.html\" target=\"_blank\">Get Categories for Buy APIs</a> for complete information.</li><li>Issuing the following call to retrieve the <code>dominantCategoryId</code> for an item:<pre>/buy/browse/v1/item_summary/search?q=<i> keyword</i>&fieldgroups=ASPECT_REFINEMENTS</pre></li></ul><span class=\"tablenote\"><b>Note:</b> If a top-level (L1) category is specified, you <b>must</b> also include a <code>q</code> query parameter.</span>
        :param str charity_ids: The charity ID filters results to return only those items associated with the specified charity.<br><br><span class=\"tablenote\"><b>Note:</b> <code>charity_ids</code> is only supported by the US and UK marketplaces.</span><br>Charity ID is a charity's unique identification number:<ul><li>In the US, this is the <b>Employer Identification Number (EIN)</b>.</li><li>In the UK, this is the Charity Registration Number (CRN), commonly called <b>Charity Number</b>.</li></ul><br><code>charity_ids</code> may be retrieved/determined as follows:<ul><li>Search for a supported charity using the Charity API's <a href=\"/api-docs/commerce/charity/resources/charity_org/methods/getCharityOrgs \" target=\"_blank\">getCharityOrgs</a> method.<br><br><div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> The value to be passed in as <code>charity_ids</code> is that returned in the <code>registrationId</code> field.</p></div></li><li>Search for a supported charity by visiting <a href=\"https://charity.ebay.com/search \" target=\"_blank\">Charity Search</a>. Click on the charity's name to display its information. The EIN number is included in the charity's information block at the top of the page.<br><br>For example, the charity ID for <a href=\"https://charity.ebay.com/charity/American-Red-Cross/3843 \" target=\"_blank\">American Red Cross</a>, is <code>530196605</code>.</li></ul>Up to 20 comma-separated <code>charity_ids</code> may be specified in each query. Additionally, <code>charity_ids</code> may be combined with <code>category_ids</code> and/or <code>q</code> keyword values to further filter returned results.<br><br>A sample query using <code>charity_ids</code> is:<br><pre>/buy/browse/v1/item_summary/search?charity_ids=13-1788491,300108469</pre>
        :param str compatibility_filter: This field specifies the attributes used to define a specific product. The service searches for items matching the keyword, or matching the keyword and a product attribute value in the title of the item.<br><br><span class=\"tablenote\"><b>Note:</b> The only products supported are cars, trucks, and motorcycles.</span><br>For example, if the keyword is <code>brakes</code> and <code>compatibility-filter=Year:2018;Make:BMW</code>, the items returned are items with <b>brakes</b>, <b>2018</b>, or <b>BMW</b> in the title.<br><br>The service uses the product attributes to determine whether the item is compatible. The service returns the attributes that are compatible and the <a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.compatibilityMatch\">CompatibilityMatchEnum</a> value that indicates how well the item matches the attributes.<br><br><div class=\"msgbox_tip\"><p class=\"msgbox_tipInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #478415;&quot; class=&quot;mcFormatColor&quot;&gt;Tip: &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #478415;\" class=\"mcFormatColor\">Tip:</span></b></span></span> Refer to the <a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#s0-1-21-6-7-7-6-ReturnItemsthatareCompatiblewiththeKeywordandVehicle-9\" target=\"_blank\">Samples</a> section for a detailed example.</p></div><br><b>Best Practice:</b> Submit all of the <a href=\"/api-docs/buy/static/api-browse.html#product-attributes\" target=\"_blank\">product attributes</a> for the specific product.<br><br>To find the attributes and values for a specific marketplace, use the <a href=\"/api-docs/commerce/taxonomy/resources/category_tree/methods/getCompatibilityProperties\" target=\"_blank\">getCompatibilityProperties</a> method in the <a href=\"/api-docs/commerce/taxonomy/resources/methods\" target=\"_blank\">Taxonomy API</a>.<br><br>For more information, refer to <a href=\"/api-docs/buy/static/api-browse.html#Check\" target=\"_blank\">Check compatibility</a> in the Buying Integration Guide.<br><br><span class=\"tablenote\"><b>Note:</b> Testing in Sandbox is only supported using mock data. Refer to <a href=\"/api-docs/buy/static/api-browse.html#sbox-test\" target=\"_blank\">Testing search in the Sandbox</a> for details.</span><br><b>Required:</b><ul><li><code>q</code> (keyword)</li><li>One parts-compatibility-supported category ID (such as <code>33559</code> Brakes)</li><li>At least one <a href=\"/api-docs/buy/static/api-browse.html#product-attributes\" target=\"_blank\">vehicle attribute</a> name/value pair</li></ul> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/gct:CompatibilityFilter
        :param str epid: The ePID is the eBay product identifier of a product from the eBay product catalog. This field limits the results to only items in the specified ePID.<br><br>Use the <a href=\"/api-docs/commerce/catalog/resources/product_summary/methods/search\" target=\"_blank\">product_summary/search</a> method in the <a href=\"/api-docs/commerce/catalog/overview.html\" target=\"_blank\">Catalog</a> API to search for the ePID of the product.<br><br>For example:<pre>/buy/browse/v1/item_summary/search?epid=15032</pre><span class=\"tablenote\"><b>Note:</b> When constructing a query, <code>epid</code> may be combined with a <code>gtin</code> value. However, <i>do not</i> specify keywords using the <code>q</code> parameter — keywords cannot be used in conjunction with an <code>epid</code>.</span>
        :param str fieldgroups: A comma-separated list of values that controls what is returned in the response. The default is <code>MATCHING_ITEMS</code>, which returns the items that match the keyword or category specified. The other values return data that can be used to create histograms or provide additional information.<br><br><b>Valid Values:</b><ul><li><code>ASPECT_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.aspectDistributions\">aspectDistributions</a> container to the response.<br><br><span class=\"tablenote\"><b>Note:</b> Information returned by <code>ASPECT_REFINEMENTS</code> is category specific.</span></li><li><code>BUYING_OPTION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.buyingOptionDistributions\">buyingOptionDistributions</a> container to the response.</li><li><code>CATEGORY_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.categoryDistributions\">categoryDistributions</a> container to the response.</li><li><code>CONDITION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.conditionDistributions\">conditionDistributions</a> containers, such as <code>NEW</code>, <code>USED</code>, etc., to the response. Within these groups are multiple states of the condition.<br><br>For example, <code>NEW</code> can be <i>New without tag</i>, <i>New in box</i>, <i>New without box</i>, etc.</li><li><code>EXTENDED</code><br>This field group adds the following fields to the response:<ul><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.shortDescription\">shortDescription</a></li><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.itemLocation.city\">itemLocation.city</a></li></ul></li><li><code>MATCHING_ITEMS</code> (<b>default value</b>)<br>This field group is intended to be used with one or more of the refinement values listed above. This is used to return the specified refinements and all matching items.</li><li><code>FULL</code><br>This field group returns all refinement containers and all matching items.</li></ul><b>Default:</b> <code>MATCHING_ITEMS</code>
        :param str filter: An array of field filters that can be used to limit/customize the result set.<br><br>Refer to <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html\" target=\"_blank\">Buy API Field Filters</a> for additional information and examples of all supported filters.<br><br>For example, to filter shirts based on a specific range of prices, include the filter illustrated here: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50]</pre>Filters may also be combined within a single request as illustrated in the sample below which further refines results to return only those shirts available from specific sellers: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50],sellers:{rpseller|bigSal}</pre> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:FilterField
        :param str gtin: This field lets you search by the Global Trade Item Number of an item as defined by <a href=\"https://www.gtin.info \" target=\"_blank\">https://www.gtin.info</a>.<br><br>For example:<br><pre>/buy/browse/v1/item_summary/search?gtin=099482432621</pre><span class=\"tablenote\"><b>Note:</b> You can search only by UPC (Universal Product Code). To search using another GTIN format, you must search by keyword.</span><span class=\"tablenote\"><b>Note:</b> When constructing a query, <code>gtin</code> may be combined with an <code>epid</code> value. However, <i>do not</i> specify keywords using the <code>q</code> parameter — keywords cannot be used in conjunction with <code>gtin</code>.</span>
        :param str limit: The number of items from the result set returned in a single page.<br><br><span class=\"tablenote\"><b>Note:</b> If a value is set in the <code>limit</code> field, the value of <code>offset</code> must be either zero or a multiple of the <code>limit</code> value. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min:</b> 1<br><br><b>Max:</b> 200<br><br><b>Default:</b> 50
        :param str offset: Specifies the number of items to skip in the result set. This is used with the <code>limit</code> field to control the pagination of the output.<br><br>For example:<ul><li>If <code>offset</code> is 0 and <code>limit</code> is 10, the method will retrieve items 1-10 from the list of items returned</li><li>If <code>offset</code> is 10 and <code>limit</code> is 10, the method will retrieve items 11-20 from the list of items returned.</li></ul><span class=\"tablenote\"><b>Note:</b> The value of <code>offset</code> must be either zero or a multiple of the value set in the <code>limit</code> field. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min</b>: 0<br><br><b>Max:</b> 9,999<br><br><b>Default:</b> 0
        :param str q: A string consisting of one or more keywords used to search for items on eBay.<br><br><span class=\"tablenote\"><b>Note:</b> The <code>*</code> wildcard character is <b>not</b> allowed in this field.</span><br>When providing two or more keywords in a single query, the string is processed as follows:<ul><li>When successive keywords are separated by a space, the list of keywords is processed as an <code>AND</code> request. For example, to retrieve items that include <b>both</b> of the keywords <b>iphone</b> AND <b>ipad</b>, submit the following query:<br><pre>/buy/browse/v1/item_summary/search?q=iphone ipad</pre></li><li>When successive keywords are comma-separated and surrounded by a single pair of parentheses, OR if the keywords are each URL-encoded, the list of keywords is processed as an <code>OR</code> request. For example, to retrieve items that include <b>iphone</b> OR <b>ipad</b>, submit one of the following queries:<br><pre>/buy/browse/v1/item_summary/search?q=(iphone, ipad)</pre><pre>/buy/browse/v1/item_summary/search?q=%28iphone%2c%20ipad%29</pre></li></ul><br><span class=\"tablenote\"><b>Note:</b> When specifying keywords using the <code>q</code> parameter, <i>do not include</i> an <code>epid</code> or <code>gtin</code> parameter value as neither can be used in conjuction with a keyword search.</span>
        :param str sort: Specifies the criteria on which returned items are to be sorted.<br><br>Items can be sorted in ascending order based on:<ul><li>Price (<code>sort=price</code>)<br>Returned items are sorted based on their total cost (i.e., <i>price + shipping cost</i>).<br><br>Items with the lowest combined price are shown first.<br><br>When sorting by price, it is highly recommended that:<ul><li>The <code>X-EBAY-C-ENDUSERCTX</code> request header is used, <b>and</b></li><li>The <code>contextualLocation</code> parameter specifies the delivery country and postal code.<br><br>These values must be <i>URL-encoded</i>.</li></ul>Refer to the following example:<pre>X-EBAY-C-ENDUSERCTX: contextualLocation=country%3DUS%2Czip%3D19406</pre><b>Descending price order</b><br>To sort items from <i>highest price</i> to <i>lowest price</i> insert a minus sign (-) before <code>price</code> as the search criterion:<pre>sort=-price</pre></li><li>Distance (<code>sort=distance</code>)<br>Returned items are sorted based on their distance from the buyer's location.<br><br>Items that are closest to the buyer are listed first.<br><br><div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> When sorting by distance, all required <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html#pickupCountry\" target=\"_blank\">pickup filters</a> must be included in the request.</p></div></li><li>Date<br>Items can be sorted by date based on:<ul><li>Listing date (<code>sort=newlyListed</code>)<br>Returned items are sorted based on their listing date.<br><br>Newly listed items are shown first.</li><li>End date (<code>sort=endingSoonest</code>)<br>Returned items are sorted based on the date/time on which their listing is scheduled to end.<br><br>Items that are closest to their scheduled ending date/time are shown first.</li></ul>If no sort parameter is submitted, the result set is sorted by \"Best Match\". Refer to <a href=\"https://www.ebay.com/help/selling/listings/listing-tips/optimising-listings-best-match?id=4166 \" target=\"_blank\">Optimizing your listings for Best Match</a> for additional information. For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:SortField
        :param str x_ebay_c_enduserctx: This header is required to support revenue sharing for eBay Partner Network and to improve the accuracy of shipping and delivery time estimations.<br><br>For additional information, refer to <a href=\"/api-docs/buy/static/api-browse.html#Headers\" target=\"_blank \">Use request headers</a> in the <a href=\"/api-docs/buy/static/buying-ig-landing.html\" target=\"_blank\">Buying Integration Guide</a>.
        :param str x_ebay_c_marketplace_id: This header identifies the seller's eBay marketplace. It is required for all marketplaces outside of the US.<br><br><span class=\"tablenote\"><b>Note:</b> If a marketplace ID value is not provided, the default value of <code>EBAY_US</code> is used.</span><br>See <a href=\"/api-docs/buy/browse/types/ba:MarketplaceIdEnum\" target=\"_blank\">MarketplaceIdEnum</a> for supported values.
        :param str accept_language: This header is used to indicate the natural language and locale preferred by the user for the response.<br><br>This header is required when targeting a specific locale of a marketplace that supports multiple locales. For example:<ul><li>When targeting the French locale of the Belgium marketplace, it is required to pass in <code>fr-BE</code> to specify this. If this locale is not specified, the language will default to Dutch.</li><li>When targeting the French locale of the Canadian marketplace, it is required to pass in <code>fr-CA</code> to specify this. If this locale is not specified, the language will default to English.</li></ul>
        :return: SearchPagedCollection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['aspect_filter', 'auto_correct', 'category_ids', 'charity_ids', 'compatibility_filter', 'epid', 'fieldgroups', 'filter', 'gtin', 'limit', 'offset', 'q', 'sort', 'x_ebay_c_enduserctx', 'x_ebay_c_marketplace_id', 'accept_language']  # 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 search" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'aspect_filter' in params:
            query_params.append(('aspect_filter', params['aspect_filter']))  # noqa: E501
        if 'auto_correct' in params:
            query_params.append(('auto_correct', params['auto_correct']))  # noqa: E501
        if 'category_ids' in params:
            query_params.append(('category_ids', params['category_ids']))  # noqa: E501
        if 'charity_ids' in params:
            query_params.append(('charity_ids', params['charity_ids']))  # noqa: E501
        if 'compatibility_filter' in params:
            query_params.append(('compatibility_filter', params['compatibility_filter']))  # noqa: E501
        if 'epid' in params:
            query_params.append(('epid', params['epid']))  # noqa: E501
        if 'fieldgroups' in params:
            query_params.append(('fieldgroups', params['fieldgroups']))  # noqa: E501
        if 'filter' in params:
            query_params.append(('filter', params['filter']))  # noqa: E501
        if 'gtin' in params:
            query_params.append(('gtin', params['gtin']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'q' in params:
            query_params.append(('q', params['q']))  # noqa: E501
        if 'sort' in params:
            query_params.append(('sort', params['sort']))  # noqa: E501

        header_params = {}
        if 'x_ebay_c_enduserctx' in params:
            header_params['X-EBAY-C-ENDUSERCTX'] = params['x_ebay_c_enduserctx']  # noqa: E501
        if 'x_ebay_c_marketplace_id' in params:
            header_params['X-EBAY-C-MARKETPLACE-ID'] = params['x_ebay_c_marketplace_id']  # noqa: E501
        if 'accept_language' in params:
            header_params['Accept-Language'] = params['accept_language']  # noqa: E501

        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 = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/item_summary/search', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SearchPagedCollection',  # 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)

    def search_by_image(self, content_type, **kwargs):  # noqa: E501
        """search_by_image  # noqa: E501

        This method searches for eBay items based on a image and retrieves summaries of the items. You pass in a Base64 image in the request payload and can refine the search by category, or with other available filters.<br><br>To get the Base64 image string, you can use sites such as <a href=\"https://codebeautify.org/image-to-base64-converter \" target=\"_blank\">https://codebeautify.org/image-to-base64-converter</a>.<br><br>This method also supports the following:<ul> <li>Filtering by the value of one or multiple fields, such as listing format, item condition, price range, location, and more. For the fields supported by this method, refer to the <a href=\"#uri.filter\">filter</a> parameter.</li><li>Filtering by item aspects using the <a href=\"#uri.aspect_filter\">aspect_filter</a> parameter.</li></ul>For details and examples of these capabilities, refer to <a href=\"/api-docs/buy/static/api-browse.html\" target=\"_blank\">Browse API</a> in the Buying Integration Guide.<h3>URL Encoding for Parameters</h3>Query parameter values need to be URL encoded. For details, refer to <a href=\"/api-docs/static/rest-request-components.html#parameters\" target=\"_blank\">URL encoding query parameter values</a>. For readability, code examples in this document have not been URL encoded.<h3>Restrictions</h3>This method can return a maximum of 10,000 items. For a list of supported sites and other restrictions, refer to <a href=\"/api-docs/buy/browse/overview.html#API\">API Restrictions</a>.<br><br><span class=\"tablenote\"><b>eBay Partner Network:</b> In order to receive a commission for your sales, you must use the URL returned in the <code>itemAffiliateWebUrl</code> field to forward your buyer to the ebay.com site.</span>  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_by_image(content_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str content_type: This header indicates the format of the request body provided by the client. Its value should be set to <code>application/json</code>.<br><br>For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. (required)
        :param SearchByImageRequest body: The container for the image information fields.
        :param str x_ebay_c_enduserctx: This header is required to support revenue sharing for eBay Partner Network and to improve the accuracy of shipping and delivery time estimations.<br><br>For additional information, refer to <a href=\"/api-docs/buy/static/api-browse.html#Headers\" target=\"_blank \">Use request headers</a> in the <a href=\"/api-docs/buy/static/buying-ig-landing.html\" target=\"_blank\">Buying Integration Guide</a>.
        :param str x_ebay_c_marketplace_id: This header identifies the seller's eBay marketplace. It is required for all marketplaces outside of the US.<br><br><span class=\"tablenote\"><b>Note:</b> If a marketplace ID value is not provided, the default value of <code>EBAY_US</code> is used.</span><br>See <a href=\"/api-docs/buy/browse/types/ba:MarketplaceIdEnum\" target=\"_blank\">MarketplaceIdEnum</a> for supported values.
        :param str accept_language: This header is used to indicate the natural language and locale preferred by the user for the response.<br><br>This header is required when targeting a specific locale of a marketplace that supports multiple locales. For example:<ul><li>When targeting the French locale of the Belgium marketplace, it is required to pass in <code>fr-BE</code> to specify this. If this locale is not specified, the language will default to Dutch.</li><li>When targeting the French locale of the Canadian marketplace, it is required to pass in <code>fr-CA</code> to specify this. If this locale is not specified, the language will default to English.</li></ul>
        :param str aspect_filter: This field lets you filter by item aspects. The aspect name/value pairs and category, which is required, is used to limit the results to specific aspects of the item. For example, in a clothing category one aspect pair would be Color/Red.<br><br><span class=\"tablenote\"><b>Note:</b> The category ID must be specified <i>twice</i>:<ul><li>Once as a URI parameter in the <code>category_ids</code> field</li><li>Once as part of the <code>aspect_filter</code> field</li></ul>These two values <b>must</b> be the same.</span><br>For example, to return items for a woman's red shirt, issue the following request:<br><pre>/buy/browse/v1/item_summary/search?q=shirt&category_ids=15724&aspect_filter=categoryId:15724,Color:{Red}</pre>To get a list of the aspect pairs and the category, which is returned in the <code>dominantCategoryId</code> field, set <code>fieldgroups</code> to <code>ASPECT_REFINEMENTS</code> as illustrated here:<pre>/buy/browse/v1/item_summary/search?q=shirt&amp;fieldgroups=ASPECT_REFINEMENTS</pre><span class=\"tablenote\"><b> Note:</b> The pipe symbol is used as a delimiter between aspect filter values. If a value contains a pipe symbol (for example, the brand name 'Bed|Stü'), you must enter a backslash before the pipe character to prevent it from being evaluated as a delimiter.<br><br>The following example illustrates the correct format for entering two brand names as aspect filter values, one of which contains a pipe symbol:<pre>/buy/browse/v1/item_summary/search?limit=50&category_ids=3034&filter=buyingOptions:{AUCTION|FIXED_PRICE}&aspect_filter=categoryId:3034,Brand:{Bed&bsol;|Stü|Nike}</pre></span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/gct:AspectFilter
        :param str category_ids: </a>The category ID is used to limit the results that are returned. This field may pass in one category ID or a comma separated list of IDs as illustrated in the following examples:<pre>/buy/browse/v1/item_summary/searchByImage?category_ids=29792</pre><pre>/buy/browse/v1/item_summary/searchByImage?category_ids=267,29792</pre><span class=\"tablenote\"><b>Note:</b> Currently, you can pass in only one category ID per request.</span><br>To refine the set of information that is returned, <code>category_ids</code> may be combined with other available filters.<br><br>Because the list of eBay category IDs is not published and category IDs are not the same across all eBay marketplaces, category IDs may be determined by:<ul><li>Visiting the <a href=\"https://pages.ebay.com/sellerinformation/news/categorychanges.html \" target=\"_blank\">Category Changes page</a></li><li>Using the Taxonomy API. Refer to <a href=\"/api-docs/buy/buy-categories.html\" target=\"_blank\">Get Categories for Buy APIs</a> for complete information.</li><li>Issuing the following call to retrieve the <code>dominantCategoryId</code> for an item:<pre>/buy/browse/v1/item_summary/searchByImage?q=<i> keyword</i>&fieldgroups=ASPECT_REFINEMENTS</pre></li></ul>
        :param str charity_ids: The charity ID filters results to return only those items associated with the specified charity.<br><br><span class=\"tablenote\"><b>Note:</b> <code>charity_ids</code> is only supported by the US and UK marketplaces.</span><br>Charity ID is a charity's unique identification number:<ul><li>In the US, this is the <b>Employer Identification Number (EIN)</b>.</li><li>In the UK, this is the Charity Registration Number (CRN), commonly called <b>Charity Number</b>.</li></ul><br><code>charity_ids</code> may be retrieved/determined as follows:<ul><li>Search for a supported charity using the Charity API's <a href=\"/api-docs/commerce/charity/resources/charity_org/methods/getCharityOrgs \" target=\"_blank\">getCharityOrgs</a> method.<br><br><div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> The value to be passed in as <code>charity_ids</code> is that returned in the <code>registrationId</code> field.</p></div></li><li>Search for a supported charity by visiting <a href=\"https://charity.ebay.com/search \" target=\"_blank\">Charity Search</a>. Click on the charity's name to display its information. The EIN number is included in the charity's information block at the top of the page.<br><br>For example, the charity ID for <a href=\"https://charity.ebay.com/charity/American-Red-Cross/3843 \" target=\"_blank\">American Red Cross</a>, is <code>530196605</code>.</li></ul>Up to 20 comma-separated <code>charity_ids</code> may be specified in each query. Additionally, <code>charity_ids</code> may be combined with <code>category_ids</code> and/or <code>q</code> keyword values to further filter returned results.<br><br>A sample query using <code>charity_ids</code> is:<br><pre>/buy/browse/v1/item_summary/search?charity_ids=13-1788491,300108469</pre>
        :param str fieldgroups: A comma-separated list of values that controls what is returned in the response. The default is <code>MATCHING_ITEMS</code>, which returns the items that match the keyword or category specified. The other values return data that can be used to create histograms or provide additional information.<br><br><b>Valid Values:</b><ul><li><code>ASPECT_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.aspectDistributions\">aspectDistributions</a> container to the response.<br><br><span class=\"tablenote\"><b>Note:</b> Information returned by <code>ASPECT_REFINEMENTS</code> is category specific.</span></li><li><code>BUYING_OPTION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.buyingOptionDistributions\">buyingOptionDistributions</a> container to the response.</li><li><code>CATEGORY_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.categoryDistributions\">categoryDistributions</a> container to the response.</li><li><code>CONDITION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.conditionDistributions\">conditionDistributions</a> containers, such as <code>NEW</code>, <code>USED</code>, etc., to the response. Within these groups are multiple states of the condition.<br><br>For example, <code>NEW</code> can be <i>New without tag</i>, <i>New in box</i>, <i>New without box</i>, etc.</li><li><code>EXTENDED</code><br>This field group adds the following fields to the response:<ul><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.shortDescription\">shortDescription</a></li><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.itemLocation.city\">itemLocation.city</a></li></ul></li><li><code>MATCHING_ITEMS</code> (<b>default value</b>)<br>This field group is intended to be used with one or more of the refinement values listed above. This is used to return the specified refinements and all matching items.</li><li><code>FULL</code><br>This field group returns all refinement containers and all matching items.</li></ul><b>Default:</b> <code>MATCHING_ITEMS</code>
        :param str filter: An array of field filters that can be used to limit/customize the result set.<br><br>Refer to <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html\" target=\"_blank\">Buy API Field Filters</a> for the information about available filters.<br><br>For example, to filter shirts based on a specific range of prices, include the filter illustrated here: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50]</pre>Filters may also be combined within a single request as illustrated in the sample below which further refines results to return only those shirts available from specific sellers: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50],sellers:{rpseller|bigSal}</pre><span class=\"tablenote\"><b>Note:</b> Refer to <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html\" target=\"_blank\">Buy API Field Filters</a> for additional information and examples of all supported filters.</span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:FilterField
        :param str limit: The number of items from the result set returned in a single page.<br><br><span class=\"tablenote\"><b>Note:</b> If a value is set in the <code>limit</code> field, the value of <code>offset</code> must be either zero or a multiple of the <code>limit</code> value. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min:</b> 1<br><br><b>Max:</b> 200<br><br><b>Default:</b> 50
        :param str offset: Specifies the number of items to skip in the result set. This is used with the <code>limit</code> field to control the pagination of the output.<br><br>For example:<ul><li>If <code>offset</code> is 0 and <code>limit</code> is 10, the method will retrieve items 1-10 from the list of items returned</li><li>If <code>offset</code> is 10 and <code>limit</code> is 10, the method will retrieve items 11-20 from the list of items returned.</li></ul><span class=\"tablenote\"><b>Note:</b> The value of <code>offset</code> must be either zero or a multiple of the value set in the <code>limit</code> field. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min</b>: 0<br><br><b>Max:</b> 9,999<br><br><b>Default:</b> 0
        :param str sort: <span class=\"tablenote\"><b>Note:</b> This call currently returns results in a best-match order. This query parameter presently has no practical use.</span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:SortField
        :return: SearchPagedCollection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.search_by_image_with_http_info(content_type, **kwargs)  # noqa: E501
        else:
            (data) = self.search_by_image_with_http_info(content_type, **kwargs)  # noqa: E501
            return data

    def search_by_image_with_http_info(self, content_type, **kwargs):  # noqa: E501
        """search_by_image  # noqa: E501

        This method searches for eBay items based on a image and retrieves summaries of the items. You pass in a Base64 image in the request payload and can refine the search by category, or with other available filters.<br><br>To get the Base64 image string, you can use sites such as <a href=\"https://codebeautify.org/image-to-base64-converter \" target=\"_blank\">https://codebeautify.org/image-to-base64-converter</a>.<br><br>This method also supports the following:<ul> <li>Filtering by the value of one or multiple fields, such as listing format, item condition, price range, location, and more. For the fields supported by this method, refer to the <a href=\"#uri.filter\">filter</a> parameter.</li><li>Filtering by item aspects using the <a href=\"#uri.aspect_filter\">aspect_filter</a> parameter.</li></ul>For details and examples of these capabilities, refer to <a href=\"/api-docs/buy/static/api-browse.html\" target=\"_blank\">Browse API</a> in the Buying Integration Guide.<h3>URL Encoding for Parameters</h3>Query parameter values need to be URL encoded. For details, refer to <a href=\"/api-docs/static/rest-request-components.html#parameters\" target=\"_blank\">URL encoding query parameter values</a>. For readability, code examples in this document have not been URL encoded.<h3>Restrictions</h3>This method can return a maximum of 10,000 items. For a list of supported sites and other restrictions, refer to <a href=\"/api-docs/buy/browse/overview.html#API\">API Restrictions</a>.<br><br><span class=\"tablenote\"><b>eBay Partner Network:</b> In order to receive a commission for your sales, you must use the URL returned in the <code>itemAffiliateWebUrl</code> field to forward your buyer to the ebay.com site.</span>  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_by_image_with_http_info(content_type, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str content_type: This header indicates the format of the request body provided by the client. Its value should be set to <code>application/json</code>.<br><br>For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>. (required)
        :param SearchByImageRequest body: The container for the image information fields.
        :param str x_ebay_c_enduserctx: This header is required to support revenue sharing for eBay Partner Network and to improve the accuracy of shipping and delivery time estimations.<br><br>For additional information, refer to <a href=\"/api-docs/buy/static/api-browse.html#Headers\" target=\"_blank \">Use request headers</a> in the <a href=\"/api-docs/buy/static/buying-ig-landing.html\" target=\"_blank\">Buying Integration Guide</a>.
        :param str x_ebay_c_marketplace_id: This header identifies the seller's eBay marketplace. It is required for all marketplaces outside of the US.<br><br><span class=\"tablenote\"><b>Note:</b> If a marketplace ID value is not provided, the default value of <code>EBAY_US</code> is used.</span><br>See <a href=\"/api-docs/buy/browse/types/ba:MarketplaceIdEnum\" target=\"_blank\">MarketplaceIdEnum</a> for supported values.
        :param str accept_language: This header is used to indicate the natural language and locale preferred by the user for the response.<br><br>This header is required when targeting a specific locale of a marketplace that supports multiple locales. For example:<ul><li>When targeting the French locale of the Belgium marketplace, it is required to pass in <code>fr-BE</code> to specify this. If this locale is not specified, the language will default to Dutch.</li><li>When targeting the French locale of the Canadian marketplace, it is required to pass in <code>fr-CA</code> to specify this. If this locale is not specified, the language will default to English.</li></ul>
        :param str aspect_filter: This field lets you filter by item aspects. The aspect name/value pairs and category, which is required, is used to limit the results to specific aspects of the item. For example, in a clothing category one aspect pair would be Color/Red.<br><br><span class=\"tablenote\"><b>Note:</b> The category ID must be specified <i>twice</i>:<ul><li>Once as a URI parameter in the <code>category_ids</code> field</li><li>Once as part of the <code>aspect_filter</code> field</li></ul>These two values <b>must</b> be the same.</span><br>For example, to return items for a woman's red shirt, issue the following request:<br><pre>/buy/browse/v1/item_summary/search?q=shirt&category_ids=15724&aspect_filter=categoryId:15724,Color:{Red}</pre>To get a list of the aspect pairs and the category, which is returned in the <code>dominantCategoryId</code> field, set <code>fieldgroups</code> to <code>ASPECT_REFINEMENTS</code> as illustrated here:<pre>/buy/browse/v1/item_summary/search?q=shirt&amp;fieldgroups=ASPECT_REFINEMENTS</pre><span class=\"tablenote\"><b> Note:</b> The pipe symbol is used as a delimiter between aspect filter values. If a value contains a pipe symbol (for example, the brand name 'Bed|Stü'), you must enter a backslash before the pipe character to prevent it from being evaluated as a delimiter.<br><br>The following example illustrates the correct format for entering two brand names as aspect filter values, one of which contains a pipe symbol:<pre>/buy/browse/v1/item_summary/search?limit=50&category_ids=3034&filter=buyingOptions:{AUCTION|FIXED_PRICE}&aspect_filter=categoryId:3034,Brand:{Bed&bsol;|Stü|Nike}</pre></span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/gct:AspectFilter
        :param str category_ids: </a>The category ID is used to limit the results that are returned. This field may pass in one category ID or a comma separated list of IDs as illustrated in the following examples:<pre>/buy/browse/v1/item_summary/searchByImage?category_ids=29792</pre><pre>/buy/browse/v1/item_summary/searchByImage?category_ids=267,29792</pre><span class=\"tablenote\"><b>Note:</b> Currently, you can pass in only one category ID per request.</span><br>To refine the set of information that is returned, <code>category_ids</code> may be combined with other available filters.<br><br>Because the list of eBay category IDs is not published and category IDs are not the same across all eBay marketplaces, category IDs may be determined by:<ul><li>Visiting the <a href=\"https://pages.ebay.com/sellerinformation/news/categorychanges.html \" target=\"_blank\">Category Changes page</a></li><li>Using the Taxonomy API. Refer to <a href=\"/api-docs/buy/buy-categories.html\" target=\"_blank\">Get Categories for Buy APIs</a> for complete information.</li><li>Issuing the following call to retrieve the <code>dominantCategoryId</code> for an item:<pre>/buy/browse/v1/item_summary/searchByImage?q=<i> keyword</i>&fieldgroups=ASPECT_REFINEMENTS</pre></li></ul>
        :param str charity_ids: The charity ID filters results to return only those items associated with the specified charity.<br><br><span class=\"tablenote\"><b>Note:</b> <code>charity_ids</code> is only supported by the US and UK marketplaces.</span><br>Charity ID is a charity's unique identification number:<ul><li>In the US, this is the <b>Employer Identification Number (EIN)</b>.</li><li>In the UK, this is the Charity Registration Number (CRN), commonly called <b>Charity Number</b>.</li></ul><br><code>charity_ids</code> may be retrieved/determined as follows:<ul><li>Search for a supported charity using the Charity API's <a href=\"/api-docs/commerce/charity/resources/charity_org/methods/getCharityOrgs \" target=\"_blank\">getCharityOrgs</a> method.<br><br><div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> The value to be passed in as <code>charity_ids</code> is that returned in the <code>registrationId</code> field.</p></div></li><li>Search for a supported charity by visiting <a href=\"https://charity.ebay.com/search \" target=\"_blank\">Charity Search</a>. Click on the charity's name to display its information. The EIN number is included in the charity's information block at the top of the page.<br><br>For example, the charity ID for <a href=\"https://charity.ebay.com/charity/American-Red-Cross/3843 \" target=\"_blank\">American Red Cross</a>, is <code>530196605</code>.</li></ul>Up to 20 comma-separated <code>charity_ids</code> may be specified in each query. Additionally, <code>charity_ids</code> may be combined with <code>category_ids</code> and/or <code>q</code> keyword values to further filter returned results.<br><br>A sample query using <code>charity_ids</code> is:<br><pre>/buy/browse/v1/item_summary/search?charity_ids=13-1788491,300108469</pre>
        :param str fieldgroups: A comma-separated list of values that controls what is returned in the response. The default is <code>MATCHING_ITEMS</code>, which returns the items that match the keyword or category specified. The other values return data that can be used to create histograms or provide additional information.<br><br><b>Valid Values:</b><ul><li><code>ASPECT_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.aspectDistributions\">aspectDistributions</a> container to the response.<br><br><span class=\"tablenote\"><b>Note:</b> Information returned by <code>ASPECT_REFINEMENTS</code> is category specific.</span></li><li><code>BUYING_OPTION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.buyingOptionDistributions\">buyingOptionDistributions</a> container to the response.</li><li><code>CATEGORY_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.categoryDistributions\">categoryDistributions</a> container to the response.</li><li><code>CONDITION_REFINEMENTS</code><br>This field group adds the <a href=\"#response.refinement.conditionDistributions\">conditionDistributions</a> containers, such as <code>NEW</code>, <code>USED</code>, etc., to the response. Within these groups are multiple states of the condition.<br><br>For example, <code>NEW</code> can be <i>New without tag</i>, <i>New in box</i>, <i>New without box</i>, etc.</li><li><code>EXTENDED</code><br>This field group adds the following fields to the response:<ul><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.shortDescription\">shortDescription</a></li><li><a href=\"/api-docs/buy/browse/resources/item_summary/methods/search#response.itemSummaries.itemLocation.city\">itemLocation.city</a></li></ul></li><li><code>MATCHING_ITEMS</code> (<b>default value</b>)<br>This field group is intended to be used with one or more of the refinement values listed above. This is used to return the specified refinements and all matching items.</li><li><code>FULL</code><br>This field group returns all refinement containers and all matching items.</li></ul><b>Default:</b> <code>MATCHING_ITEMS</code>
        :param str filter: An array of field filters that can be used to limit/customize the result set.<br><br>Refer to <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html\" target=\"_blank\">Buy API Field Filters</a> for the information about available filters.<br><br>For example, to filter shirts based on a specific range of prices, include the filter illustrated here: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50]</pre>Filters may also be combined within a single request as illustrated in the sample below which further refines results to return only those shirts available from specific sellers: <pre>/buy/browse/v1/item_summary/search?q=shirt&filter=price:[10..50],sellers:{rpseller|bigSal}</pre><span class=\"tablenote\"><b>Note:</b> Refer to <a href=\"/api-docs/buy/static/ref-buy-browse-filters.html\" target=\"_blank\">Buy API Field Filters</a> for additional information and examples of all supported filters.</span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:FilterField
        :param str limit: The number of items from the result set returned in a single page.<br><br><span class=\"tablenote\"><b>Note:</b> If a value is set in the <code>limit</code> field, the value of <code>offset</code> must be either zero or a multiple of the <code>limit</code> value. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min:</b> 1<br><br><b>Max:</b> 200<br><br><b>Default:</b> 50
        :param str offset: Specifies the number of items to skip in the result set. This is used with the <code>limit</code> field to control the pagination of the output.<br><br>For example:<ul><li>If <code>offset</code> is 0 and <code>limit</code> is 10, the method will retrieve items 1-10 from the list of items returned</li><li>If <code>offset</code> is 10 and <code>limit</code> is 10, the method will retrieve items 11-20 from the list of items returned.</li></ul><span class=\"tablenote\"><b>Note:</b> The value of <code>offset</code> must be either zero or a multiple of the value set in the <code>limit</code> field. An error is returned for invalid <code>offset</code> values.</span><br><span class=\"tablenote\"><b>Note:</b> This method can return a maximum of 10,000 items in one results set.</span><br><b>Min</b>: 0<br><br><b>Max:</b> 9,999<br><br><b>Default:</b> 0
        :param str sort: <span class=\"tablenote\"><b>Note:</b> This call currently returns results in a best-match order. This query parameter presently has no practical use.</span> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/buy/browse/types/cos:SortField
        :return: SearchPagedCollection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['content_type', 'body', 'x_ebay_c_enduserctx', 'x_ebay_c_marketplace_id', 'accept_language', 'aspect_filter', 'category_ids', 'charity_ids', 'fieldgroups', 'filter', 'limit', 'offset', 'sort']  # 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 search_by_image" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'content_type' is set
        if ('content_type' not in params or
                params['content_type'] is None):
            raise ValueError("Missing the required parameter `content_type` when calling `search_by_image`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'aspect_filter' in params:
            query_params.append(('aspect_filter', params['aspect_filter']))  # noqa: E501
        if 'category_ids' in params:
            query_params.append(('category_ids', params['category_ids']))  # noqa: E501
        if 'charity_ids' in params:
            query_params.append(('charity_ids', params['charity_ids']))  # noqa: E501
        if 'fieldgroups' in params:
            query_params.append(('fieldgroups', params['fieldgroups']))  # noqa: E501
        if 'filter' in params:
            query_params.append(('filter', params['filter']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'sort' in params:
            query_params.append(('sort', params['sort']))  # noqa: E501

        header_params = {}
        if 'x_ebay_c_enduserctx' in params:
            header_params['X-EBAY-C-ENDUSERCTX'] = params['x_ebay_c_enduserctx']  # noqa: E501
        if 'x_ebay_c_marketplace_id' in params:
            header_params['X-EBAY-C-MARKETPLACE-ID'] = params['x_ebay_c_marketplace_id']  # noqa: E501
        if 'content_type' in params:
            header_params['Content-Type'] = params['content_type']  # noqa: E501
        if 'accept_language' in params:
            header_params['Accept-Language'] = params['accept_language']  # noqa: E501

        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 = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/item_summary/search_by_image', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SearchPagedCollection',  # 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)
