# coding: utf-8

"""
    kinto

    Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host.  **Limitations of this OpenAPI specification:**   1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions`   in patch operations).   2. [Filtering](http://kinto.readthedocs.io/en/stable/api/1.x/filtering.html)   is supported on any field by using `?{prefix}{field_name}={value}`.   3. [Backoff headers](http://kinto.readthedocs.io/en/stable/api/1.x/backoff.html)   may occur with any response, but they are only present if the server is under   in heavy load, so we cannot validate them on every request. They are listed only   on the default error message.   4. [Collection schemas](http://kinto.readthedocs.io/en/stable/api/1.x/collections.html#collection-json-schema)   can be provided when defining a collection, but they are not validated by   this specification.

    OpenAPI spec version: 1.13
    
    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 KintoApi(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 batch(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

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

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

    def batch_with_http_info(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

        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.batch_with_http_info(batch, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Batch batch: Batch operation properties. (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['batch']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def contribute(self, **kwargs):
        """
        
        

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

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

    def contribute_with_http_info(self, **kwargs):
        """
        
        

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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

    def create_bucket(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_bucket_with_http_info(**kwargs)
        else:
            (data) = self.create_bucket_with_http_info(**kwargs)
            return data

    def create_bucket_with_http_info(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_bucket" % key
                )
            params[key] = val
        del params['kwargs']

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def create_collection(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_collection_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.create_collection_with_http_info(bucket_id, **kwargs)
            return data

    def create_collection_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def create_group(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_group_with_http_info(bucket_id, group, **kwargs)
        else:
            (data) = self.create_group_with_http_info(bucket_id, group, **kwargs)
            return data

    def create_group_with_http_info(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def create_record(self, bucket_id, collection_id, **kwargs):
        """
        
        Upload a record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_record_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.create_record_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def create_record_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Upload a record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def delete_bucket(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.delete_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def delete_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_buckets(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_buckets_with_http_info(**kwargs)
        else:
            (data) = self.delete_buckets_with_http_info(**kwargs)
            return data

    def delete_buckets_with_http_info(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['since', 'before', 'sort', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.delete_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def delete_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_collections(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collections_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.delete_collections_with_http_info(bucket_id, **kwargs)
            return data

    def delete_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_group(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            (data) = self.delete_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def delete_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group_with_http_info(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_groups(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_groups_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.delete_groups_with_http_info(bucket_id, **kwargs)
            return data

    def delete_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.delete_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def delete_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_records_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.delete_records_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def delete_records_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_bucket(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.get_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def get_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_buckets(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_buckets_with_http_info(**kwargs)
        else:
            (data) = self.get_buckets_with_http_info(**kwargs)
            return data

    def get_buckets_with_http_info(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_buckets" % key
                )
            params[key] = val
        del params['kwargs']

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.get_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def get_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_collections(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collections_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.get_collections_with_http_info(bucket_id, **kwargs)
            return data

    def get_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_group(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            (data) = self.get_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def get_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_groups(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_groups_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.get_groups_with_http_info(bucket_id, **kwargs)
            return data

    def get_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.get_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def get_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_records_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.get_records_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def get_records_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def heartbeat(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

    def heartbeat_with_http_info(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

        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='dict(str, bool)',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            _preload_content=params.get('_preload_content', True),
                                            _request_timeout=params.get('_request_timeout'),
                                            collection_formats=collection_formats)

    def lbheartbeat(self, **kwargs):
        """
        
        

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

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

    def lbheartbeat_with_http_info(self, **kwargs):
        """
        
        

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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

    def patch_bucket(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.patch_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def patch_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def patch_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.patch_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def patch_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'collection', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def patch_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_group_with_http_info(bucket_id, group_id, group, **kwargs)
        else:
            (data) = self.patch_group_with_http_info(bucket_id, group_id, group, **kwargs)
            return data

    def patch_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'group', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def patch_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.patch_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def patch_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'record', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def server_info(self, **kwargs):
        """
        
        Information about the running instance.

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

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

    def server_info_with_http_info(self, **kwargs):
        """
        
        Information about the running instance.

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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

    def update_bucket(self, bucket_id, **kwargs):
        """
        
        Create or replace a bucket.

        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.update_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.update_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def update_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create or replace a bucket.

        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.update_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def update_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.update_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def update_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'collection', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def update_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Update a group.

        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.update_group(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_group_with_http_info(bucket_id, group_id, group, **kwargs)
        else:
            (data) = self.update_group_with_http_info(bucket_id, group_id, group, **kwargs)
            return data

    def update_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
        """
        
        Update a group.

        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.update_group_with_http_info(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'group', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def update_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Create or replace a record.

        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.update_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.update_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def update_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Create or replace a record.

        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.update_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'record', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def version(self, **kwargs):
        """
        
        

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

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

    def version_with_http_info(self, **kwargs):
        """
        
        

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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

04235303997ac858bb5c46d503924b63f67dcfcb
<mask token>


class KintoApi(object):
    <mask token>

    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 batch(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

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

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

    def batch_with_http_info(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

        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.batch_with_http_info(batch, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Batch batch: Batch operation properties. (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['batch']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 batch" %
                    key)
            params[key] = val
        del params['kwargs']
        if 'batch' not in params or params['batch'] is None:
            raise ValueError(
                'Missing the required parameter `batch` when calling `batch`')
        collection_formats = {}
        resource_path = '/batch'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'batch' in params:
            body_params = params['batch']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'InlineResponse200', auth_settings=auth_settings, callback=
            params.get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def contribute(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.contribute_with_http_info(**kwargs)
        else:
            data = self.contribute_with_http_info(**kwargs)
            return data
    <mask token>

    def create_bucket(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_bucket_with_http_info(**kwargs)
        else:
            data = self.create_bucket_with_http_info(**kwargs)
            return data
    <mask token>

    def create_collection(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_collection_with_http_info(bucket_id, **kwargs)
        else:
            data = self.create_collection_with_http_info(bucket_id, **kwargs)
            return data
    <mask token>

    def create_group(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_group_with_http_info(bucket_id, group, **kwargs)
        else:
            data = self.create_group_with_http_info(bucket_id, group, **kwargs)
            return data

    def create_group_with_http_info(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `create_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `create_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>
    <mask token>

    def delete_bucket(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def delete_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)
    <mask token>

    def delete_buckets_with_http_info(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['since', 'before', 'sort', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_buckets"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data
    <mask token>

    def delete_collections(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collections_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_collections_with_http_info(bucket_id, **kwargs)
            return data

    def delete_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)
    <mask token>

    def delete_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group_with_http_info(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `delete_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_groups(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_groups_with_http_info(bucket_id, **kwargs)
            return data

    def delete_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
        else:
            data = self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
            return data
    <mask token>

    def delete_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def delete_records_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Delete stored records.

        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_records_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_records"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_records`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_records`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records'.
            replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def get_bucket(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_bucket_with_http_info(bucket_id, **kwargs)
            return data
    <mask token>

    def get_buckets(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_buckets_with_http_info(**kwargs)
        else:
            data = self.get_buckets_with_http_info(**kwargs)
            return data
    <mask token>

    def get_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def get_collection_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>

    def get_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_group(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            data = self.get_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def get_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `get_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_groups(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_groups_with_http_info(bucket_id, **kwargs)
            return data

    def get_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
        else:
            data = self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
            return data
    <mask token>
    <mask token>
    <mask token>

    def heartbeat(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

    def heartbeat_with_http_info(self, **kwargs):
        """
        
        Return the status of dependent services.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: dict(str, bool)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 heartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__heartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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=
            'dict(str, bool)', auth_settings=auth_settings, callback=params
            .get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def lbheartbeat(self, **kwargs):
        """
        
        

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

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

    def lbheartbeat_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 lbheartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__lbheartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_bucket(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.patch_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def patch_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def patch_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `patch_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
        else:
            data = self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
            return data
    <mask token>
    <mask token>
    <mask token>

    def server_info(self, **kwargs):
        """
        
        Information about the running instance.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.server_info_with_http_info(**kwargs)
        else:
            data = self.server_info_with_http_info(**kwargs)
            return data
    <mask token>
    <mask token>
    <mask token>

    def update_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def update_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Create or replace a collection.

        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.update_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `update_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def version_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 version"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__version__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

<mask token>


class KintoApi(object):
    <mask token>

    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 batch(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

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

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

    def batch_with_http_info(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

        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.batch_with_http_info(batch, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Batch batch: Batch operation properties. (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['batch']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 batch" %
                    key)
            params[key] = val
        del params['kwargs']
        if 'batch' not in params or params['batch'] is None:
            raise ValueError(
                'Missing the required parameter `batch` when calling `batch`')
        collection_formats = {}
        resource_path = '/batch'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'batch' in params:
            body_params = params['batch']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'InlineResponse200', auth_settings=auth_settings, callback=
            params.get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def contribute(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.contribute_with_http_info(**kwargs)
        else:
            data = self.contribute_with_http_info(**kwargs)
            return data
    <mask token>

    def create_bucket(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_bucket_with_http_info(**kwargs)
        else:
            data = self.create_bucket_with_http_info(**kwargs)
            return data
    <mask token>

    def create_collection(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_collection_with_http_info(bucket_id, **kwargs)
        else:
            data = self.create_collection_with_http_info(bucket_id, **kwargs)
            return data
    <mask token>

    def create_group(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_group_with_http_info(bucket_id, group, **kwargs)
        else:
            data = self.create_group_with_http_info(bucket_id, group, **kwargs)
            return data

    def create_group_with_http_info(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `create_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `create_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>
    <mask token>

    def delete_bucket(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def delete_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)
    <mask token>

    def delete_buckets_with_http_info(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['since', 'before', 'sort', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_buckets"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def delete_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Delete a collection.

        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_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_collections(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collections_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_collections_with_http_info(bucket_id, **kwargs)
            return data

    def delete_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)
    <mask token>

    def delete_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group_with_http_info(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `delete_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_groups(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_groups_with_http_info(bucket_id, **kwargs)
            return data

    def delete_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
        else:
            data = self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
            return data

    def delete_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Delete a single record.

        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_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `delete_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def delete_records_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Delete stored records.

        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_records_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_records"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_records`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_records`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records'.
            replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def get_bucket(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_bucket_with_http_info(bucket_id, **kwargs)
            return data
    <mask token>

    def get_buckets(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_buckets_with_http_info(**kwargs)
        else:
            data = self.get_buckets_with_http_info(**kwargs)
            return data

    def get_buckets_with_http_info(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['if_match', 'if_none_match', 'since', 'before',
            'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_buckets"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def get_collection_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>

    def get_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_group(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            data = self.get_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def get_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `get_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_groups(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_groups_with_http_info(bucket_id, **kwargs)
            return data

    def get_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
        else:
            data = self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
            return data

    def get_record_with_http_info(self, bucket_id, collection_id, record_id,
        **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `get_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>

    def get_records_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'since', 'before', 'sort', 'limit', 'token',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_records"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_records`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_records`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records'.
            replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def heartbeat(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

    def heartbeat_with_http_info(self, **kwargs):
        """
        
        Return the status of dependent services.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: dict(str, bool)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 heartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__heartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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=
            'dict(str, bool)', auth_settings=auth_settings, callback=params
            .get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def lbheartbeat(self, **kwargs):
        """
        
        

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

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

    def lbheartbeat_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 lbheartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__lbheartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_bucket(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.patch_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def patch_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def patch_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `patch_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
        else:
            data = self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
            return data
    <mask token>
    <mask token>

    def patch_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'record',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `patch_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `patch_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'record' in params:
            body_params = params['record']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def server_info(self, **kwargs):
        """
        
        Information about the running instance.

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

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

    def server_info_with_http_info(self, **kwargs):
        """
        
        Information about the running instance.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 server_info"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>
    <mask token>

    def update_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def update_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Create or replace a collection.

        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.update_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `update_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Update a group.

        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.update_group(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
        else:
            data = self.update_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
            return data
    <mask token>
    <mask token>
    <mask token>

    def version(self, **kwargs):
        """
        
        

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

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

    def version_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 version"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__version__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

<mask token>


class KintoApi(object):
    <mask token>

    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 batch(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

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

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

    def batch_with_http_info(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

        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.batch_with_http_info(batch, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Batch batch: Batch operation properties. (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['batch']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 batch" %
                    key)
            params[key] = val
        del params['kwargs']
        if 'batch' not in params or params['batch'] is None:
            raise ValueError(
                'Missing the required parameter `batch` when calling `batch`')
        collection_formats = {}
        resource_path = '/batch'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'batch' in params:
            body_params = params['batch']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'InlineResponse200', auth_settings=auth_settings, callback=
            params.get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def contribute(self, **kwargs):
        """
        
        

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

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

    def contribute_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 contribute"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/contribute.json'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_bucket(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_bucket_with_http_info(**kwargs)
        else:
            data = self.create_bucket_with_http_info(**kwargs)
            return data

    def create_bucket_with_http_info(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_collection(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_collection_with_http_info(bucket_id, **kwargs)
        else:
            data = self.create_collection_with_http_info(bucket_id, **kwargs)
            return data

    def create_collection_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `create_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_group(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_group_with_http_info(bucket_id, group, **kwargs)
        else:
            data = self.create_group_with_http_info(bucket_id, group, **kwargs)
            return data

    def create_group_with_http_info(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `create_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `create_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_record(self, bucket_id, collection_id, **kwargs):
        """
        
        Upload a record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_record_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.create_record_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data
    <mask token>

    def delete_bucket(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def delete_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_buckets(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_buckets_with_http_info(**kwargs)
        else:
            data = self.delete_buckets_with_http_info(**kwargs)
            return data

    def delete_buckets_with_http_info(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['since', 'before', 'sort', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_buckets"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def delete_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Delete a collection.

        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_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_collections(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collections_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_collections_with_http_info(bucket_id, **kwargs)
            return data

    def delete_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_group(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_group_with_http_info(bucket_id, group_id, **
                kwargs)
        else:
            data = self.delete_group_with_http_info(bucket_id, group_id, **
                kwargs)
            return data

    def delete_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group_with_http_info(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `delete_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_groups(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_groups_with_http_info(bucket_id, **kwargs)
            return data

    def delete_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
        else:
            data = self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
            return data

    def delete_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Delete a single record.

        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_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `delete_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def delete_records_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Delete stored records.

        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_records_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_records"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_records`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_records`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records'.
            replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def get_bucket(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def get_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_buckets(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_buckets_with_http_info(**kwargs)
        else:
            data = self.get_buckets_with_http_info(**kwargs)
            return data

    def get_buckets_with_http_info(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['if_match', 'if_none_match', 'since', 'before',
            'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_buckets"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def get_collection_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_collections(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collections_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_collections_with_http_info(bucket_id, **kwargs)
            return data

    def get_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_group(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            data = self.get_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def get_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `get_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_groups(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_groups_with_http_info(bucket_id, **kwargs)
            return data

    def get_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
        else:
            data = self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
            return data

    def get_record_with_http_info(self, bucket_id, collection_id, record_id,
        **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `get_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_records_with_http_info(bucket_id, collection_id,
                **kwargs)
        else:
            data = self.get_records_with_http_info(bucket_id, collection_id,
                **kwargs)
            return data

    def get_records_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'since', 'before', 'sort', 'limit', 'token',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_records"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_records`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_records`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records'.
            replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def heartbeat(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

    def heartbeat_with_http_info(self, **kwargs):
        """
        
        Return the status of dependent services.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: dict(str, bool)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 heartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__heartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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=
            'dict(str, bool)', auth_settings=auth_settings, callback=params
            .get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def lbheartbeat(self, **kwargs):
        """
        
        

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

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

    def lbheartbeat_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 lbheartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__lbheartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_bucket(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.patch_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def patch_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def patch_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `patch_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
        else:
            data = self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
            return data

    def patch_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'group', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `patch_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `patch_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>

    def patch_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'record',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `patch_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `patch_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'record' in params:
            body_params = params['record']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def server_info(self, **kwargs):
        """
        
        Information about the running instance.

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

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

    def server_info_with_http_info(self, **kwargs):
        """
        
        Information about the running instance.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 server_info"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>

    def update_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create or replace a bucket.

        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.update_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def update_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Create or replace a collection.

        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.update_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `update_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Update a group.

        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.update_group(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
        else:
            data = self.update_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
            return data

    def update_group_with_http_info(self, bucket_id, group_id, group, **kwargs
        ):
        """
        
        Update a group.

        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.update_group_with_http_info(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'group', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `update_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `update_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>

    def update_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Create or replace a record.

        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.update_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'record',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `update_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `update_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'record' in params:
            body_params = params['record']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def version(self, **kwargs):
        """
        
        

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

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

    def version_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 version"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__version__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

<mask token>


class KintoApi(object):
    <mask token>

    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 batch(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

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

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

    def batch_with_http_info(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

        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.batch_with_http_info(batch, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Batch batch: Batch operation properties. (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['batch']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 batch" %
                    key)
            params[key] = val
        del params['kwargs']
        if 'batch' not in params or params['batch'] is None:
            raise ValueError(
                'Missing the required parameter `batch` when calling `batch`')
        collection_formats = {}
        resource_path = '/batch'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'batch' in params:
            body_params = params['batch']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'InlineResponse200', auth_settings=auth_settings, callback=
            params.get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def contribute(self, **kwargs):
        """
        
        

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

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

    def contribute_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 contribute"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/contribute.json'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_bucket(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_bucket_with_http_info(**kwargs)
        else:
            data = self.create_bucket_with_http_info(**kwargs)
            return data

    def create_bucket_with_http_info(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_collection(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_collection_with_http_info(bucket_id, **kwargs)
        else:
            data = self.create_collection_with_http_info(bucket_id, **kwargs)
            return data

    def create_collection_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `create_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_group(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_group_with_http_info(bucket_id, group, **kwargs)
        else:
            data = self.create_group_with_http_info(bucket_id, group, **kwargs)
            return data

    def create_group_with_http_info(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method create_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `create_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `create_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `create_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_record(self, bucket_id, collection_id, **kwargs):
        """
        
        Upload a record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_record_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.create_record_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data
    <mask token>

    def delete_bucket(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def delete_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_buckets(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_buckets_with_http_info(**kwargs)
        else:
            data = self.delete_buckets_with_http_info(**kwargs)
            return data

    def delete_buckets_with_http_info(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['since', 'before', 'sort', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_buckets"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def delete_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Delete a collection.

        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_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_collections(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collections_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_collections_with_http_info(bucket_id, **kwargs)
            return data

    def delete_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_group(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_group_with_http_info(bucket_id, group_id, **
                kwargs)
        else:
            data = self.delete_group_with_http_info(bucket_id, group_id, **
                kwargs)
            return data

    def delete_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group_with_http_info(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `delete_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_groups(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.delete_groups_with_http_info(bucket_id, **kwargs)
            return data

    def delete_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
        else:
            data = self.delete_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
            return data

    def delete_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Delete a single record.

        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_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `delete_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'Deleted', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def delete_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.delete_records_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def delete_records_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Delete stored records.

        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_records_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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_records"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `delete_records`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `delete_records`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `delete_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records'.
            replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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=
            'List', auth_settings=auth_settings, callback=params.get(
            'callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def get_bucket(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def get_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_buckets(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_buckets_with_http_info(**kwargs)
        else:
            data = self.get_buckets_with_http_info(**kwargs)
            return data

    def get_buckets_with_http_info(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['if_match', 'if_none_match', 'since', 'before',
            'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_buckets"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_buckets`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.get_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def get_collection_with_http_info(self, bucket_id, collection_id, **kwargs
        ):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_collections(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collections_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_collections_with_http_info(bucket_id, **kwargs)
            return data

    def get_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_collections"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_collections`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_collections`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/collections'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_group(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            data = self.get_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def get_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `get_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_groups(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_groups_with_http_info(bucket_id, **kwargs)
        else:
            data = self.get_groups_with_http_info(bucket_id, **kwargs)
            return data

    def get_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since',
            'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_groups"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_groups`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_groups`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups'.replace('{format}',
            'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
        else:
            data = self.get_record_with_http_info(bucket_id, collection_id,
                record_id, **kwargs)
            return data

    def get_record_with_http_info(self, bucket_id, collection_id, record_id,
        **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `get_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_records_with_http_info(bucket_id, collection_id,
                **kwargs)
        else:
            data = self.get_records_with_http_info(bucket_id, collection_id,
                **kwargs)
            return data

    def get_records_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'if_match',
            'if_none_match', 'since', 'before', 'sort', 'limit', 'token',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method get_records"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `get_records`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `get_records`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `get_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `get_records`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records'.
            replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def heartbeat(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

    def heartbeat_with_http_info(self, **kwargs):
        """
        
        Return the status of dependent services.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: dict(str, bool)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 heartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__heartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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=
            'dict(str, bool)', auth_settings=auth_settings, callback=params
            .get('callback'), _return_http_data_only=params.get(
            '_return_http_data_only'), _preload_content=params.get(
            '_preload_content', True), _request_timeout=params.get(
            '_request_timeout'), collection_formats=collection_formats)

    def lbheartbeat(self, **kwargs):
        """
        
        

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

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

    def lbheartbeat_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 lbheartbeat"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__lbheartbeat__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_bucket(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.patch_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def patch_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.patch_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def patch_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `patch_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
        else:
            data = self.patch_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
            return data

    def patch_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'group', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `patch_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `patch_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
        else:
            data = self.patch_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
            return data

    def patch_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'record',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s' to method patch_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `patch_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `patch_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `patch_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `patch_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `patch_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'record' in params:
            body_params = params['record']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type([
            'application/json', 'application/merge-patch+json',
            'application/json-patch+json'])
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def server_info(self, **kwargs):
        """
        
        Information about the running instance.

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

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

    def server_info_with_http_info(self, **kwargs):
        """
        
        Information about the running instance.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 server_info"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_bucket(self, bucket_id, **kwargs):
        """
        
        Create or replace a bucket.

        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.update_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_bucket_with_http_info(bucket_id, **kwargs)
        else:
            data = self.update_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def update_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create or replace a bucket.

        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.update_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match',
            'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_bucket"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_bucket`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_bucket`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'bucket' in params:
            body_params = params['bucket']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Bucket',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
        else:
            data = self.update_collection_with_http_info(bucket_id,
                collection_id, **kwargs)
            return data

    def update_collection_with_http_info(self, bucket_id, collection_id, **
        kwargs):
        """
        
        Create or replace a collection.

        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.update_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'collection',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_collection"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_collection`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `update_collection`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_collection`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = ('/buckets/{bucket_id}/collections/{collection_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'collection' in params:
            body_params = params['collection']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Collection',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Update a group.

        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.update_group(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
        else:
            data = self.update_group_with_http_info(bucket_id, group_id,
                group, **kwargs)
            return data

    def update_group_with_http_info(self, bucket_id, group_id, group, **kwargs
        ):
        """
        
        Update a group.

        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.update_group_with_http_info(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'group_id', 'group', 'if_match',
            'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_group"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_group`'
                )
        if 'group_id' not in params or params['group_id'] is None:
            raise ValueError(
                'Missing the required parameter `group_id` when calling `update_group`'
                )
        if 'group' not in params or params['group'] is None:
            raise ValueError(
                'Missing the required parameter `group` when calling `update_group`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_group`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace(
            '{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'group' in params:
            body_params = params['group']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Group',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Create or replace a record.

        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.update_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
        else:
            data = self.update_record_with_http_info(bucket_id,
                collection_id, record_id, **kwargs)
            return data

    def update_record_with_http_info(self, bucket_id, collection_id,
        record_id, **kwargs):
        """
        
        Create or replace a record.

        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.update_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['bucket_id', 'collection_id', 'record_id', 'record',
            'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 update_record"
                     % key)
            params[key] = val
        del params['kwargs']
        if 'bucket_id' not in params or params['bucket_id'] is None:
            raise ValueError(
                'Missing the required parameter `bucket_id` when calling `update_record`'
                )
        if 'collection_id' not in params or params['collection_id'] is None:
            raise ValueError(
                'Missing the required parameter `collection_id` when calling `update_record`'
                )
        if 'record_id' not in params or params['record_id'] is None:
            raise ValueError(
                'Missing the required parameter `record_id` when calling `update_record`'
                )
        if 'if_match' in params and not re.search('\\"[0-9]+\\"', params[
            'if_match']):
            raise ValueError(
                'Invalid value for parameter `if_match` when calling `update_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        if 'if_none_match' in params and not re.search('\\"[0-9]+\\"',
            params['if_none_match']):
            raise ValueError(
                'Invalid value for parameter `if_none_match` when calling `update_record`, must conform to the pattern `/\\"[0-9]+\\"/`'
                )
        collection_formats = {}
        resource_path = (
            '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'
            .replace('{format}', 'json'))
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']
        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'
        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'record' in params:
            body_params = params['record']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['basicAuth']
        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='Record',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def version(self, **kwargs):
        """
        
        

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

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

    def version_with_http_info(self, **kwargs):
        """
        
        

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        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 version"
                     % key)
            params[key] = val
        del params['kwargs']
        collection_formats = {}
        resource_path = '/__version__'.replace('{format}', 'json')
        path_params = {}
        query_params = {}
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = []
        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='object',
            auth_settings=auth_settings, callback=params.get('callback'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

# coding: utf-8

"""
    kinto

    Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host.  **Limitations of this OpenAPI specification:**   1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions`   in patch operations).   2. [Filtering](http://kinto.readthedocs.io/en/stable/api/1.x/filtering.html)   is supported on any field by using `?{prefix}{field_name}={value}`.   3. [Backoff headers](http://kinto.readthedocs.io/en/stable/api/1.x/backoff.html)   may occur with any response, but they are only present if the server is under   in heavy load, so we cannot validate them on every request. They are listed only   on the default error message.   4. [Collection schemas](http://kinto.readthedocs.io/en/stable/api/1.x/collections.html#collection-json-schema)   can be provided when defining a collection, but they are not validated by   this specification.

    OpenAPI spec version: 1.13
    
    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 KintoApi(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 batch(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

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

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

    def batch_with_http_info(self, batch, **kwargs):
        """
        
        Send multiple operations in one request.

        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.batch_with_http_info(batch, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Batch batch: Batch operation properties. (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['batch']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def contribute(self, **kwargs):
        """
        
        

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

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

    def contribute_with_http_info(self, **kwargs):
        """
        
        

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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

    def create_bucket(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_bucket_with_http_info(**kwargs)
        else:
            (data) = self.create_bucket_with_http_info(**kwargs)
            return data

    def create_bucket_with_http_info(self, **kwargs):
        """
        
        Create a bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_bucket" % key
                )
            params[key] = val
        del params['kwargs']

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def create_collection(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_collection_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.create_collection_with_http_info(bucket_id, **kwargs)
            return data

    def create_collection_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create a collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def create_group(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_group_with_http_info(bucket_id, group, **kwargs)
        else:
            (data) = self.create_group_with_http_info(bucket_id, group, **kwargs)
            return data

    def create_group_with_http_info(self, bucket_id, group, **kwargs):
        """
        
        Create a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def create_record(self, bucket_id, collection_id, **kwargs):
        """
        
        Upload a record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_record_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.create_record_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def create_record_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Upload a record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `create_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `create_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def delete_bucket(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.delete_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def delete_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete a bucket.

        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_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_buckets(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_buckets_with_http_info(**kwargs)
        else:
            (data) = self.delete_buckets_with_http_info(**kwargs)
            return data

    def delete_buckets_with_http_info(self, **kwargs):
        """
        
        Delete all writable buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['since', 'before', 'sort', 'if_match', 'if_none_match']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.delete_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def delete_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete a collection.

        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_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_collections(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_collections_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.delete_collections_with_http_info(bucket_id, **kwargs)
            return data

    def delete_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable collections.

        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_collections_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_group(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            (data) = self.delete_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def delete_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Delete a group.

        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_group_with_http_info(bucket_id, group_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_groups(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_groups_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.delete_groups_with_http_info(bucket_id, **kwargs)
            return data

    def delete_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Delete writable groups.

        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_groups_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.delete_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def delete_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Delete a single record.

        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_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Deleted
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def delete_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_records_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.delete_records_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def delete_records_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Delete stored records.

        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_records_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'since', 'before', 'sort']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `delete_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_bucket(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.get_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def get_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_buckets(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_buckets_with_http_info(**kwargs)
        else:
            (data) = self.get_buckets_with_http_info(**kwargs)
            return data

    def get_buckets_with_http_info(self, **kwargs):
        """
        
        List all acessible buckets.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_buckets" % key
                )
            params[key] = val
        del params['kwargs']

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_buckets`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.get_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def get_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Retreive an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_collections(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_collections_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.get_collections_with_http_info(bucket_id, **kwargs)
            return data

    def get_collections_with_http_info(self, bucket_id, **kwargs):
        """
        
        List bucket’s collections.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_group(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_group_with_http_info(bucket_id, group_id, **kwargs)
        else:
            (data) = self.get_group_with_http_info(bucket_id, group_id, **kwargs)
            return data

    def get_group_with_http_info(self, bucket_id, group_id, **kwargs):
        """
        
        Retrieve a group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_groups(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_groups_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.get_groups_with_http_info(bucket_id, **kwargs)
            return data

    def get_groups_with_http_info(self, bucket_id, **kwargs):
        """
        
        Retrieve the list of bucket’s group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_groups`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.get_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def get_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Retrieve a single record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def get_records(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_records_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.get_records_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def get_records_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Retrieve stored records.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Collection id. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param int since: Get entries after a timestamp.
        :param int before: Get entries before a timestamp.
        :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending).
        :param int limit: Limit objects on a list.
        :param str token: Continuation token of a limited list.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: List
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `get_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `get_records`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'since' in params:
            query_params['_since'] = params['since']
        if 'before' in params:
            query_params['_before'] = params['before']
        if 'sort' in params:
            query_params['_sort'] = params['sort']
            collection_formats['_sort'] = 'csv'
        if 'limit' in params:
            query_params['_limit'] = params['limit']
        if 'token' in params:
            query_params['_token'] = params['token']
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        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 = ['basicAuth']

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

    def heartbeat(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

    def heartbeat_with_http_info(self, **kwargs):
        """
        
        Return the status of dependent services.

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

        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='dict(str, bool)',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'),
                                            _preload_content=params.get('_preload_content', True),
                                            _request_timeout=params.get('_request_timeout'),
                                            collection_formats=collection_formats)

    def lbheartbeat(self, **kwargs):
        """
        
        

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

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

    def lbheartbeat_with_http_info(self, **kwargs):
        """
        
        

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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

    def patch_bucket(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.patch_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def patch_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Modify an existing bucket.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def patch_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.patch_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def patch_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Modify an existing collection.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'collection', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def patch_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_group_with_http_info(bucket_id, group_id, group, **kwargs)
        else:
            (data) = self.patch_group_with_http_info(bucket_id, group_id, group, **kwargs)
            return data

    def patch_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
        """
        
        Modify an existing group.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'group', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def patch_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.patch_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.patch_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def patch_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Modify an existing record.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'record', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `patch_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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', 'application/merge-patch+json', 'application/json-patch+json'])

        # Authentication setting
        auth_settings = ['basicAuth']

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

    def server_info(self, **kwargs):
        """
        
        Information about the running instance.

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

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

    def server_info_with_http_info(self, **kwargs):
        """
        
        Information about the running instance.

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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

    def update_bucket(self, bucket_id, **kwargs):
        """
        
        Create or replace a bucket.

        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.update_bucket(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_bucket_with_http_info(bucket_id, **kwargs)
        else:
            (data) = self.update_bucket_with_http_info(bucket_id, **kwargs)
            return data

    def update_bucket_with_http_info(self, bucket_id, **kwargs):
        """
        
        Create or replace a bucket.

        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.update_bucket_with_http_info(bucket_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param Bucket bucket: Bucket information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Bucket
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'bucket', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_bucket`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

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

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def update_collection(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_collection_with_http_info(bucket_id, collection_id, **kwargs)
        else:
            (data) = self.update_collection_with_http_info(bucket_id, collection_id, **kwargs)
            return data

    def update_collection_with_http_info(self, bucket_id, collection_id, **kwargs):
        """
        
        Create or replace a collection.

        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.update_collection_with_http_info(bucket_id, collection_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param Collection collection: Collection information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Collection
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'collection', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def update_group(self, bucket_id, group_id, group, **kwargs):
        """
        
        Update a group.

        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.update_group(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_group_with_http_info(bucket_id, group_id, group, **kwargs)
        else:
            (data) = self.update_group_with_http_info(bucket_id, group_id, group, **kwargs)
            return data

    def update_group_with_http_info(self, bucket_id, group_id, group, **kwargs):
        """
        
        Update a group.

        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.update_group_with_http_info(bucket_id, group_id, group, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str group_id: Group id. (required)
        :param Group group: Group information. (required)
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Group
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'group_id', 'group', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_group`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/groups/{group_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'group_id' in params:
            path_params['group_id'] = params['group_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def update_record(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Create or replace a record.

        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.update_record(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
        else:
            (data) = self.update_record_with_http_info(bucket_id, collection_id, record_id, **kwargs)
            return data

    def update_record_with_http_info(self, bucket_id, collection_id, record_id, **kwargs):
        """
        
        Create or replace a record.

        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.update_record_with_http_info(bucket_id, collection_id, record_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str bucket_id: Bucket id. (required)
        :param str collection_id: Colection id. (required)
        :param str record_id: Record id. (required)
        :param Record record: Record information.
        :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does.
        :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed.
        :param list[str] fields: Fields to compose response (id and last_modified are always returned).
        :return: Record
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['bucket_id', 'collection_id', 'record_id', 'record', 'if_match', 'if_none_match', 'fields']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']):
            raise ValueError("Invalid value for parameter `if_match` when calling `update_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")
        if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']):
            raise ValueError("Invalid value for parameter `if_none_match` when calling `update_record`, must conform to the pattern `/\\\"[0-9]+\\\"/`")

        collection_formats = {}

        resource_path = '/buckets/{bucket_id}/collections/{collection_id}/records/{record_id}'.replace('{format}', 'json')
        path_params = {}
        if 'bucket_id' in params:
            path_params['bucket_id'] = params['bucket_id']
        if 'collection_id' in params:
            path_params['collection_id'] = params['collection_id']
        if 'record_id' in params:
            path_params['record_id'] = params['record_id']

        query_params = {}
        if 'fields' in params:
            query_params['_fields'] = params['fields']
            collection_formats['_fields'] = 'csv'

        header_params = {}
        if 'if_match' in params:
            header_params['If-Match'] = params['if_match']
        if 'if_none_match' in params:
            header_params['If-None-Match'] = params['if_none_match']

        form_params = []
        local_var_files = {}

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

        # 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 = ['basicAuth']

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

    def version(self, **kwargs):
        """
        
        

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

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

    def version_with_http_info(self, **kwargs):
        """
        
        

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

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

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

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

        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 = []

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