# coding: utf-8

"""
    \"Data Governance Center: REST API v2\"

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

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


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from swagger_client.api_client import ApiClient


class UsersApi(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):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def resource_user_resource_add_user_groups_for_user_post(self, user_id, **kwargs):  # noqa: E501
        """Adds user to multiple user groups.  # noqa: E501

        Adds user to multiple user groups.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_add_user_groups_for_user_post(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :param JsonAddUserToUserGroupsRequest body: the properties needed to add the user to the user groups
        :return: list[JsonUserGroupImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_add_user_groups_for_user_post_with_http_info(user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_add_user_groups_for_user_post_with_http_info(user_id, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_add_user_groups_for_user_post_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Adds user to multiple user groups.  # noqa: E501

        Adds user to multiple user groups.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_add_user_groups_for_user_post_with_http_info(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :param JsonAddUserToUserGroupsRequest body: the properties needed to add the user to the user groups
        :return: list[JsonUserGroupImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_id', 'body']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resource_user_resource_add_user_groups_for_user_post" % 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 `resource_user_resource_add_user_groups_for_user_post`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}/userGroups', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[JsonUserGroupImpl]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_add_user_post(self, **kwargs):  # noqa: E501
        """Adds new user.  # noqa: E501

        Adds new user.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_add_user_post(async=True)
        >>> result = thread.get()

        :param async bool
        :param JsonAddUserRequest body: the properties of the user to be added
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_add_user_post_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_add_user_post_with_http_info(**kwargs)  # noqa: E501
            return data

    def resource_user_resource_add_user_post_with_http_info(self, **kwargs):  # noqa: E501
        """Adds new user.  # noqa: E501

        Adds new user.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_add_user_post_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param JsonAddUserRequest body: the properties of the user to be added
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_add_users_post(self, **kwargs):  # noqa: E501
        """Adds multiple users.  # noqa: E501

        Adds multiple users.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_add_users_post(async=True)
        >>> result = thread.get()

        :param async bool
        :param list[JsonAddUserRequest] body: the properties of the users to be added
        :return: list[JsonUserImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_add_users_post_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_add_users_post_with_http_info(**kwargs)  # noqa: E501
            return data

    def resource_user_resource_add_users_post_with_http_info(self, **kwargs):  # noqa: E501
        """Adds multiple users.  # noqa: E501

        Adds multiple users.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_add_users_post_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param list[JsonAddUserRequest] body: the properties of the users to be added
        :return: list[JsonUserImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/bulk', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[JsonUserImpl]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_change_user_avatar_patch(self, user_id, **kwargs):  # noqa: E501
        """Changes the avatar for the user identified by given id.  # noqa: E501

        Changes the avatar for the user identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_change_user_avatar_patch(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user to change the avatar for (required)
        :param JsonChangeUserAvatarRequest body: the properties needed to change to avatar for the user
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_change_user_avatar_patch_with_http_info(user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_change_user_avatar_patch_with_http_info(user_id, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_change_user_avatar_patch_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Changes the avatar for the user identified by given id.  # noqa: E501

        Changes the avatar for the user identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_change_user_avatar_patch_with_http_info(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user to change the avatar for (required)
        :param JsonChangeUserAvatarRequest body: the properties needed to change to avatar for the user
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_id', 'body']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resource_user_resource_change_user_avatar_patch" % 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 `resource_user_resource_change_user_avatar_patch`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}/avatar', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_change_user_patch(self, user_id, **kwargs):  # noqa: E501
        """Changes the user with the information that is present in the request.  # noqa: E501

        Changes the user with the information that is present in the request. Only properties that are specified in this request and have not <code>null</code> values are updated. All other properties are ignored.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_change_user_patch(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user to be changed (required)
        :param JsonChangeUserRequest body: the properties of the user to be changed
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_change_user_patch_with_http_info(user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_change_user_patch_with_http_info(user_id, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_change_user_patch_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Changes the user with the information that is present in the request.  # noqa: E501

        Changes the user with the information that is present in the request. Only properties that are specified in this request and have not <code>null</code> values are updated. All other properties are ignored.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_change_user_patch_with_http_info(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user to be changed (required)
        :param JsonChangeUserRequest body: the properties of the user to be changed
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_id', 'body']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resource_user_resource_change_user_patch" % 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 `resource_user_resource_change_user_patch`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_find_users_get(self, **kwargs):  # noqa: E501
        """Returns users matching the given search criteria.  # noqa: E501

        Returns users matching the given search criteria. Only parameters that are specified in this request and have not <code>null</code> values are used for filtering. All other parameters are ignored. The returned users satisfy all constraints that are specified in this search criteria. By default a result containing 1000 users is returned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_find_users_get(async=True)
        >>> result = thread.get()

        :param async bool
        :param str group_id: The <code>id</code> of the group the searched users should belong to
        :param bool include_disabled: Whether disabled users should be included in the search results
        :param int limit: The maximum number of results to retrieve. If not set (value = <tt>0</tt>), the default limit will be used
        :param str name: The name of the user. The search will occur in the username, firstname and lastname (and a combination)
        :param int offset: The first result to retrieve. If not set (value = <tt>0</tt>), results will be retrieved starting from row <tt>0</tt>
        :param bool only_logged_in: Whether only currently logged in users should be returned
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_find_users_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_find_users_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def resource_user_resource_find_users_get_with_http_info(self, **kwargs):  # noqa: E501
        """Returns users matching the given search criteria.  # noqa: E501

        Returns users matching the given search criteria. Only parameters that are specified in this request and have not <code>null</code> values are used for filtering. All other parameters are ignored. The returned users satisfy all constraints that are specified in this search criteria. By default a result containing 1000 users is returned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_find_users_get_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param str group_id: The <code>id</code> of the group the searched users should belong to
        :param bool include_disabled: Whether disabled users should be included in the search results
        :param int limit: The maximum number of results to retrieve. If not set (value = <tt>0</tt>), the default limit will be used
        :param str name: The name of the user. The search will occur in the username, firstname and lastname (and a combination)
        :param int offset: The first result to retrieve. If not set (value = <tt>0</tt>), results will be retrieved starting from row <tt>0</tt>
        :param bool only_logged_in: Whether only currently logged in users should be returned
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['group_id', 'include_disabled', 'limit', 'name', 'offset', 'only_logged_in']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'group_id' in params:
            query_params.append(('groupId', params['group_id']))  # noqa: E501
        if 'include_disabled' in params:
            query_params.append(('includeDisabled', params['include_disabled']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'name' in params:
            query_params.append(('name', params['name']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'only_logged_in' in params:
            query_params.append(('onlyLoggedIn', params['only_logged_in']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_get_avatar_file_get(self, user_id, **kwargs):  # noqa: E501
        """Return the avatar image for the user identified with the requested UUID.  # noqa: E501

        Return the avatar image for the user identified with the requested UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_avatar_file_get(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the UUID of the user to get the avatar UUID for (required)
        :param int height: 
        :param int width: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_get_avatar_file_get_with_http_info(user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_get_avatar_file_get_with_http_info(user_id, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_get_avatar_file_get_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Return the avatar image for the user identified with the requested UUID.  # noqa: E501

        Return the avatar image for the user identified with the requested UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_avatar_file_get_with_http_info(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the UUID of the user to get the avatar UUID for (required)
        :param int height: 
        :param int width: 
        :return: file
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_id', 'height', 'width']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resource_user_resource_get_avatar_file_get" % 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 `resource_user_resource_get_avatar_file_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        query_params = []
        if 'height' in params:
            query_params.append(('height', params['height']))  # noqa: E501
        if 'width' in params:
            query_params.append(('width', params['width']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}/avatar', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='file',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_get_current_user_get(self, **kwargs):  # noqa: E501
        """Returns current user, if logged in.  # noqa: E501

        Returns current user, if logged in.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_current_user_get(async=True)
        >>> result = thread.get()

        :param async bool
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_get_current_user_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_get_current_user_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def resource_user_resource_get_current_user_get_with_http_info(self, **kwargs):  # noqa: E501
        """Returns current user, if logged in.  # noqa: E501

        Returns current user, if logged in.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_current_user_get_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        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'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/current', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_get_user_by_email_address_get(self, email_address, **kwargs):  # noqa: E501
        """Returns user identified by given email address.  # noqa: E501

        Returns user identified by given email address.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_user_by_email_address_get(email_address, async=True)
        >>> result = thread.get()

        :param async bool
        :param str email_address: the email address of the user (required)
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_get_user_by_email_address_get_with_http_info(email_address, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_get_user_by_email_address_get_with_http_info(email_address, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_get_user_by_email_address_get_with_http_info(self, email_address, **kwargs):  # noqa: E501
        """Returns user identified by given email address.  # noqa: E501

        Returns user identified by given email address.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_user_by_email_address_get_with_http_info(email_address, async=True)
        >>> result = thread.get()

        :param async bool
        :param str email_address: the email address of the user (required)
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['email_address']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'email_address' in params:
            path_params['emailAddress'] = params['email_address']  # noqa: E501

        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'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/email/{emailAddress}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_get_user_get(self, user_id, **kwargs):  # noqa: E501
        """Returns user identified by given id.  # noqa: E501

        Returns user identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_user_get(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_get_user_get_with_http_info(user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_get_user_get_with_http_info(user_id, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_get_user_get_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Returns user identified by given id.  # noqa: E501

        Returns user identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_get_user_get_with_http_info(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_id']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resource_user_resource_get_user_get" % 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 `resource_user_resource_get_user_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        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'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_remove_user_from_user_groups_delete(self, user_id, **kwargs):  # noqa: E501
        """Removes user from multiple user groups.  # noqa: E501

        Removes user from multiple user groups.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_remove_user_from_user_groups_delete(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :param JsonRemoveUserFromUserGroupsRequest body: the properties needed to remove the user from user groups
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_remove_user_from_user_groups_delete_with_http_info(user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_remove_user_from_user_groups_delete_with_http_info(user_id, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_remove_user_from_user_groups_delete_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Removes user from multiple user groups.  # noqa: E501

        Removes user from multiple user groups.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_remove_user_from_user_groups_delete_with_http_info(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :param JsonRemoveUserFromUserGroupsRequest body: the properties needed to remove the user from user groups
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_id', 'body']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resource_user_resource_remove_user_from_user_groups_delete" % 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 `resource_user_resource_remove_user_from_user_groups_delete`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}/userGroups', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_user_resource_set_user_groups_for_user_put(self, user_id, **kwargs):  # noqa: E501
        """Sets user groups for user identified by given id.  # noqa: E501

        Sets user groups for user identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_set_user_groups_for_user_put(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :param JsonSetUserGroupsForUserRequest body: the properties needed to add the user to user groups
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_user_resource_set_user_groups_for_user_put_with_http_info(user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_user_resource_set_user_groups_for_user_put_with_http_info(user_id, **kwargs)  # noqa: E501
            return data

    def resource_user_resource_set_user_groups_for_user_put_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Sets user groups for user identified by given id.  # noqa: E501

        Sets user groups for user identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_user_resource_set_user_groups_for_user_put_with_http_info(user_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str user_id: the <code>id</code> of the user (required)
        :param JsonSetUserGroupsForUserRequest body: the properties needed to add the user to user groups
        :return: JsonUserImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_id', 'body']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resource_user_resource_set_user_groups_for_user_put" % 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 `resource_user_resource_set_user_groups_for_user_put`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}/userGroups', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='JsonUserImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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)
