# coding: utf-8

"""
    BombBomb

    We make it easy to build relationships using simple videos.

    OpenAPI spec version: 2.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient


class ContactsApi(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 add_contacts_csv(self, mapping_data, list_data, **kwargs):
        """
        Add contacts from a CSV file.
        Add multiple contacts through the upload importer from a CSV file.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str mapping_data: The info sent for the contacts (required)
        :param str list_data: The info sent with the import for the list (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.add_contacts_csv_with_http_info(mapping_data, list_data, **kwargs)
        else:
            (data) = self.add_contacts_csv_with_http_info(mapping_data, list_data, **kwargs)
            return data

    def add_contacts_csv_with_http_info(self, mapping_data, list_data, **kwargs):
        """
        Add contacts from a CSV file.
        Add multiple contacts through the upload importer from a CSV file.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str mapping_data: The info sent for the contacts (required)
        :param str list_data: The info sent with the import for the list (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['mapping_data', 'list_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'mapping_data' in params:
            form_params.append(('mappingData', params['mapping_data']))
        if 'list_data' in params:
            form_params.append(('listData', params['list_data']))

        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/x-www-form-urlencoded'])

        # Authentication setting
        auth_settings = ['BBOAuth2']

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

    def add_new_contact(self, contact_email, **kwargs):
        """
        Add a contact.
        Add a contact to the users list.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str contact_email: Email of the new contact we are adding (required)
        :param str contact_info: The info sent for this contact
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.add_new_contact_with_http_info(contact_email, **kwargs)
        else:
            (data) = self.add_new_contact_with_http_info(contact_email, **kwargs)
            return data

    def add_new_contact_with_http_info(self, contact_email, **kwargs):
        """
        Add a contact.
        Add a contact to the users list.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str contact_email: Email of the new contact we are adding (required)
        :param str contact_info: The info sent for this contact
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['contact_email', 'contact_info']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'contact_email' in params:
            form_params.append(('contactEmail', params['contact_email']))
        if 'contact_info' in params:
            form_params.append(('contactInfo', params['contact_info']))

        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/x-www-form-urlencoded'])

        # Authentication setting
        auth_settings = ['BBOAuth2']

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

    def add_new_custom_field(self, field_name, **kwargs):
        """
        Add custom fields.
        Add a new custom field.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str field_name: Custom field name to be added (required)
        :param str field_type: Custom field type for the field to be added
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.add_new_custom_field_with_http_info(field_name, **kwargs)
        else:
            (data) = self.add_new_custom_field_with_http_info(field_name, **kwargs)
            return data

    def add_new_custom_field_with_http_info(self, field_name, **kwargs):
        """
        Add custom fields.
        Add a new custom field.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str field_name: Custom field name to be added (required)
        :param str field_type: Custom field type for the field to be added
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['field_name', 'field_type']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'field_name' in params:
            form_params.append(('fieldName', params['field_name']))
        if 'field_type' in params:
            form_params.append(('fieldType', params['field_type']))

        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/x-www-form-urlencoded'])

        # Authentication setting
        auth_settings = ['BBOAuth2']

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

    def add_pasted_contacts(self, contact_emails, **kwargs):
        """
        Add pasted contacts.
        Add the pasted contacts to the users list.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str contact_emails: Emails array of the new contacts we are adding (required)
        :param str list_info: Information about the lists id, recalculations on totals, consent etc
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.add_pasted_contacts_with_http_info(contact_emails, **kwargs)
        else:
            (data) = self.add_pasted_contacts_with_http_info(contact_emails, **kwargs)
            return data

    def add_pasted_contacts_with_http_info(self, contact_emails, **kwargs):
        """
        Add pasted contacts.
        Add the pasted contacts to the users list.

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

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str contact_emails: Emails array of the new contacts we are adding (required)
        :param str list_info: Information about the lists id, recalculations on totals, consent etc
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['contact_emails', 'list_info']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'contact_emails' in params:
            form_params.append(('contactEmails', params['contact_emails']))
        if 'list_info' in params:
            form_params.append(('listInfo', params['list_info']))

        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/x-www-form-urlencoded'])

        # Authentication setting
        auth_settings = ['BBOAuth2']

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

    def c_sv_to_object(self, file, **kwargs):
        """
        Format CSV.
        Format a CSV file to an object.

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

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

    def c_sv_to_object_with_http_info(self, file, **kwargs):
        """
        Format CSV.
        Format a CSV file to an object.

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

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

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

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

        resource_path = '/csv-to-object'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

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

        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/x-www-form-urlencoded'])

        # Authentication setting
        auth_settings = ['BBOAuth2']

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

    def delete_contacts(self, **kwargs):
        """
        Delete Contacts
        Delete all contacts within a list, or provide a comma separated list of contactIds to delete.

        This method makes a synchronous HTTP request by default. To make 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_contacts(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str list_id: The list of contacts to be deleted.
        :param str contact_ids: comma separated list of contact ids to delete
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_contacts_with_http_info(**kwargs)
        else:
            (data) = self.delete_contacts_with_http_info(**kwargs)
            return data

    def delete_contacts_with_http_info(self, **kwargs):
        """
        Delete Contacts
        Delete all contacts within a list, or provide a comma separated list of contactIds to delete.

        This method makes a synchronous HTTP request by default. To make 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_contacts_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str list_id: The list of contacts to be deleted.
        :param str contact_ids: comma separated list of contact ids to delete
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['list_id', 'contact_ids']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

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

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'list_id' in params:
            form_params.append(('listId', params['list_id']))
        if 'contact_ids' in params:
            form_params.append(('contactIds', params['contact_ids']))

        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/x-www-form-urlencoded'])

        # Authentication setting
        auth_settings = ['BBOAuth2']

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

    def get_contact_by_id(self, id, **kwargs):
        """
        Get Contact Details
        Get the contact details

        This method makes a synchronous HTTP request by default. To make 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_contact_by_id(id, callback=callback_function)

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

    def get_contact_by_id_with_http_info(self, id, **kwargs):
        """
        Get Contact Details
        Get the contact details

        This method makes a synchronous HTTP request by default. To make 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_contact_by_id_with_http_info(id, callback=callback_function)

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

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

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

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

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

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

        # Authentication setting
        auth_settings = ['BBOAuth2']

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

    def get_custom_fields(self, **kwargs):
        """
        Get custom fields.
        Get the current users custom fields.

        This method makes a synchronous HTTP request by default. To make 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_custom_fields(callback=callback_function)

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

    def get_custom_fields_with_http_info(self, **kwargs):
        """
        Get custom fields.
        Get the current users custom fields.

        This method makes a synchronous HTTP request by default. To make 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_custom_fields_with_http_info(callback=callback_function)

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

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

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

        resource_path = '/contacts/custom_fields/'.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/x-www-form-urlencoded'])

        # Authentication setting
        auth_settings = ['BBOAuth2']

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