text: # coding: utf-8
  
  """
      OrderCloud
  
      No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
  
      OpenAPI spec version: 1.0
      Contact: ordercloud@four51.com
      Generated by: https://github.com/swagger-api/swagger-codegen.git
  
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
  
          http://www.apache.org/licenses/LICENSE-2.0
  
      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
  """
  
  from __future__ import absolute_import
  
  import sys
  import os
  import re
  
  # python 2 and python 3 compatibility library
  from six import iteritems
  
  from ..configuration import Configuration
  from ..api_client import ApiClient
  
  
  class CategoryApi(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):
          config = Configuration()
          if api_client:
              self.api_client = api_client
          else:
              if not config.api_client:
                  config.api_client = ApiClient()
              self.api_client = config.api_client
  
      def create(self, catalog_id, category, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.create(catalog_id, category, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param Category category:  (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.create_with_http_info(catalog_id, category, **kwargs)
          else:
              (data) = self.create_with_http_info(catalog_id, category, **kwargs)
              return data
  
      def create_with_http_info(self, catalog_id, category, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.create_with_http_info(catalog_id, category, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param Category category:  (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method create" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `create`")
          # verify the required parameter 'category' is set
          if ('category' not in params) or (params['category'] is None):
              raise ValueError("Missing the required parameter `category` when calling `create`")
  
          resource_path = '/catalogs/{catalogID}/categories'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
  
          query_params = {}
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'category' in params:
              body_params = params['category']
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'POST',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type='Category',
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def delete(self, catalog_id, category_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete(catalog_id, category_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.delete_with_http_info(catalog_id, category_id, **kwargs)
          else:
              (data) = self.delete_with_http_info(catalog_id, category_id, **kwargs)
              return data
  
      def delete_with_http_info(self, catalog_id, category_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete_with_http_info(catalog_id, category_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method delete" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `delete`")
          # 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 `delete`")
  
          resource_path = '/catalogs/{catalogID}/categories/{categoryID}'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
          if 'category_id' in params:
              path_params['categoryID'] = params['category_id']
  
          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'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'DELETE',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type=None,
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def delete_assignment(self, catalog_id, category_id, buyer_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete_assignment(catalog_id, category_id, buyer_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param str buyer_id: ID of the buyer. (required)
          :param str user_id: ID of the user.
          :param str user_group_id: ID of the user group.
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.delete_assignment_with_http_info(catalog_id, category_id, buyer_id, **kwargs)
          else:
              (data) = self.delete_assignment_with_http_info(catalog_id, category_id, buyer_id, **kwargs)
              return data
  
      def delete_assignment_with_http_info(self, catalog_id, category_id, buyer_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete_assignment_with_http_info(catalog_id, category_id, buyer_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param str buyer_id: ID of the buyer. (required)
          :param str user_id: ID of the user.
          :param str user_group_id: ID of the user group.
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id', 'buyer_id', 'user_id', 'user_group_id']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method delete_assignment" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `delete_assignment`")
          # 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 `delete_assignment`")
          # verify the required parameter 'buyer_id' is set
          if ('buyer_id' not in params) or (params['buyer_id'] is None):
              raise ValueError("Missing the required parameter `buyer_id` when calling `delete_assignment`")
  
          resource_path = '/catalogs/{catalogID}/categories/{categoryID}/assignments'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
          if 'category_id' in params:
              path_params['categoryID'] = params['category_id']
  
          query_params = {}
          if 'buyer_id' in params:
              query_params['buyerID'] = params['buyer_id']
          if 'user_id' in params:
              query_params['userID'] = params['user_id']
          if 'user_group_id' in params:
              query_params['userGroupID'] = params['user_group_id']
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'DELETE',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type=None,
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def delete_product_assignment(self, catalog_id, category_id, product_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete_product_assignment(catalog_id, category_id, product_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param str product_id: ID of the product. (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.delete_product_assignment_with_http_info(catalog_id, category_id, product_id, **kwargs)
          else:
              (data) = self.delete_product_assignment_with_http_info(catalog_id, category_id, product_id, **kwargs)
              return data
  
      def delete_product_assignment_with_http_info(self, catalog_id, category_id, product_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete_product_assignment_with_http_info(catalog_id, category_id, product_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param str product_id: ID of the product. (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id', 'product_id']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method delete_product_assignment" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `delete_product_assignment`")
          # 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 `delete_product_assignment`")
          # verify the required parameter 'product_id' is set
          if ('product_id' not in params) or (params['product_id'] is None):
              raise ValueError("Missing the required parameter `product_id` when calling `delete_product_assignment`")
  
          resource_path = '/catalogs/{catalogID}/categories/{categoryID}/productassignments/{productID}'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
          if 'category_id' in params:
              path_params['categoryID'] = params['category_id']
          if 'product_id' in params:
              path_params['productID'] = params['product_id']
  
          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'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'DELETE',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type=None,
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def get(self, catalog_id, category_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.get(catalog_id, category_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.get_with_http_info(catalog_id, category_id, **kwargs)
          else:
              (data) = self.get_with_http_info(catalog_id, category_id, **kwargs)
              return data
  
      def get_with_http_info(self, catalog_id, category_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.get_with_http_info(catalog_id, category_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method get" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `get`")
          # 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`")
  
          resource_path = '/catalogs/{catalogID}/categories/{categoryID}'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
          if 'category_id' in params:
              path_params['categoryID'] = params['category_id']
  
          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'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'GET',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type='Category',
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def list(self, catalog_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.list(catalog_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str depth: Depth of the category.
          :param str search: Word or phrase to search for.
          :param str search_on: Comma-delimited list of fields to search on.
          :param str sort_by: Comma-delimited list of fields to sort by.
          :param int page: Page of results to return. Default: 1
          :param int page_size: Number of results to return per page. Default: 20, max: 100.
          :param dict(str, str) filters: Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
          :return: ListCategory
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.list_with_http_info(catalog_id, **kwargs)
          else:
              (data) = self.list_with_http_info(catalog_id, **kwargs)
              return data
  
      def list_with_http_info(self, catalog_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.list_with_http_info(catalog_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str depth: Depth of the category.
          :param str search: Word or phrase to search for.
          :param str search_on: Comma-delimited list of fields to search on.
          :param str sort_by: Comma-delimited list of fields to sort by.
          :param int page: Page of results to return. Default: 1
          :param int page_size: Number of results to return per page. Default: 20, max: 100.
          :param dict(str, str) filters: Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
          :return: ListCategory
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'depth', 'search', 'search_on', 'sort_by', 'page', 'page_size', 'filters']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method list" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `list`")
  
          resource_path = '/catalogs/{catalogID}/categories'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
  
          query_params = {}
          if 'depth' in params:
              query_params['depth'] = params['depth']
          if 'search' in params:
              query_params['search'] = params['search']
          if 'search_on' in params:
              query_params['searchOn'] = params['search_on']
          if 'sort_by' in params:
              query_params['sortBy'] = params['sort_by']
          if 'page' in params:
              query_params['page'] = params['page']
          if 'page_size' in params:
              query_params['pageSize'] = params['page_size']
          if 'filters' in params:
              query_params['filters'] = params['filters']
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'GET',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type='ListCategory',
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def list_assignments(self, catalog_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.list_assignments(catalog_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category.
          :param str buyer_id: ID of the buyer.
          :param str user_id: ID of the user.
          :param str user_group_id: ID of the user group.
          :param str level: Level of the category assignment. Possible values: User, Group, Company.
          :param int page: Page of results to return. Default: 1
          :param int page_size: Number of results to return per page. Default: 20, max: 100.
          :return: ListCategoryAssignment
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.list_assignments_with_http_info(catalog_id, **kwargs)
          else:
              (data) = self.list_assignments_with_http_info(catalog_id, **kwargs)
              return data
  
      def list_assignments_with_http_info(self, catalog_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.list_assignments_with_http_info(catalog_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category.
          :param str buyer_id: ID of the buyer.
          :param str user_id: ID of the user.
          :param str user_group_id: ID of the user group.
          :param str level: Level of the category assignment. Possible values: User, Group, Company.
          :param int page: Page of results to return. Default: 1
          :param int page_size: Number of results to return per page. Default: 20, max: 100.
          :return: ListCategoryAssignment
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id', 'buyer_id', 'user_id', 'user_group_id', 'level', 'page', 'page_size']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method list_assignments" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `list_assignments`")
  
          resource_path = '/catalogs/{catalogID}/categories/assignments'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
  
          query_params = {}
          if 'category_id' in params:
              query_params['categoryID'] = params['category_id']
          if 'buyer_id' in params:
              query_params['buyerID'] = params['buyer_id']
          if 'user_id' in params:
              query_params['userID'] = params['user_id']
          if 'user_group_id' in params:
              query_params['userGroupID'] = params['user_group_id']
          if 'level' in params:
              query_params['level'] = params['level']
          if 'page' in params:
              query_params['page'] = params['page']
          if 'page_size' in params:
              query_params['pageSize'] = params['page_size']
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'GET',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type='ListCategoryAssignment',
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def list_product_assignments(self, catalog_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.list_product_assignments(catalog_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category.
          :param str product_id: ID of the product.
          :param int page: Page of results to return. Default: 1
          :param int page_size: Number of results to return per page. Default: 20, max: 100.
          :return: ListCategoryProductAssignment
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.list_product_assignments_with_http_info(catalog_id, **kwargs)
          else:
              (data) = self.list_product_assignments_with_http_info(catalog_id, **kwargs)
              return data
  
      def list_product_assignments_with_http_info(self, catalog_id, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.list_product_assignments_with_http_info(catalog_id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category.
          :param str product_id: ID of the product.
          :param int page: Page of results to return. Default: 1
          :param int page_size: Number of results to return per page. Default: 20, max: 100.
          :return: ListCategoryProductAssignment
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id', 'product_id', 'page', 'page_size']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method list_product_assignments" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `list_product_assignments`")
  
          resource_path = '/catalogs/{catalogID}/categories/productassignments'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
  
          query_params = {}
          if 'category_id' in params:
              query_params['categoryID'] = params['category_id']
          if 'product_id' in params:
              query_params['productID'] = params['product_id']
          if 'page' in params:
              query_params['page'] = params['page']
          if 'page_size' in params:
              query_params['pageSize'] = params['page_size']
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'GET',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type='ListCategoryProductAssignment',
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def patch(self, catalog_id, category_id, partial_category, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.patch(catalog_id, category_id, partial_category, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param Category partial_category:  (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.patch_with_http_info(catalog_id, category_id, partial_category, **kwargs)
          else:
              (data) = self.patch_with_http_info(catalog_id, category_id, partial_category, **kwargs)
              return data
  
      def patch_with_http_info(self, catalog_id, category_id, partial_category, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.patch_with_http_info(catalog_id, category_id, partial_category, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param Category partial_category:  (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id', 'partial_category']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method patch" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `patch`")
          # 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 `patch`")
          # verify the required parameter 'partial_category' is set
          if ('partial_category' not in params) or (params['partial_category'] is None):
              raise ValueError("Missing the required parameter `partial_category` when calling `patch`")
  
          resource_path = '/catalogs/{catalogID}/categories/{categoryID}'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
          if 'category_id' in params:
              path_params['categoryID'] = params['category_id']
  
          query_params = {}
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'partial_category' in params:
              body_params = params['partial_category']
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'PATCH',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type='Category',
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def save(self, catalog_id, category_id, category, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.save(catalog_id, category_id, category, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param Category category:  (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.save_with_http_info(catalog_id, category_id, category, **kwargs)
          else:
              (data) = self.save_with_http_info(catalog_id, category_id, category, **kwargs)
              return data
  
      def save_with_http_info(self, catalog_id, category_id, category, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.save_with_http_info(catalog_id, category_id, category, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param str category_id: ID of the category. (required)
          :param Category category:  (required)
          :return: Category
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_id', 'category']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method save" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `save`")
          # 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 `save`")
          # verify the required parameter 'category' is set
          if ('category' not in params) or (params['category'] is None):
              raise ValueError("Missing the required parameter `category` when calling `save`")
  
          resource_path = '/catalogs/{catalogID}/categories/{categoryID}'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
          if 'category_id' in params:
              path_params['categoryID'] = params['category_id']
  
          query_params = {}
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'category' in params:
              body_params = params['category']
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'PUT',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type='Category',
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def save_assignment(self, catalog_id, category_assignment, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.save_assignment(catalog_id, category_assignment, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param CategoryAssignment category_assignment:  (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.save_assignment_with_http_info(catalog_id, category_assignment, **kwargs)
          else:
              (data) = self.save_assignment_with_http_info(catalog_id, category_assignment, **kwargs)
              return data
  
      def save_assignment_with_http_info(self, catalog_id, category_assignment, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.save_assignment_with_http_info(catalog_id, category_assignment, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param CategoryAssignment category_assignment:  (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_assignment']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method save_assignment" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `save_assignment`")
          # verify the required parameter 'category_assignment' is set
          if ('category_assignment' not in params) or (params['category_assignment'] is None):
              raise ValueError("Missing the required parameter `category_assignment` when calling `save_assignment`")
  
          resource_path = '/catalogs/{catalogID}/categories/assignments'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
  
          query_params = {}
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'category_assignment' in params:
              body_params = params['category_assignment']
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'POST',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type=None,
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  
      def save_product_assignment(self, catalog_id, category_product_assignment, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.save_product_assignment(catalog_id, category_product_assignment, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param CategoryProductAssignment category_product_assignment:  (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.save_product_assignment_with_http_info(catalog_id, category_product_assignment, **kwargs)
          else:
              (data) = self.save_product_assignment_with_http_info(catalog_id, category_product_assignment, **kwargs)
              return data
  
      def save_product_assignment_with_http_info(self, catalog_id, category_product_assignment, **kwargs):
          """
          
          
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.save_product_assignment_with_http_info(catalog_id, category_product_assignment, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str catalog_id: ID of the catalog. (required)
          :param CategoryProductAssignment category_product_assignment:  (required)
          :return: None
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['catalog_id', 'category_product_assignment']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method save_product_assignment" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'catalog_id' is set
          if ('catalog_id' not in params) or (params['catalog_id'] is None):
              raise ValueError("Missing the required parameter `catalog_id` when calling `save_product_assignment`")
          # verify the required parameter 'category_product_assignment' is set
          if ('category_product_assignment' not in params) or (params['category_product_assignment'] is None):
              raise ValueError("Missing the required parameter `category_product_assignment` when calling `save_product_assignment`")
  
          resource_path = '/catalogs/{catalogID}/categories/productassignments'.replace('{format}', 'json')
          path_params = {}
          if 'catalog_id' in params:
              path_params['catalogID'] = params['catalog_id']
  
          query_params = {}
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'category_product_assignment' in params:
              body_params = params['category_product_assignment']
  
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
          if not header_params['Accept']:
              del header_params['Accept']
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json', 'text/plain; charset=utf-8'])
  
          # Authentication setting
          auth_settings = ['oauth2']
  
          return self.api_client.call_api(resource_path, 'POST',
                                              path_params,
                                              query_params,
                                              header_params,
                                              body=body_params,
                                              post_params=form_params,
                                              files=local_var_files,
                                              response_type=None,
                                              auth_settings=auth_settings,
                                              callback=params.get('callback'),
                                              _return_http_data_only=params.get('_return_http_data_only'))
  