# coding: utf-8

"""
    Taxonomy API

    Use the Taxonomy API to discover the most appropriate eBay categories under which sellers can offer inventory items for sale, and the most likely categories under which buyers can browse or search for items to purchase. In addition, the Taxonomy API provides metadata about the required and recommended category aspects to include in listings, and also has two operations to retrieve parts compatibility information.  # noqa: E501

    OpenAPI spec version: v1.0.0
    
    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 ...commerce_taxonomy.api_client import ApiClient


class CategoryTreeApi(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 fetch_item_aspects(self, category_tree_id, **kwargs):  # noqa: E501
        """Get Aspects for All Leaf Categories in a Marketplace  # noqa: E501

        This call returns a complete list of aspects for all of the leaf categories that belong to an eBay marketplace. The eBay marketplace is specified through the <b>category_tree_id</b> URI parameter.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> A successful call returns a payload as a gzipped JSON file sent as a binary file using the content-type:application/octet-stream in the response. This file may be large (over 100 MB, compressed). Extract the JSON file from the compressed file with a utility that handles .gz or .gzip. The open source <a href=\"https://github.com/eBay/taxonomy-sdk\" target=\"_blank\">Taxonomy SDK</a> can be used to compare the aspect metadata that is returned in this response. The <b>Taxonomy SDK</b> uses this method to surface changes (new, modified, and removed entities) between an updated version of a bulk downloaded file relative to a previous version.</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.fetch_item_aspects(category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: The unique identifier of the eBay category tree being requested. (required)
        :return: GetCategoriesAspectResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.fetch_item_aspects_with_http_info(category_tree_id, **kwargs)  # noqa: E501
        else:
            (data) = self.fetch_item_aspects_with_http_info(category_tree_id, **kwargs)  # noqa: E501
            return data

    def fetch_item_aspects_with_http_info(self, category_tree_id, **kwargs):  # noqa: E501
        """Get Aspects for All Leaf Categories in a Marketplace  # noqa: E501

        This call returns a complete list of aspects for all of the leaf categories that belong to an eBay marketplace. The eBay marketplace is specified through the <b>category_tree_id</b> URI parameter.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> A successful call returns a payload as a gzipped JSON file sent as a binary file using the content-type:application/octet-stream in the response. This file may be large (over 100 MB, compressed). Extract the JSON file from the compressed file with a utility that handles .gz or .gzip. The open source <a href=\"https://github.com/eBay/taxonomy-sdk\" target=\"_blank\">Taxonomy SDK</a> can be used to compare the aspect metadata that is returned in this response. The <b>Taxonomy SDK</b> uses this method to surface changes (new, modified, and removed entities) between an updated version of a bulk downloaded file relative to a previous version.</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.fetch_item_aspects_with_http_info(category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: The unique identifier of the eBay category tree being requested. (required)
        :return: GetCategoriesAspectResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/category_tree/{category_tree_id}/fetch_item_aspects', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetCategoriesAspectResponse',  # 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 get_category_subtree(self, category_id, category_tree_id, **kwargs):  # noqa: E501
        """Get a Category Subtree  # noqa: E501

        This call retrieves the details of all nodes of the category tree hierarchy (the subtree) below a specified category of a category tree. You identify the tree using the <b>category_tree_id</b> parameter, which was returned by the <b>getDefaultCategoryTreeId</b> call in the <b>categoryTreeId</b> field.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> This call can return a very large payload, so you are strongly advised to submit the request with the following HTTP header:       <br /><br /><code>&nbsp;&nbsp;Accept-Encoding: application/gzip</code>       <br /><br />With this header (in addition to the required headers described under <a href=\"/api-docs/static/rest-request-components.html#HTTP\">HTTP Request Headers</a>), the call returns the response with <b>gzip</b> compression. </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.get_category_subtree(category_id, category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_id: The unique identifier of the category at the top of the subtree being requested. <br /><br />    <span class=\"tablenote\"> <strong>Note:</strong> If the <b>category_id</b> submitted identifies the root node of the tree, this call returns an error. To retrieve the complete tree, use this value with the <b>getCategoryTree</b> call.                   <br /><br />   If the <b>category_id</b> submitted identifies a leaf node of the tree, the call response will contain information about only that leaf node, which is a valid subtree.   <!-- <br /><br /> This call also returns an error if <b>category_id</b> identifies a deprecated category. This can occur if you routinely cache your category trees. Use the <b>Get Deprecated Categories and Mapping</b> call to determine which current category should be used in place of the deprecated category, and use the <b>getCategoryTree</b> call to update your cached copy of the tree. --> </span> (required)
        :param str category_tree_id: The unique identifier of the eBay category tree from which a category subtree is being requested. (required)
        :return: CategorySubtree
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_category_subtree_with_http_info(category_id, category_tree_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_category_subtree_with_http_info(category_id, category_tree_id, **kwargs)  # noqa: E501
            return data

    def get_category_subtree_with_http_info(self, category_id, category_tree_id, **kwargs):  # noqa: E501
        """Get a Category Subtree  # noqa: E501

        This call retrieves the details of all nodes of the category tree hierarchy (the subtree) below a specified category of a category tree. You identify the tree using the <b>category_tree_id</b> parameter, which was returned by the <b>getDefaultCategoryTreeId</b> call in the <b>categoryTreeId</b> field.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> This call can return a very large payload, so you are strongly advised to submit the request with the following HTTP header:       <br /><br /><code>&nbsp;&nbsp;Accept-Encoding: application/gzip</code>       <br /><br />With this header (in addition to the required headers described under <a href=\"/api-docs/static/rest-request-components.html#HTTP\">HTTP Request Headers</a>), the call returns the response with <b>gzip</b> compression. </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.get_category_subtree_with_http_info(category_id, category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_id: The unique identifier of the category at the top of the subtree being requested. <br /><br />    <span class=\"tablenote\"> <strong>Note:</strong> If the <b>category_id</b> submitted identifies the root node of the tree, this call returns an error. To retrieve the complete tree, use this value with the <b>getCategoryTree</b> call.                   <br /><br />   If the <b>category_id</b> submitted identifies a leaf node of the tree, the call response will contain information about only that leaf node, which is a valid subtree.   <!-- <br /><br /> This call also returns an error if <b>category_id</b> identifies a deprecated category. This can occur if you routinely cache your category trees. Use the <b>Get Deprecated Categories and Mapping</b> call to determine which current category should be used in place of the deprecated category, and use the <b>getCategoryTree</b> call to update your cached copy of the tree. --> </span> (required)
        :param str category_tree_id: The unique identifier of the eBay category tree from which a category subtree is being requested. (required)
        :return: CategorySubtree
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/category_tree/{category_tree_id}/get_category_subtree', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CategorySubtree',  # 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 get_category_suggestions(self, category_tree_id, q, **kwargs):  # noqa: E501
        """Get Suggested Categories  # noqa: E501

        This call returns an array of category tree leaf nodes in the specified category tree that are considered by eBay to most closely correspond to the query string <b>q</b>. Returned with each suggested node is a localized name for that category (based on the <b>Accept-Language</b> header specified for the call), and details about each of the category's ancestor nodes, extending from its immediate parent up to the root of the category tree.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> This call can return a large payload, so you are advised to submit the request with the following HTTP header:<br /><br /><code>&nbsp;&nbsp;Accept-Encoding: application/gzip</code><br /><br />              With this header (in addition to the required headers described under <a href=\"/api-docs/static/rest-request-components.html#HTTP\">HTTP Request Headers</a>), the call returns the response with <b>gzip</b> compression. </span><br /><br />You identify the tree using the <b>category_tree_id</b> parameter, which was returned by the <b>getDefaultCategoryTreeId</b> call in the <b>categoryTreeId</b> field.<br /><br /><span class=\"tablenote\"> <strong><span style=\"color:red\">Important:</span></strong> This call is not supported in the Sandbox environment. It will return a response payload in which the <b>categoryName</b> fields contain random or boilerplate text regardless of the query submitted. </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.get_category_suggestions(category_tree_id, q, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: The unique identifier of the eBay category tree for which suggested nodes are being requested. (required)
        :param str q: A quoted string that describes or characterizes the item being offered for sale. The string format is free form, and can contain any combination of phrases or keywords. eBay will parse the string and return suggested categories for the item. (required)
        :return: CategorySuggestionResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_category_suggestions_with_http_info(category_tree_id, q, **kwargs)  # noqa: E501
        else:
            (data) = self.get_category_suggestions_with_http_info(category_tree_id, q, **kwargs)  # noqa: E501
            return data

    def get_category_suggestions_with_http_info(self, category_tree_id, q, **kwargs):  # noqa: E501
        """Get Suggested Categories  # noqa: E501

        This call returns an array of category tree leaf nodes in the specified category tree that are considered by eBay to most closely correspond to the query string <b>q</b>. Returned with each suggested node is a localized name for that category (based on the <b>Accept-Language</b> header specified for the call), and details about each of the category's ancestor nodes, extending from its immediate parent up to the root of the category tree.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> This call can return a large payload, so you are advised to submit the request with the following HTTP header:<br /><br /><code>&nbsp;&nbsp;Accept-Encoding: application/gzip</code><br /><br />              With this header (in addition to the required headers described under <a href=\"/api-docs/static/rest-request-components.html#HTTP\">HTTP Request Headers</a>), the call returns the response with <b>gzip</b> compression. </span><br /><br />You identify the tree using the <b>category_tree_id</b> parameter, which was returned by the <b>getDefaultCategoryTreeId</b> call in the <b>categoryTreeId</b> field.<br /><br /><span class=\"tablenote\"> <strong><span style=\"color:red\">Important:</span></strong> This call is not supported in the Sandbox environment. It will return a response payload in which the <b>categoryName</b> fields contain random or boilerplate text regardless of the query submitted. </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.get_category_suggestions_with_http_info(category_tree_id, q, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: The unique identifier of the eBay category tree for which suggested nodes are being requested. (required)
        :param str q: A quoted string that describes or characterizes the item being offered for sale. The string format is free form, and can contain any combination of phrases or keywords. eBay will parse the string and return suggested categories for the item. (required)
        :return: CategorySuggestionResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['category_tree_id', 'q']  # 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_category_suggestions" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'category_tree_id' is set
        if ('category_tree_id' not in params or
                params['category_tree_id'] is None):
            raise ValueError("Missing the required parameter `category_tree_id` when calling `get_category_suggestions`")  # noqa: E501
        # verify the required parameter 'q' is set
        if ('q' not in params or
                params['q'] is None):
            raise ValueError("Missing the required parameter `q` when calling `get_category_suggestions`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'q' in params:
            query_params.append(('q', params['q']))  # 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 = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/category_tree/{category_tree_id}/get_category_suggestions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CategorySuggestionResponse',  # 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 get_category_tree(self, category_tree_id, **kwargs):  # noqa: E501
        """Get a Category Tree  # noqa: E501

        This call retrieves the complete category tree that is identified by the <b>category_tree_id</b> parameter. The value of <b>category_tree_id</b> was returned by the <b>getDefaultCategoryTreeId</b> call in the <b>categoryTreeId</b> field. The response contains details of all nodes of the specified eBay category tree, as well as the eBay marketplaces that use this category tree.      <br /><br />            <span class=\"tablenote\"> <strong>Note:</strong> This call can return a very large payload, so you are strongly advised to submit the request with the following HTTP header:       <br /><br />     <code>&nbsp;&nbsp;Accept-Encoding: application/gzip</code>       <br /><br />             With this header (in addition to the required headers described under <a href=\"/api-docs/static/rest-request-components.html#HTTP\">HTTP Request Headers</a>), the call returns the response with <b>gzip</b> compression.</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.get_category_tree(category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: The unique identifier of the eBay category tree being requested. (required)
        :return: CategoryTree
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_category_tree_with_http_info(category_tree_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_category_tree_with_http_info(category_tree_id, **kwargs)  # noqa: E501
            return data

    def get_category_tree_with_http_info(self, category_tree_id, **kwargs):  # noqa: E501
        """Get a Category Tree  # noqa: E501

        This call retrieves the complete category tree that is identified by the <b>category_tree_id</b> parameter. The value of <b>category_tree_id</b> was returned by the <b>getDefaultCategoryTreeId</b> call in the <b>categoryTreeId</b> field. The response contains details of all nodes of the specified eBay category tree, as well as the eBay marketplaces that use this category tree.      <br /><br />            <span class=\"tablenote\"> <strong>Note:</strong> This call can return a very large payload, so you are strongly advised to submit the request with the following HTTP header:       <br /><br />     <code>&nbsp;&nbsp;Accept-Encoding: application/gzip</code>       <br /><br />             With this header (in addition to the required headers described under <a href=\"/api-docs/static/rest-request-components.html#HTTP\">HTTP Request Headers</a>), the call returns the response with <b>gzip</b> compression.</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.get_category_tree_with_http_info(category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: The unique identifier of the eBay category tree being requested. (required)
        :return: CategoryTree
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/category_tree/{category_tree_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CategoryTree',  # 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 get_compatibility_properties(self, category_tree_id, category_id, **kwargs):  # noqa: E501
        """Get Compatibility Properties  # noqa: E501

        This call retrieves the compatible vehicle aspects that are used to define a motor vehicle that is compatible with a motor vehicle part or accessory. The values that are retrieved here might include motor vehicle aspects such as 'Make', 'Model', 'Year', 'Engine', and 'Trim', and each of these aspects are localized for the eBay marketplace.<br/><br/> The <strong>category_tree_id</strong> value is passed in as a path parameter, and this value identifies the eBay category tree. The <strong>category_id</strong> value is passed in as a query parameter, as this parameter is also required. The specified category must be a category that supports parts compatibility.<br/><br/> At this time, this operation only supports parts and accessories listings for cars, trucks, and motorcycles (not boats,  power sports, or any other vehicle types). Only the following eBay marketplaces support parts compatibility:<ul><li>eBay US (Motors and non-Motors categories)</li><li>eBay Canada (Motors and non-Motors categories)</li><li>eBay UK</li><li>eBay Germany</li><li>eBay Australia</li><li>eBay France</li><li>eBay Italy</li><li>eBay Spain</li></ul>  # 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_compatibility_properties(category_tree_id, category_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: This is the unique identifier of category tree. The following is the list of <strong>category_tree_id</strong> values and the eBay marketplaces that they represent. One of these ID values must be passed in as a path parameter, and the <strong>category_id</strong> value, that is passed in as query parameter, must be a valid eBay category on that eBay marketplace that supports parts compatibility for cars, trucks, or motorcyles.<br/><br/><ul><li>eBay US: 0</li><li>eBay Motors US: 100</li><li>eBay Canada: 2</li><li>eBay UK: 3</li><li>eBay Germany: 77</li><li>eBay Australia: 15</li><li>eBay France: 71</li><li>eBay Italy: 101</li><li>eBay Spain: 186</li></ul> (required)
        :param str category_id: The unique identifier of an eBay category. This eBay category must be a valid eBay category on the specified eBay marketplace, and the category must support parts compatibility for cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method of the Selling Metadata API can be used to retrieve all eBay categories for an eBay marketplace that supports parts compatibility cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method can also be used to see if one or more specific eBay categories support parts compatibility. (required)
        :return: GetCompatibilityMetadataResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_compatibility_properties_with_http_info(category_tree_id, category_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_compatibility_properties_with_http_info(category_tree_id, category_id, **kwargs)  # noqa: E501
            return data

    def get_compatibility_properties_with_http_info(self, category_tree_id, category_id, **kwargs):  # noqa: E501
        """Get Compatibility Properties  # noqa: E501

        This call retrieves the compatible vehicle aspects that are used to define a motor vehicle that is compatible with a motor vehicle part or accessory. The values that are retrieved here might include motor vehicle aspects such as 'Make', 'Model', 'Year', 'Engine', and 'Trim', and each of these aspects are localized for the eBay marketplace.<br/><br/> The <strong>category_tree_id</strong> value is passed in as a path parameter, and this value identifies the eBay category tree. The <strong>category_id</strong> value is passed in as a query parameter, as this parameter is also required. The specified category must be a category that supports parts compatibility.<br/><br/> At this time, this operation only supports parts and accessories listings for cars, trucks, and motorcycles (not boats,  power sports, or any other vehicle types). Only the following eBay marketplaces support parts compatibility:<ul><li>eBay US (Motors and non-Motors categories)</li><li>eBay Canada (Motors and non-Motors categories)</li><li>eBay UK</li><li>eBay Germany</li><li>eBay Australia</li><li>eBay France</li><li>eBay Italy</li><li>eBay Spain</li></ul>  # 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_compatibility_properties_with_http_info(category_tree_id, category_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: This is the unique identifier of category tree. The following is the list of <strong>category_tree_id</strong> values and the eBay marketplaces that they represent. One of these ID values must be passed in as a path parameter, and the <strong>category_id</strong> value, that is passed in as query parameter, must be a valid eBay category on that eBay marketplace that supports parts compatibility for cars, trucks, or motorcyles.<br/><br/><ul><li>eBay US: 0</li><li>eBay Motors US: 100</li><li>eBay Canada: 2</li><li>eBay UK: 3</li><li>eBay Germany: 77</li><li>eBay Australia: 15</li><li>eBay France: 71</li><li>eBay Italy: 101</li><li>eBay Spain: 186</li></ul> (required)
        :param str category_id: The unique identifier of an eBay category. This eBay category must be a valid eBay category on the specified eBay marketplace, and the category must support parts compatibility for cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method of the Selling Metadata API can be used to retrieve all eBay categories for an eBay marketplace that supports parts compatibility cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method can also be used to see if one or more specific eBay categories support parts compatibility. (required)
        :return: GetCompatibilityMetadataResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/category_tree/{category_tree_id}/get_compatibility_properties', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetCompatibilityMetadataResponse',  # 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 get_compatibility_property_values(self, category_tree_id, compatibility_property, category_id, **kwargs):  # noqa: E501
        """Get Compatibility Property Values  # noqa: E501

        This call retrieves applicable compatible vehicle property values based on the specified eBay marketplace, specified eBay category, and filters used in the request. Compatible vehicle properties are returned in the <strong>compatibilityProperties.name</strong> field of a <strong>getCompatibilityProperties</strong> response. <br/><br/> One compatible vehicle property applicable to the specified eBay marketplace and eBay category is specified through the required <strong>compatibility_property</strong> filter. Then, the user has the option of further restricting the compatible vehicle property values that are returned in the response by specifying one or more compatible vehicle property name/value pairs through the <strong>filter</strong> query parameter.<br/><br/> See the documentation in <strong>URI parameters</strong> section for more information on using the <strong>compatibility_property</strong> and <strong>filter</strong> query parameters together to customize the data that is retrieved.  # 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_compatibility_property_values(category_tree_id, compatibility_property, category_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: This is the unique identifier of the category tree. The following is the list of <strong>category_tree_id</strong> values and the eBay marketplaces that they represent. One of these ID values must be passed in as a path parameter, and the <strong>category_id</strong> value, that is passed in as query parameter, must be a valid eBay category on that eBay marketplace that supports parts compatibility for cars, trucks, or motorcyles.<br/><br/><ul><li>eBay US: 0</li><li>eBay Motors US: 100</li><li>eBay Canada: 2</li><li>eBay UK: 3</li><li>eBay Germany: 77</li><li>eBay Australia: 15</li><li>eBay France: 71</li><li>eBay Italy: 101</li><li>eBay Spain: 186</li></ul> (required)
        :param str compatibility_property: One compatible vehicle property applicable to the specified eBay marketplace and eBay category is specified in this required filter. Compatible vehicle properties are returned in the <strong>compatibilityProperties.name</strong> field of a <strong>getCompatibilityProperties</strong> response. <br/><br/> For example, if you wanted to retrieve all vehicle trims for a 2018 Toyota Camry, you would set this filter as follows: <code>compatibility_property=Trim</code>; and then include the following three name/value filters through one <strong>filter</strong> parameter: <code>filter=Year:2018,Make:Toyota,Model:Camry</code>. So, putting this all together, your URI would look something like this:<br/><br/><pre><code>GET https://api.ebay.com/commerce/<br/>taxonomy/v1/category_tree/100/<br/>get_compatibility_property_values?<br/><strong>category_id</strong>=6016&<strong>compatibility_property</strong>=Trim<br/>&<strong>filter</strong>=filter=Year:2018,Make:Toyota,Model:Camry</code></pre> (required)
        :param str category_id: The unique identifier of an eBay category. This eBay category must be a valid eBay category on the specified eBay marketplace, and the category must support parts compatibility for cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method of the Selling Metadata API can be used to retrieve all eBay categories for an eBay marketplace that supports parts compatibility cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method can also be used to see if one or more specific eBay categories support parts compatibility. (required)
        :param str filter: One or more compatible vehicle property name/value pairs are passed in through this query parameter. The compatible vehicle property name and corresponding value are delimited with a colon (:), such as <code>filter=Year:2018</code>, and multiple compatible vehicle property name/value pairs are delimited with a comma (,). <br/><br/> For example, if you wanted to retrieve all vehicle trims for a 2018 Toyota Camry, you would set the <strong>compatibility_property</strong> filter as follows: <code>compatibility_property=Trim</code>; and then include the following three name/value filters through one <strong>filter</strong> parameter: <code>filter=Year:2018,Make:Toyota,Model:Camry</code>. So, putting this all together, your URI would look something like this:<br/><br/><pre><code>GET https://api.ebay.com/commerce/<br/>taxonomy/v1/category_tree/100/<br/>get_compatibility_property_values?<br/><strong>category_id</strong>=6016&<strong>compatibility_property</strong>=Trim<br/>&<strong>filter</strong>=filter=Year:2018,Make:Toyota,Model:Camry</code></pre> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/commerce/taxonomy/types/txn:ConstraintFilter
        :return: GetCompatibilityPropertyValuesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_compatibility_property_values_with_http_info(category_tree_id, compatibility_property, category_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_compatibility_property_values_with_http_info(category_tree_id, compatibility_property, category_id, **kwargs)  # noqa: E501
            return data

    def get_compatibility_property_values_with_http_info(self, category_tree_id, compatibility_property, category_id, **kwargs):  # noqa: E501
        """Get Compatibility Property Values  # noqa: E501

        This call retrieves applicable compatible vehicle property values based on the specified eBay marketplace, specified eBay category, and filters used in the request. Compatible vehicle properties are returned in the <strong>compatibilityProperties.name</strong> field of a <strong>getCompatibilityProperties</strong> response. <br/><br/> One compatible vehicle property applicable to the specified eBay marketplace and eBay category is specified through the required <strong>compatibility_property</strong> filter. Then, the user has the option of further restricting the compatible vehicle property values that are returned in the response by specifying one or more compatible vehicle property name/value pairs through the <strong>filter</strong> query parameter.<br/><br/> See the documentation in <strong>URI parameters</strong> section for more information on using the <strong>compatibility_property</strong> and <strong>filter</strong> query parameters together to customize the data that is retrieved.  # 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_compatibility_property_values_with_http_info(category_tree_id, compatibility_property, category_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_tree_id: This is the unique identifier of the category tree. The following is the list of <strong>category_tree_id</strong> values and the eBay marketplaces that they represent. One of these ID values must be passed in as a path parameter, and the <strong>category_id</strong> value, that is passed in as query parameter, must be a valid eBay category on that eBay marketplace that supports parts compatibility for cars, trucks, or motorcyles.<br/><br/><ul><li>eBay US: 0</li><li>eBay Motors US: 100</li><li>eBay Canada: 2</li><li>eBay UK: 3</li><li>eBay Germany: 77</li><li>eBay Australia: 15</li><li>eBay France: 71</li><li>eBay Italy: 101</li><li>eBay Spain: 186</li></ul> (required)
        :param str compatibility_property: One compatible vehicle property applicable to the specified eBay marketplace and eBay category is specified in this required filter. Compatible vehicle properties are returned in the <strong>compatibilityProperties.name</strong> field of a <strong>getCompatibilityProperties</strong> response. <br/><br/> For example, if you wanted to retrieve all vehicle trims for a 2018 Toyota Camry, you would set this filter as follows: <code>compatibility_property=Trim</code>; and then include the following three name/value filters through one <strong>filter</strong> parameter: <code>filter=Year:2018,Make:Toyota,Model:Camry</code>. So, putting this all together, your URI would look something like this:<br/><br/><pre><code>GET https://api.ebay.com/commerce/<br/>taxonomy/v1/category_tree/100/<br/>get_compatibility_property_values?<br/><strong>category_id</strong>=6016&<strong>compatibility_property</strong>=Trim<br/>&<strong>filter</strong>=filter=Year:2018,Make:Toyota,Model:Camry</code></pre> (required)
        :param str category_id: The unique identifier of an eBay category. This eBay category must be a valid eBay category on the specified eBay marketplace, and the category must support parts compatibility for cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method of the Selling Metadata API can be used to retrieve all eBay categories for an eBay marketplace that supports parts compatibility cars, trucks, or motorcyles. The <strong>getAutomotivePartsCompatibilityPolicies</strong> method can also be used to see if one or more specific eBay categories support parts compatibility. (required)
        :param str filter: One or more compatible vehicle property name/value pairs are passed in through this query parameter. The compatible vehicle property name and corresponding value are delimited with a colon (:), such as <code>filter=Year:2018</code>, and multiple compatible vehicle property name/value pairs are delimited with a comma (,). <br/><br/> For example, if you wanted to retrieve all vehicle trims for a 2018 Toyota Camry, you would set the <strong>compatibility_property</strong> filter as follows: <code>compatibility_property=Trim</code>; and then include the following three name/value filters through one <strong>filter</strong> parameter: <code>filter=Year:2018,Make:Toyota,Model:Camry</code>. So, putting this all together, your URI would look something like this:<br/><br/><pre><code>GET https://api.ebay.com/commerce/<br/>taxonomy/v1/category_tree/100/<br/>get_compatibility_property_values?<br/><strong>category_id</strong>=6016&<strong>compatibility_property</strong>=Trim<br/>&<strong>filter</strong>=filter=Year:2018,Make:Toyota,Model:Camry</code></pre> For implementation help, refer to eBay API documentation at https://developer.ebay.com/api-docs/commerce/taxonomy/types/txn:ConstraintFilter
        :return: GetCompatibilityPropertyValuesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['category_tree_id', 'compatibility_property', 'category_id', 'filter']  # 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_compatibility_property_values" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'category_tree_id' is set
        if ('category_tree_id' not in params or
                params['category_tree_id'] is None):
            raise ValueError("Missing the required parameter `category_tree_id` when calling `get_compatibility_property_values`")  # noqa: E501
        # verify the required parameter 'compatibility_property' is set
        if ('compatibility_property' not in params or
                params['compatibility_property'] is None):
            raise ValueError("Missing the required parameter `compatibility_property` when calling `get_compatibility_property_values`")  # noqa: E501
        # verify the required parameter 'category_id' is set
        if ('category_id' not in params or
                params['category_id'] is None):
            raise ValueError("Missing the required parameter `category_id` when calling `get_compatibility_property_values`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'compatibility_property' in params:
            query_params.append(('compatibility_property', params['compatibility_property']))  # noqa: E501
        if 'category_id' in params:
            query_params.append(('category_id', params['category_id']))  # noqa: E501
        if 'filter' in params:
            query_params.append(('filter', params['filter']))  # 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 = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/category_tree/{category_tree_id}/get_compatibility_property_values', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetCompatibilityPropertyValuesResponse',  # 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 get_default_category_tree_id(self, marketplace_id, **kwargs):  # noqa: E501
        """Get a Default Category Tree ID  # noqa: E501

        A given eBay marketplace might use multiple category trees, but one of those trees is considered to be the default for that marketplace. This call retrieves a reference to the default category tree associated with the specified eBay marketplace ID. The response includes only the tree's unique identifier and version, which you can use to retrieve more details about the tree, its structure, and its individual category nodes.  # 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_default_category_tree_id(marketplace_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: The ID of the eBay marketplace for which the category tree ID is being requested. For a list of supported marketplace IDs, see <a href=\"/api-docs/commerce/taxonomy/static/supportedmarketplaces.html\">Marketplaces with Default Category Trees</a>. (required)
        :param str accept_language: A header used to indicate the natural language the seller prefers for the response.<br /><br />This specifies the language that the seller wants to use when the field values provided in the request body are displayed to consumers.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> For details, see <i>Accept-Language</i> in <a href=\"/api-docs/static/rest-request-components.html#headers\">HTTP request headers</a>.</span><br /><br /><b>Valid Values:</b> <ul><li>For EBAY_CA in French:<br /><code>Accept-Language: fr-CA</code></li><li>For EBAY_BE in French:<br /><code>Accept-Language: fr-BE</code></li></ul>
        :return: BaseCategoryTree
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_default_category_tree_id_with_http_info(marketplace_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_default_category_tree_id_with_http_info(marketplace_id, **kwargs)  # noqa: E501
            return data

    def get_default_category_tree_id_with_http_info(self, marketplace_id, **kwargs):  # noqa: E501
        """Get a Default Category Tree ID  # noqa: E501

        A given eBay marketplace might use multiple category trees, but one of those trees is considered to be the default for that marketplace. This call retrieves a reference to the default category tree associated with the specified eBay marketplace ID. The response includes only the tree's unique identifier and version, which you can use to retrieve more details about the tree, its structure, and its individual category nodes.  # 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_default_category_tree_id_with_http_info(marketplace_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str marketplace_id: The ID of the eBay marketplace for which the category tree ID is being requested. For a list of supported marketplace IDs, see <a href=\"/api-docs/commerce/taxonomy/static/supportedmarketplaces.html\">Marketplaces with Default Category Trees</a>. (required)
        :param str accept_language: A header used to indicate the natural language the seller prefers for the response.<br /><br />This specifies the language that the seller wants to use when the field values provided in the request body are displayed to consumers.<br /><br /><span class=\"tablenote\"> <strong>Note:</strong> For details, see <i>Accept-Language</i> in <a href=\"/api-docs/static/rest-request-components.html#headers\">HTTP request headers</a>.</span><br /><br /><b>Valid Values:</b> <ul><li>For EBAY_CA in French:<br /><code>Accept-Language: fr-CA</code></li><li>For EBAY_BE in French:<br /><code>Accept-Language: fr-BE</code></li></ul>
        :return: BaseCategoryTree
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

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

        header_params = {}
        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(
            '/get_default_category_tree_id', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BaseCategoryTree',  # 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 get_item_aspects_for_category(self, category_id, category_tree_id, **kwargs):  # noqa: E501
        """get_item_aspects_for_category  # noqa: E501

        This call returns a list of <i>aspects</i> that are appropriate or necessary for accurately describing items in the specified leaf category. Each aspect identifies an item attribute (for example, color) for which the seller will be required or encouraged to provide a value (or variation values) when offering an item in that category on eBay.<br /><br />For each aspect, <b>getItemAspectsForCategory</b> provides complete metadata, including: <ul> <li>The aspect's data type, format, and entry mode</li> <li>Whether the aspect is required in listings</li> <li>Whether the aspect can be used for item variations</li> <li>Whether the aspect accepts multiple values for an item</li> <li>Allowed values for the aspect</li> </ul> Use this information to construct an interface through which sellers can enter or select the appropriate values for their items or item variations. Once you collect those values, include them as product aspects when creating inventory items using the Inventory 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_aspects_for_category(category_id, category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_id: The unique identifier of the leaf category for which aspects are being requested.          <br /><br />                 <span class=\"tablenote\"> <strong>Note:</strong> If the <b>category_id</b> submitted does not identify a leaf node of the tree, this call returns an error. </span> (required)
        :param str category_tree_id: The unique identifier of the eBay category tree from which the specified category's aspects are being requested. (required)
        :return: AspectMetadata
                 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_aspects_for_category_with_http_info(category_id, category_tree_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_item_aspects_for_category_with_http_info(category_id, category_tree_id, **kwargs)  # noqa: E501
            return data

    def get_item_aspects_for_category_with_http_info(self, category_id, category_tree_id, **kwargs):  # noqa: E501
        """get_item_aspects_for_category  # noqa: E501

        This call returns a list of <i>aspects</i> that are appropriate or necessary for accurately describing items in the specified leaf category. Each aspect identifies an item attribute (for example, color) for which the seller will be required or encouraged to provide a value (or variation values) when offering an item in that category on eBay.<br /><br />For each aspect, <b>getItemAspectsForCategory</b> provides complete metadata, including: <ul> <li>The aspect's data type, format, and entry mode</li> <li>Whether the aspect is required in listings</li> <li>Whether the aspect can be used for item variations</li> <li>Whether the aspect accepts multiple values for an item</li> <li>Allowed values for the aspect</li> </ul> Use this information to construct an interface through which sellers can enter or select the appropriate values for their items or item variations. Once you collect those values, include them as product aspects when creating inventory items using the Inventory 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_aspects_for_category_with_http_info(category_id, category_tree_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str category_id: The unique identifier of the leaf category for which aspects are being requested.          <br /><br />                 <span class=\"tablenote\"> <strong>Note:</strong> If the <b>category_id</b> submitted does not identify a leaf node of the tree, this call returns an error. </span> (required)
        :param str category_tree_id: The unique identifier of the eBay category tree from which the specified category's aspects are being requested. (required)
        :return: AspectMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/category_tree/{category_tree_id}/get_item_aspects_for_category', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AspectMetadata',  # 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)
