# coding: utf-8

"""
    axxell-api

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: 1.0.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 DefaultApi(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 aggregate_count_events(self, storeid, event_type, data_period, **kwargs):
        """
        
        Return list of counts per event

        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.aggregate_count_events(storeid, event_type, data_period, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :param str data_period: Valid values are last7days, last30days, today, yesterday (required)
        :return: DataPoint
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.aggregate_count_events_with_http_info(storeid, event_type, data_period, **kwargs)
        else:
            (data) = self.aggregate_count_events_with_http_info(storeid, event_type, data_period, **kwargs)
            return data

    def aggregate_count_events_with_http_info(self, storeid, event_type, data_period, **kwargs):
        """
        
        Return list of counts per event

        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.aggregate_count_events_with_http_info(storeid, event_type, data_period, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :param str data_period: Valid values are last7days, last30days, today, yesterday (required)
        :return: DataPoint
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/aggregates/countevents/{eventType}'.replace('{format}', 'json')
        path_params = {}
        if 'event_type' in params:
            path_params['eventType'] = params['event_type']

        query_params = {}
        if 'storeid' in params:
            query_params['storeid'] = params['storeid']
        if 'data_period' in params:
            query_params['dataPeriod'] = params['data_period']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def aggregate_effective(self, storeid, event_type, **kwargs):
        """
        
        Return list of aggregated data points correlated with recommendationa and eventType

        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.aggregate_effective(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[DataPoint]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.aggregate_effective_with_http_info(storeid, event_type, **kwargs)
        else:
            (data) = self.aggregate_effective_with_http_info(storeid, event_type, **kwargs)
            return data

    def aggregate_effective_with_http_info(self, storeid, event_type, **kwargs):
        """
        
        Return list of aggregated data points correlated with recommendationa and eventType

        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.aggregate_effective_with_http_info(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[DataPoint]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/aggregates/effective/{eventType}'.replace('{format}', 'json')
        path_params = {}
        if 'event_type' in params:
            path_params['eventType'] = params['event_type']

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def aggregate_events(self, storeid, event_type, **kwargs):
        """
        
        Return list of aggregated data points

        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.aggregate_events(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[DataPoint]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.aggregate_events_with_http_info(storeid, event_type, **kwargs)
        else:
            (data) = self.aggregate_events_with_http_info(storeid, event_type, **kwargs)
            return data

    def aggregate_events_with_http_info(self, storeid, event_type, **kwargs):
        """
        
        Return list of aggregated data points

        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.aggregate_events_with_http_info(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[DataPoint]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/aggregates/events/{eventType}'.replace('{format}', 'json')
        path_params = {}
        if 'event_type' in params:
            path_params['eventType'] = params['event_type']

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def aggregate_recent(self, storeid, event_type, **kwargs):
        """
        
        Returns recent products

        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.aggregate_recent(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.aggregate_recent_with_http_info(storeid, event_type, **kwargs)
        else:
            (data) = self.aggregate_recent_with_http_info(storeid, event_type, **kwargs)
            return data

    def aggregate_recent_with_http_info(self, storeid, event_type, **kwargs):
        """
        
        Returns recent products

        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.aggregate_recent_with_http_info(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/aggregates/recent/{eventType}'.replace('{format}', 'json')
        path_params = {}
        if 'event_type' in params:
            path_params['eventType'] = params['event_type']

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def aggregate_top(self, storeid, event_type, **kwargs):
        """
        
        Returns top products

        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.aggregate_top(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.aggregate_top_with_http_info(storeid, event_type, **kwargs)
        else:
            (data) = self.aggregate_top_with_http_info(storeid, event_type, **kwargs)
            return data

    def aggregate_top_with_http_info(self, storeid, event_type, **kwargs):
        """
        
        Returns top products

        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.aggregate_top_with_http_info(storeid, event_type, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str event_type: Valid values purchase, view or recommend (required)
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        resource_path = '/aggregates/top/{eventType}'.replace('{format}', 'json')
        path_params = {}
        if 'event_type' in params:
            path_params['eventType'] = params['event_type']

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def auth_store(self, store, **kwargs):
        """
        
        Retrieve authentication token using password

        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.auth_store(store, callback=callback_function)

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

    def auth_store_with_http_info(self, store, **kwargs):
        """
        
        Retrieve authentication token using password

        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.auth_store_with_http_info(store, callback=callback_function)

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

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def delete_all_events(self, storeid, **kwargs):
        """
        
        Delete all events

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_all_events(storeid, callback=callback_function)

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

    def delete_all_events_with_http_info(self, storeid, **kwargs):
        """
        
        Delete all events

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_all_events_with_http_info(storeid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :return: Event
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['storeid']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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


        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def delete_all_items(self, storeid, **kwargs):
        """
        
        Delete all items

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_all_items(storeid, callback=callback_function)

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

    def delete_all_items_with_http_info(self, storeid, **kwargs):
        """
        
        Delete all items

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_all_items_with_http_info(storeid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :return: Item
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['storeid']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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


        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def delete_item(self, storeid, itemid, **kwargs):
        """
        
        Delete existing item

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_item(storeid, itemid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str itemid: Item identifier (required)
        :return: Item
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_item_with_http_info(storeid, itemid, **kwargs)
        else:
            (data) = self.delete_item_with_http_info(storeid, itemid, **kwargs)
            return data

    def delete_item_with_http_info(self, storeid, itemid, **kwargs):
        """
        
        Delete existing item

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_item_with_http_info(storeid, itemid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str itemid: Item identifier (required)
        :return: Item
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['storeid', 'itemid']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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


        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def recommend_interesting(self, storeid, userid, **kwargs):
        """
        
        Return list of recommended items

        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.recommend_interesting(storeid, userid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str userid: Interesting items for visitor (required)
        :param float count: Return exactly this amount of suggestions. Maximum value is 50, default is 5.
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.recommend_interesting_with_http_info(storeid, userid, **kwargs)
        else:
            (data) = self.recommend_interesting_with_http_info(storeid, userid, **kwargs)
            return data

    def recommend_interesting_with_http_info(self, storeid, userid, **kwargs):
        """
        
        Return list of recommended items

        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.recommend_interesting_with_http_info(storeid, userid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str userid: Interesting items for visitor (required)
        :param float count: Return exactly this amount of suggestions. Maximum value is 50, default is 5.
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}
        if 'storeid' in params:
            query_params['storeid'] = params['storeid']
        if 'count' in params:
            query_params['count'] = params['count']
        if 'userid' in params:
            query_params['userid'] = params['userid']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def recommend_similar(self, storeid, userid, itemid, **kwargs):
        """
        
        Return list of recommended items

        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.recommend_similar(storeid, userid, itemid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str userid: User requesting the recommendation (required)
        :param str itemid: Similar items bought by others (required)
        :param float count: Return exactly this amount of suggestions. Maximum value is 50, default is 5.
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.recommend_similar_with_http_info(storeid, userid, itemid, **kwargs)
        else:
            (data) = self.recommend_similar_with_http_info(storeid, userid, itemid, **kwargs)
            return data

    def recommend_similar_with_http_info(self, storeid, userid, itemid, **kwargs):
        """
        
        Return list of recommended items

        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.recommend_similar_with_http_info(storeid, userid, itemid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param str userid: User requesting the recommendation (required)
        :param str itemid: Similar items bought by others (required)
        :param float count: Return exactly this amount of suggestions. Maximum value is 50, default is 5.
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}
        if 'storeid' in params:
            query_params['storeid'] = params['storeid']
        if 'count' in params:
            query_params['count'] = params['count']
        if 'userid' in params:
            query_params['userid'] = params['userid']
        if 'itemid' in params:
            query_params['itemid'] = params['itemid']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def register_event(self, storeid, event, **kwargs):
        """
        
        Register new event

        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.register_event(storeid, event, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param Event event: Single event to register (required)
        :return: Event
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.register_event_with_http_info(storeid, event, **kwargs)
        else:
            (data) = self.register_event_with_http_info(storeid, event, **kwargs)
            return data

    def register_event_with_http_info(self, storeid, event, **kwargs):
        """
        
        Register new event

        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.register_event_with_http_info(storeid, event, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param Event event: Single event to register (required)
        :return: Event
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def register_item(self, storeid, item, **kwargs):
        """
        
        Register new item

        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.register_item(storeid, item, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param Item item: Single item to register (required)
        :return: Item
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.register_item_with_http_info(storeid, item, **kwargs)
        else:
            (data) = self.register_item_with_http_info(storeid, item, **kwargs)
            return data

    def register_item_with_http_info(self, storeid, item, **kwargs):
        """
        
        Register new item

        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.register_item_with_http_info(storeid, item, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :param Item item: Single item to register (required)
        :return: Item
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def register_store(self, store, **kwargs):
        """
        
        Register new Store

        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.register_store(store, callback=callback_function)

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

    def register_store_with_http_info(self, store, **kwargs):
        """
        
        Register new Store

        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.register_store_with_http_info(store, callback=callback_function)

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

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def retrieve_events(self, storeid, **kwargs):
        """
        
        Get recent events

        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.retrieve_events(storeid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :return: list[Event]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.retrieve_events_with_http_info(storeid, **kwargs)
        else:
            (data) = self.retrieve_events_with_http_info(storeid, **kwargs)
            return data

    def retrieve_events_with_http_info(self, storeid, **kwargs):
        """
        
        Get recent events

        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.retrieve_events_with_http_info(storeid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :return: list[Event]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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

    def retrieve_items(self, storeid, **kwargs):
        """
        
        Get recent items

        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.retrieve_items(storeid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.retrieve_items_with_http_info(storeid, **kwargs)
        else:
            (data) = self.retrieve_items_with_http_info(storeid, **kwargs)
            return data

    def retrieve_items_with_http_info(self, storeid, **kwargs):
        """
        
        Get recent items

        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.retrieve_items_with_http_info(storeid, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str storeid: Store identifier (required)
        :return: list[Item]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['ApiKey']

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