# coding: utf-8

"""
    tweak-api

    Tweak API to integrate with all the Tweak services.  You can find out more about Tweak      at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.

    OpenAPI spec version: 1.0.8-beta.0
    
    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 ProductApi(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 products_change_stream_get(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_change_stream_get_with_http_info(**kwargs)
        else:
            (data) = self.products_change_stream_get_with_http_info(**kwargs)
            return data

    def products_change_stream_get_with_http_info(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['options']
        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 products_change_stream_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/change-stream'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'options' in params:
            query_params['options'] = params['options']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='file',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_change_stream_post(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_post(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_change_stream_post_with_http_info(**kwargs)
        else:
            (data) = self.products_change_stream_post_with_http_info(**kwargs)
            return data

    def products_change_stream_post_with_http_info(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_post_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['options']
        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 products_change_stream_post" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/change-stream'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'options' in params:
            form_params.append(('options', params['options']))

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='file',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_count_get(self, **kwargs):
        """
        Count instances of the model matched by where from the data source.
        

        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.products_count_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_count_get_with_http_info(**kwargs)
        else:
            (data) = self.products_count_get_with_http_info(**kwargs)
            return data

    def products_count_get_with_http_info(self, **kwargs):
        """
        Count instances of the model matched by where from the data source.
        

        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.products_count_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['where']
        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 products_count_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/count'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'where' in params:
            query_params['where'] = params['where']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='InlineResponse2001',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_find_one_get(self, **kwargs):
        """
        Find first instance of the model matched by filter from the data source.
        

        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.products_find_one_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_find_one_get_with_http_info(**kwargs)
        else:
            (data) = self.products_find_one_get_with_http_info(**kwargs)
            return data

    def products_find_one_get_with_http_info(self, **kwargs):
        """
        Find first instance of the model matched by filter from the data source.
        

        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.products_find_one_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['filter']
        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 products_find_one_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/findOne'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_get(self, **kwargs):
        """
        Find all instances of the model matched by filter from the data source.
        

        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.products_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: list[Product]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_get_with_http_info(**kwargs)
        else:
            (data) = self.products_get_with_http_info(**kwargs)
            return data

    def products_get_with_http_info(self, **kwargs):
        """
        Find all instances of the model matched by filter from the data source.
        

        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.products_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: list[Product]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['filter']
        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 products_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='list[Product]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_delete(self, id, **kwargs):
        """
        Delete a model instance by {{id}} from the data source.
        

        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.products_id_delete(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_delete_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_delete_with_http_info(id, **kwargs)
            return data

    def products_id_delete_with_http_info(self, id, **kwargs):
        """
        Delete a model instance by {{id}} from the data source.
        

        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.products_id_delete_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='object',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_exists_get(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_exists_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_exists_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_exists_get_with_http_info(id, **kwargs)
            return data

    def products_id_exists_get_with_http_info(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_exists_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/exists'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='InlineResponse2002',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_get(self, id, **kwargs):
        """
        Find a model instance by {{id}} from the data source.
        

        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.products_id_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_get_with_http_info(id, **kwargs)
            return data

    def products_id_get_with_http_info(self, id, **kwargs):
        """
        Find a model instance by {{id}} from the data source.
        

        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.products_id_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_head(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_head(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_head_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_head_with_http_info(id, **kwargs)
            return data

    def products_id_head_with_http_info(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_head_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        return self.api_client.call_api(resource_path, 'HEAD',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='InlineResponse2002',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_patch(self, id, **kwargs):
        """
        Patch attributes for a model instance and persist it into the data source.
        

        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.products_id_patch(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Product data: An object of model property name/value pairs
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_patch_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_patch_with_http_info(id, **kwargs)
            return data

    def products_id_patch_with_http_info(self, id, **kwargs):
        """
        Patch attributes for a model instance and persist it into the data source.
        

        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.products_id_patch_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Product data: An object of model property name/value pairs
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_put(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_put(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_put_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_put_with_http_info(id, **kwargs)
            return data

    def products_id_put_with_http_info(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_put_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_replace_post(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_replace_post(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_replace_post_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_replace_post_with_http_info(id, **kwargs)
            return data

    def products_id_replace_post_with_http_info(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_replace_post_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/replace'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_size_get(self, id, **kwargs):
        """
        Fetches belongsTo relation size.
        

        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.products_id_size_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param bool refresh: 
        :return: ProductSize
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_size_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_size_get_with_http_info(id, **kwargs)
            return data

    def products_id_size_get_with_http_info(self, id, **kwargs):
        """
        Fetches belongsTo relation size.
        

        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.products_id_size_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param bool refresh: 
        :return: ProductSize
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/size'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'refresh' in params:
            query_params['refresh'] = params['refresh']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='ProductSize',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_count_get(self, id, **kwargs):
        """
        Counts tags of Product.
        

        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.products_id_tags_count_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_count_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_tags_count_get_with_http_info(id, **kwargs)
            return data

    def products_id_tags_count_get_with_http_info(self, id, **kwargs):
        """
        Counts tags of Product.
        

        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.products_id_tags_count_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/count'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'where' in params:
            query_params['where'] = params['where']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='InlineResponse2001',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_fk_delete(self, id, fk, **kwargs):
        """
        Delete a related item by id for tags.
        

        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.products_id_tags_fk_delete(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (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.products_id_tags_fk_delete_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_fk_delete_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_fk_delete_with_http_info(self, id, fk, **kwargs):
        """
        Delete a related item by id for tags.
        

        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.products_id_tags_fk_delete_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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'),
                                            collection_formats=collection_formats)

    def products_id_tags_fk_get(self, id, fk, **kwargs):
        """
        Find a related item by id for tags.
        

        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.products_id_tags_fk_get(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_fk_get_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_fk_get_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_fk_get_with_http_info(self, id, fk, **kwargs):
        """
        Find a related item by id for tags.
        

        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.products_id_tags_fk_get_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Tag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_fk_put(self, id, fk, **kwargs):
        """
        Update a related item by id for tags.
        

        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.products_id_tags_fk_put(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_fk_put_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_fk_put_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_fk_put_with_http_info(self, id, fk, **kwargs):
        """
        Update a related item by id for tags.
        

        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.products_id_tags_fk_put_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Tag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_get(self, id, **kwargs):
        """
        Queries tags of Product.
        

        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.products_id_tags_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str filter: 
        :return: list[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_tags_get_with_http_info(id, **kwargs)
            return data

    def products_id_tags_get_with_http_info(self, id, **kwargs):
        """
        Queries tags of Product.
        

        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.products_id_tags_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str filter: 
        :return: list[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='list[Tag]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_post(self, id, **kwargs):
        """
        Creates a new instance in tags of this model.
        

        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.products_id_tags_post(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_post_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_tags_post_with_http_info(id, **kwargs)
            return data

    def products_id_tags_post_with_http_info(self, id, **kwargs):
        """
        Creates a new instance in tags of this model.
        

        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.products_id_tags_post_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Tag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_rel_fk_delete(self, id, fk, **kwargs):
        """
        Remove the tags relation to an item by id.
        

        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.products_id_tags_rel_fk_delete(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (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.products_id_tags_rel_fk_delete_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_rel_fk_delete_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_rel_fk_delete_with_http_info(self, id, fk, **kwargs):
        """
        Remove the tags relation to an item by id.
        

        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.products_id_tags_rel_fk_delete_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/rel/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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'),
                                            collection_formats=collection_formats)

    def products_id_tags_rel_fk_head(self, id, fk, **kwargs):
        """
        Check the existence of tags relation to an item by id.
        

        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.products_id_tags_rel_fk_head(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_rel_fk_head_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_rel_fk_head_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_rel_fk_head_with_http_info(self, id, fk, **kwargs):
        """
        Check the existence of tags relation to an item by id.
        

        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.products_id_tags_rel_fk_head_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/rel/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        return self.api_client.call_api(resource_path, 'HEAD',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='bool',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_rel_fk_put(self, id, fk, **kwargs):
        """
        Add a related item by id for tags.
        

        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.products_id_tags_rel_fk_put(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param ProductTag data: 
        :return: ProductTag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_rel_fk_put_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_rel_fk_put_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_rel_fk_put_with_http_info(self, id, fk, **kwargs):
        """
        Add a related item by id for tags.
        

        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.products_id_tags_rel_fk_put_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param ProductTag data: 
        :return: ProductTag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/rel/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='ProductTag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_post(self, **kwargs):
        """
        Create a new instance of the model and persist it into the data source.
        

        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.products_post(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_post_with_http_info(**kwargs)
        else:
            (data) = self.products_post_with_http_info(**kwargs)
            return data

    def products_post_with_http_info(self, **kwargs):
        """
        Create a new instance of the model and persist it into the data source.
        

        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.products_post_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['data']
        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 products_post" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

# coding: utf-8

"""
    tweak-api

    Tweak API to integrate with all the Tweak services.  You can find out more about Tweak      at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.

    OpenAPI spec version: 1.0.8-beta.0
    
    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 ProductApi(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 products_change_stream_get(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_change_stream_get_with_http_info(**kwargs)
        else:
            (data) = self.products_change_stream_get_with_http_info(**kwargs)
            return data

    def products_change_stream_get_with_http_info(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['options']
        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 products_change_stream_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/change-stream'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'options' in params:
            query_params['options'] = params['options']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='file',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_change_stream_post(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_post(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_change_stream_post_with_http_info(**kwargs)
        else:
            (data) = self.products_change_stream_post_with_http_info(**kwargs)
            return data

    def products_change_stream_post_with_http_info(self, **kwargs):
        """
        Create a change stream.
        

        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.products_change_stream_post_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str options: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['options']
        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 products_change_stream_post" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/change-stream'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'options' in params:
            form_params.append(('options', params['options']))

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='file',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_count_get(self, **kwargs):
        """
        Count instances of the model matched by where from the data source.
        

        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.products_count_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_count_get_with_http_info(**kwargs)
        else:
            (data) = self.products_count_get_with_http_info(**kwargs)
            return data

    def products_count_get_with_http_info(self, **kwargs):
        """
        Count instances of the model matched by where from the data source.
        

        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.products_count_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['where']
        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 products_count_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/count'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'where' in params:
            query_params['where'] = params['where']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='InlineResponse2001',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_find_one_get(self, **kwargs):
        """
        Find first instance of the model matched by filter from the data source.
        

        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.products_find_one_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_find_one_get_with_http_info(**kwargs)
        else:
            (data) = self.products_find_one_get_with_http_info(**kwargs)
            return data

    def products_find_one_get_with_http_info(self, **kwargs):
        """
        Find first instance of the model matched by filter from the data source.
        

        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.products_find_one_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['filter']
        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 products_find_one_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products/findOne'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_get(self, **kwargs):
        """
        Find all instances of the model matched by filter from the data source.
        

        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.products_get(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: list[Product]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_get_with_http_info(**kwargs)
        else:
            (data) = self.products_get_with_http_info(**kwargs)
            return data

    def products_get_with_http_info(self, **kwargs):
        """
        Find all instances of the model matched by filter from the data source.
        

        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.products_get_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: list[Product]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['filter']
        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 products_get" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='list[Product]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_delete(self, id, **kwargs):
        """
        Delete a model instance by {{id}} from the data source.
        

        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.products_id_delete(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_delete_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_delete_with_http_info(id, **kwargs)
            return data

    def products_id_delete_with_http_info(self, id, **kwargs):
        """
        Delete a model instance by {{id}} from the data source.
        

        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.products_id_delete_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='object',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_exists_get(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_exists_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_exists_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_exists_get_with_http_info(id, **kwargs)
            return data

    def products_id_exists_get_with_http_info(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_exists_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/exists'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='InlineResponse2002',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_get(self, id, **kwargs):
        """
        Find a model instance by {{id}} from the data source.
        

        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.products_id_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_get_with_http_info(id, **kwargs)
            return data

    def products_id_get_with_http_info(self, id, **kwargs):
        """
        Find a model instance by {{id}} from the data source.
        

        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.products_id_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_head(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_head(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_head_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_head_with_http_info(id, **kwargs)
            return data

    def products_id_head_with_http_info(self, id, **kwargs):
        """
        Check whether a model instance exists in the data source.
        

        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.products_id_head_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        return self.api_client.call_api(resource_path, 'HEAD',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='InlineResponse2002',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_patch(self, id, **kwargs):
        """
        Patch attributes for a model instance and persist it into the data source.
        

        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.products_id_patch(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Product data: An object of model property name/value pairs
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_patch_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_patch_with_http_info(id, **kwargs)
            return data

    def products_id_patch_with_http_info(self, id, **kwargs):
        """
        Patch attributes for a model instance and persist it into the data source.
        

        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.products_id_patch_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Product data: An object of model property name/value pairs
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_put(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_put(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_put_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_put_with_http_info(id, **kwargs)
            return data

    def products_id_put_with_http_info(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_put_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_replace_post(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_replace_post(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_replace_post_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_replace_post_with_http_info(id, **kwargs)
            return data

    def products_id_replace_post_with_http_info(self, id, **kwargs):
        """
        Replace attributes for a model instance and persist it into the data source.
        

        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.products_id_replace_post_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Model id (required)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/replace'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_size_get(self, id, **kwargs):
        """
        Fetches belongsTo relation size.
        

        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.products_id_size_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param bool refresh: 
        :return: ProductSize
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_size_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_size_get_with_http_info(id, **kwargs)
            return data

    def products_id_size_get_with_http_info(self, id, **kwargs):
        """
        Fetches belongsTo relation size.
        

        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.products_id_size_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param bool refresh: 
        :return: ProductSize
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/size'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'refresh' in params:
            query_params['refresh'] = params['refresh']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='ProductSize',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_count_get(self, id, **kwargs):
        """
        Counts tags of Product.
        

        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.products_id_tags_count_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_count_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_tags_count_get_with_http_info(id, **kwargs)
            return data

    def products_id_tags_count_get_with_http_info(self, id, **kwargs):
        """
        Counts tags of Product.
        

        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.products_id_tags_count_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str where: Criteria to match model instances
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/count'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'where' in params:
            query_params['where'] = params['where']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='InlineResponse2001',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_fk_delete(self, id, fk, **kwargs):
        """
        Delete a related item by id for tags.
        

        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.products_id_tags_fk_delete(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (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.products_id_tags_fk_delete_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_fk_delete_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_fk_delete_with_http_info(self, id, fk, **kwargs):
        """
        Delete a related item by id for tags.
        

        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.products_id_tags_fk_delete_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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'),
                                            collection_formats=collection_formats)

    def products_id_tags_fk_get(self, id, fk, **kwargs):
        """
        Find a related item by id for tags.
        

        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.products_id_tags_fk_get(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_fk_get_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_fk_get_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_fk_get_with_http_info(self, id, fk, **kwargs):
        """
        Find a related item by id for tags.
        

        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.products_id_tags_fk_get_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Tag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_fk_put(self, id, fk, **kwargs):
        """
        Update a related item by id for tags.
        

        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.products_id_tags_fk_put(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_fk_put_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_fk_put_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_fk_put_with_http_info(self, id, fk, **kwargs):
        """
        Update a related item by id for tags.
        

        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.products_id_tags_fk_put_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Tag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_get(self, id, **kwargs):
        """
        Queries tags of Product.
        

        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.products_id_tags_get(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str filter: 
        :return: list[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_get_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_tags_get_with_http_info(id, **kwargs)
            return data

    def products_id_tags_get_with_http_info(self, id, **kwargs):
        """
        Queries tags of Product.
        

        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.products_id_tags_get_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str filter: 
        :return: list[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'filter' in params:
            query_params['filter'] = params['filter']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='list[Tag]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_post(self, id, **kwargs):
        """
        Creates a new instance in tags of this model.
        

        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.products_id_tags_post(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_post_with_http_info(id, **kwargs)
        else:
            (data) = self.products_id_tags_post_with_http_info(id, **kwargs)
            return data

    def products_id_tags_post_with_http_info(self, id, **kwargs):
        """
        Creates a new instance in tags of this model.
        

        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.products_id_tags_post_with_http_info(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param Tag data: 
        :return: Tag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Tag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_rel_fk_delete(self, id, fk, **kwargs):
        """
        Remove the tags relation to an item by id.
        

        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.products_id_tags_rel_fk_delete(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (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.products_id_tags_rel_fk_delete_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_rel_fk_delete_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_rel_fk_delete_with_http_info(self, id, fk, **kwargs):
        """
        Remove the tags relation to an item by id.
        

        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.products_id_tags_rel_fk_delete_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/rel/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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'),
                                            collection_formats=collection_formats)

    def products_id_tags_rel_fk_head(self, id, fk, **kwargs):
        """
        Check the existence of tags relation to an item by id.
        

        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.products_id_tags_rel_fk_head(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_rel_fk_head_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_rel_fk_head_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_rel_fk_head_with_http_info(self, id, fk, **kwargs):
        """
        Check the existence of tags relation to an item by id.
        

        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.products_id_tags_rel_fk_head_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/rel/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        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', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        return self.api_client.call_api(resource_path, 'HEAD',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='bool',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_id_tags_rel_fk_put(self, id, fk, **kwargs):
        """
        Add a related item by id for tags.
        

        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.products_id_tags_rel_fk_put(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param ProductTag data: 
        :return: ProductTag
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_id_tags_rel_fk_put_with_http_info(id, fk, **kwargs)
        else:
            (data) = self.products_id_tags_rel_fk_put_with_http_info(id, fk, **kwargs)
            return data

    def products_id_tags_rel_fk_put_with_http_info(self, id, fk, **kwargs):
        """
        Add a related item by id for tags.
        

        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.products_id_tags_rel_fk_put_with_http_info(id, fk, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: Product id (required)
        :param str fk: Foreign key for tags (required)
        :param ProductTag data: 
        :return: ProductTag
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/Products/{id}/tags/rel/{fk}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'fk' in params:
            path_params['fk'] = params['fk']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='ProductTag',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

    def products_post(self, **kwargs):
        """
        Create a new instance of the model and persist it into the data source.
        

        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.products_post(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.products_post_with_http_info(**kwargs)
        else:
            (data) = self.products_post_with_http_info(**kwargs)
            return data

    def products_post_with_http_info(self, **kwargs):
        """
        Create a new instance of the model and persist it into the data source.
        

        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.products_post_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Product data: Model instance data
        :return: Product
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['data']
        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 products_post" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        resource_path = '/Products'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in params:
            body_params = params['data']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
        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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml'])

        # Authentication setting
        auth_settings = ['access_token']

        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='Product',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            collection_formats=collection_formats)

# coding: utf-8 tweak-api      Tweak API to integrate with all the Tweak services.  You can find out more about Tweak      at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.      OpenAPI spec version: 1.0.8-beta.0          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. # python 2 and python 3 compatibility library 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 Create a change stream.                   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.products_change_stream_get(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str options:          :return: file                  If the method is called asynchronously,                  returns the request thread. Create a change stream.                   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.products_change_stream_get_with_http_info(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str options:          :return: file                  If the method is called asynchronously,                  returns the request thread. # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Create a change stream.                   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.products_change_stream_post(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str options:          :return: file                  If the method is called asynchronously,                  returns the request thread. Create a change stream.                   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.products_change_stream_post_with_http_info(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str options:          :return: file                  If the method is called asynchronously,                  returns the request thread. # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Count instances of the model matched by where from the data source.                   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.products_count_get(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str where: Criteria to match model instances         :return: InlineResponse2001                  If the method is called asynchronously,                  returns the request thread. Count instances of the model matched by where from the data source.                   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.products_count_get_with_http_info(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str where: Criteria to match model instances         :return: InlineResponse2001                  If the method is called asynchronously,                  returns the request thread. # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Find first instance of the model matched by filter from the data source.                   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.products_find_one_get(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})         :return: Product                  If the method is called asynchronously,                  returns the request thread. Find first instance of the model matched by filter from the data source.                   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.products_find_one_get_with_http_info(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})         :return: Product                  If the method is called asynchronously,                  returns the request thread. # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Find all instances of the model matched by filter from the data source.                   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.products_get(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})         :return: list[Product]                  If the method is called asynchronously,                  returns the request thread. Find all instances of the model matched by filter from the data source.                   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.products_get_with_http_info(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str filter: Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string ({\"something\":\"value\"})         :return: list[Product]                  If the method is called asynchronously,                  returns the request thread. # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Delete a model instance by {{id}} from the data source.                   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.products_id_delete(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :return: object                  If the method is called asynchronously,                  returns the request thread. Delete a model instance by {{id}} from the data source.                   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.products_id_delete_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :return: object                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Check whether a model instance exists in the data source.                   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.products_id_exists_get(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :return: InlineResponse2002                  If the method is called asynchronously,                  returns the request thread. Check whether a model instance exists in the data source.                   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.products_id_exists_get_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :return: InlineResponse2002                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Find a model instance by {{id}} from the data source.                   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.products_id_get(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})         :return: Product                  If the method is called asynchronously,                  returns the request thread. Find a model instance by {{id}} from the data source.                   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.products_id_get_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :param str filter: Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})         :return: Product                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Check whether a model instance exists in the data source.                   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.products_id_head(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :return: InlineResponse2002                  If the method is called asynchronously,                  returns the request thread. Check whether a model instance exists in the data source.                   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.products_id_head_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :return: InlineResponse2002                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Patch attributes for a model instance and persist it into the data source.                   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.products_id_patch(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param Product data: An object of model property name/value pairs         :return: Product                  If the method is called asynchronously,                  returns the request thread. Patch attributes for a model instance and persist it into the data source.                   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.products_id_patch_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param Product data: An object of model property name/value pairs         :return: Product                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Replace attributes for a model instance and persist it into the data source.                   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.products_id_put(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :param Product data: Model instance data         :return: Product                  If the method is called asynchronously,                  returns the request thread. Replace attributes for a model instance and persist it into the data source.                   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.products_id_put_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :param Product data: Model instance data         :return: Product                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Replace attributes for a model instance and persist it into the data source.                   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.products_id_replace_post(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :param Product data: Model instance data         :return: Product                  If the method is called asynchronously,                  returns the request thread. Replace attributes for a model instance and persist it into the data source.                   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.products_id_replace_post_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Model id (required)         :param Product data: Model instance data         :return: Product                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Fetches belongsTo relation size.                   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.products_id_size_get(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param bool refresh:          :return: ProductSize                  If the method is called asynchronously,                  returns the request thread. Fetches belongsTo relation size.                   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.products_id_size_get_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param bool refresh:          :return: ProductSize                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Counts tags of Product.                   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.products_id_tags_count_get(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str where: Criteria to match model instances         :return: InlineResponse2001                  If the method is called asynchronously,                  returns the request thread. Counts tags of Product.                   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.products_id_tags_count_get_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str where: Criteria to match model instances         :return: InlineResponse2001                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Delete a related item by id for tags.                   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.products_id_tags_fk_delete(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: None                  If the method is called asynchronously,                  returns the request thread. Delete a related item by id for tags.                   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.products_id_tags_fk_delete_with_http_info(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: None                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # verify the required parameter 'fk' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Find a related item by id for tags.                   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.products_id_tags_fk_get(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: Tag                  If the method is called asynchronously,                  returns the request thread. Find a related item by id for tags.                   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.products_id_tags_fk_get_with_http_info(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: Tag                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # verify the required parameter 'fk' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Update a related item by id for tags.                   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.products_id_tags_fk_put(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :param Tag data:          :return: Tag                  If the method is called asynchronously,                  returns the request thread. Update a related item by id for tags.                   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.products_id_tags_fk_put_with_http_info(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :param Tag data:          :return: Tag                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # verify the required parameter 'fk' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Queries tags of Product.                   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.products_id_tags_get(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str filter:          :return: list[Tag]                  If the method is called asynchronously,                  returns the request thread. Queries tags of Product.                   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.products_id_tags_get_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str filter:          :return: list[Tag]                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Creates a new instance in tags of this model.                   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.products_id_tags_post(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param Tag data:          :return: Tag                  If the method is called asynchronously,                  returns the request thread. Creates a new instance in tags of this model.                   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.products_id_tags_post_with_http_info(id, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param Tag data:          :return: Tag                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Remove the tags relation to an item by id.                   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.products_id_tags_rel_fk_delete(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: None                  If the method is called asynchronously,                  returns the request thread. Remove the tags relation to an item by id.                   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.products_id_tags_rel_fk_delete_with_http_info(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: None                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # verify the required parameter 'fk' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Check the existence of tags relation to an item by id.                   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.products_id_tags_rel_fk_head(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: bool                  If the method is called asynchronously,                  returns the request thread. Check the existence of tags relation to an item by id.                   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.products_id_tags_rel_fk_head_with_http_info(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :return: bool                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # verify the required parameter 'fk' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Add a related item by id for tags.                   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.products_id_tags_rel_fk_put(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :param ProductTag data:          :return: ProductTag                  If the method is called asynchronously,                  returns the request thread. Add a related item by id for tags.                   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.products_id_tags_rel_fk_put_with_http_info(id, fk, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str id: Product id (required)         :param str fk: Foreign key for tags (required)         :param ProductTag data:          :return: ProductTag                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'id' is set # verify the required parameter 'fk' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Create a new instance of the model and persist it into the data source.                   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.products_post(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param Product data: Model instance data         :return: Product                  If the method is called asynchronously,                  returns the request thread. Create a new instance of the model and persist it into the data source.                   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.products_post_with_http_info(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param Product data: Model instance data         :return: Product                  If the method is called asynchronously,                  returns the request thread. # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting