# coding: utf-8

"""
    Stakeholder engagement API

    This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.

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


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 UserAuthenticationApi(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_notification_registered_id(self, registered_id, type, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Add device token
        Add device token to push notification from server
        This method makes a synchronous HTTP request by default. To make 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_notification_registered_id(registered_id, type, logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str registered_id: Registered device token to be added (required)
        :param str type: Type of device android, ios (required)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.add_notification_registered_id_with_http_info(registered_id, type, logged_in_user_id, access_token, client_token, **kwargs)
        else:
            (data) = self.add_notification_registered_id_with_http_info(registered_id, type, logged_in_user_id, access_token, client_token, **kwargs)
            return data

    def add_notification_registered_id_with_http_info(self, registered_id, type, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Add device token
        Add device token to push notification from server
        This method makes a synchronous HTTP request by default. To make 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_notification_registered_id_with_http_info(registered_id, type, logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str registered_id: Registered device token to be added (required)
        :param str type: Type of device android, ios (required)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'logged_in_user_id' in params:
            header_params['loggedInUserId'] = params['logged_in_user_id']
        if 'access_token' in params:
            header_params['accessToken'] = params['access_token']
        if 'client_token' in params:
            header_params['clientToken'] = params['client_token']

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

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

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

        # Authentication setting
        auth_settings = ['default']

        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='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 add_user(self, screen_name, email_id, password, client_token, **kwargs):
        """
        Add/Register new user
        Add/Register new user. Returns the user
        This method makes a synchronous HTTP request by default. To make 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_user(screen_name, email_id, password, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str screen_name: unique ID of user (required)
        :param str email_id: email ID (required)
        :param str password: password (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :param str first_name: first name
        :param str middle_name: middle name
        :param str last_name: last name
        :param int birth_day: birth day
        :param int birth_month: birth month
        :param int birth_year: birth year
        :param str addition_information: addition information
        :return: VerveResponseUser
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.add_user_with_http_info(screen_name, email_id, password, client_token, **kwargs)
        else:
            (data) = self.add_user_with_http_info(screen_name, email_id, password, client_token, **kwargs)
            return data

    def add_user_with_http_info(self, screen_name, email_id, password, client_token, **kwargs):
        """
        Add/Register new user
        Add/Register new user. Returns the user
        This method makes a synchronous HTTP request by default. To make 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_user_with_http_info(screen_name, email_id, password, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str screen_name: unique ID of user (required)
        :param str email_id: email ID (required)
        :param str password: password (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :param str first_name: first name
        :param str middle_name: middle name
        :param str last_name: last name
        :param int birth_day: birth day
        :param int birth_month: birth month
        :param int birth_year: birth year
        :param str addition_information: addition information
        :return: VerveResponseUser
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['screen_name', 'email_id', 'password', 'client_token', 'first_name', 'middle_name', 'last_name', 'birth_day', 'birth_month', 'birth_year', 'addition_information']
        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 add_user" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'screen_name' is set
        if ('screen_name' not in params) or (params['screen_name'] is None):
            raise ValueError("Missing the required parameter `screen_name` when calling `add_user`")
        # verify the required parameter 'email_id' is set
        if ('email_id' not in params) or (params['email_id'] is None):
            raise ValueError("Missing the required parameter `email_id` when calling `add_user`")
        # verify the required parameter 'password' is set
        if ('password' not in params) or (params['password'] is None):
            raise ValueError("Missing the required parameter `password` when calling `add_user`")
        # verify the required parameter 'client_token' is set
        if ('client_token' not in params) or (params['client_token'] is None):
            raise ValueError("Missing the required parameter `client_token` when calling `add_user`")


        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'client_token' in params:
            header_params['clientToken'] = params['client_token']

        form_params = []
        local_var_files = {}
        if 'screen_name' in params:
            form_params.append(('screenName', params['screen_name']))
        if 'first_name' in params:
            form_params.append(('firstName', params['first_name']))
        if 'middle_name' in params:
            form_params.append(('middleName', params['middle_name']))
        if 'last_name' in params:
            form_params.append(('lastName', params['last_name']))
        if 'email_id' in params:
            form_params.append(('emailId', params['email_id']))
        if 'password' in params:
            form_params.append(('password', params['password']))
        if 'birth_day' in params:
            form_params.append(('birthDay', params['birth_day']))
        if 'birth_month' in params:
            form_params.append(('birthMonth', params['birth_month']))
        if 'birth_year' in params:
            form_params.append(('birthYear', params['birth_year']))
        if 'addition_information' in params:
            form_params.append(('additionInformation', params['addition_information']))

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

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

        # Authentication setting
        auth_settings = ['default']

        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='VerveResponseUser',
                                        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 authenticate(self, user_name, password, client_token, **kwargs):
        """
        Authenticate User
        Authenticate with username & password
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.authenticate(user_name, password, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str user_name: User name (required)
        :param str password: Password (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: User
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.authenticate_with_http_info(user_name, password, client_token, **kwargs)
        else:
            (data) = self.authenticate_with_http_info(user_name, password, client_token, **kwargs)
            return data

    def authenticate_with_http_info(self, user_name, password, client_token, **kwargs):
        """
        Authenticate User
        Authenticate with username & password
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.authenticate_with_http_info(user_name, password, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str user_name: User name (required)
        :param str password: Password (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: User
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'user_name' in params:
            header_params['userName'] = params['user_name']
        if 'password' in params:
            header_params['password'] = params['password']
        if 'client_token' in params:
            header_params['clientToken'] = params['client_token']

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

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

        # Authentication setting
        auth_settings = ['default']

        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='User',
                                        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 change_password(self, current_password, new_password, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Change password
        Allows the user to change password. Returns true if successful
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.change_password(current_password, new_password, logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str current_password: Current password (required)
        :param str new_password: New password (required)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.change_password_with_http_info(current_password, new_password, logged_in_user_id, access_token, client_token, **kwargs)
        else:
            (data) = self.change_password_with_http_info(current_password, new_password, logged_in_user_id, access_token, client_token, **kwargs)
            return data

    def change_password_with_http_info(self, current_password, new_password, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Change password
        Allows the user to change password. Returns true if successful
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.change_password_with_http_info(current_password, new_password, logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str current_password: Current password (required)
        :param str new_password: New password (required)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'logged_in_user_id' in params:
            header_params['loggedInUserId'] = params['logged_in_user_id']
        if 'access_token' in params:
            header_params['accessToken'] = params['access_token']
        if 'client_token' in params:
            header_params['clientToken'] = params['client_token']

        form_params = []
        local_var_files = {}
        if 'current_password' in params:
            form_params.append(('currentPassword', params['current_password']))
        if 'new_password' in params:
            form_params.append(('newPassword', params['new_password']))

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

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

        # Authentication setting
        auth_settings = ['default']

        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='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 delete_user(self, user_id, client_token, **kwargs):
        """
        Delete user
        Allows the user to delete user. Returns the deleted user
        This method makes a synchronous HTTP request by default. To make 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_user(user_id, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int user_id: userId (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: VerveResponseUser
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_user_with_http_info(user_id, client_token, **kwargs)
        else:
            (data) = self.delete_user_with_http_info(user_id, client_token, **kwargs)
            return data

    def delete_user_with_http_info(self, user_id, client_token, **kwargs):
        """
        Delete user
        Allows the user to delete user. Returns the deleted user
        This method makes a synchronous HTTP request by default. To make 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_user_with_http_info(user_id, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int user_id: userId (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: VerveResponseUser
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'client_token' in params:
            header_params['clientToken'] = params['client_token']

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

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

        # Authentication setting
        auth_settings = ['default']

        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='VerveResponseUser',
                                        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_organizations(self, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Get list of organizations
        Return the list of organizations
        This method makes a synchronous HTTP request by default. To make 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_organizations(logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: VerveResponseOrganizationList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_organizations_with_http_info(logged_in_user_id, access_token, client_token, **kwargs)
        else:
            (data) = self.get_organizations_with_http_info(logged_in_user_id, access_token, client_token, **kwargs)
            return data

    def get_organizations_with_http_info(self, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Get list of organizations
        Return the list of organizations
        This method makes a synchronous HTTP request by default. To make 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_organizations_with_http_info(logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: VerveResponseOrganizationList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'logged_in_user_id' in params:
            header_params['loggedInUserId'] = params['logged_in_user_id']
        if 'access_token' in params:
            header_params['accessToken'] = params['access_token']
        if 'client_token' in params:
            header_params['clientToken'] = params['client_token']

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

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

        # Authentication setting
        auth_settings = ['default']

        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='VerveResponseOrganizationList',
                                        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 logout(self, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Logout
        Logout rest api session. Returns true if successful
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.logout(logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.logout_with_http_info(logged_in_user_id, access_token, client_token, **kwargs)
        else:
            (data) = self.logout_with_http_info(logged_in_user_id, access_token, client_token, **kwargs)
            return data

    def logout_with_http_info(self, logged_in_user_id, access_token, client_token, **kwargs):
        """
        Logout
        Logout rest api session. Returns true if successful
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.logout_with_http_info(logged_in_user_id, access_token, client_token, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str logged_in_user_id: User id of logged / authenticated user (required)
        :param str access_token: Unique session token for user. To get access token user will have to authenticate (required)
        :param str client_token: Use the Client Token. Please generate it from the Applications section under the Production & Sandbox tabs (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

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

        query_params = {}

        header_params = {}
        if 'logged_in_user_id' in params:
            header_params['loggedInUserId'] = params['logged_in_user_id']
        if 'access_token' in params:
            header_params['accessToken'] = params['access_token']
        if 'client_token' in params:
            header_params['clientToken'] = params['client_token']

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

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

        # Authentication setting
        auth_settings = ['default']

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