# coding: utf-8

"""
    Zadara VPSA Storage Array REST API

     # Overview  This document outlines the methods available for administrating your Zadara Storage VPSA&#8482;. The Zadara Storage Array REST API   supports form-encoded, JSON, and XML requests, and can return either JSON or XML responses.  ## Usage  The majority of the APIs available require authentication which requires an API token to use. You can retrieve this token through the   Users section of your VPSA, or through the API using the \"Return a user's access key\" API in the Users Section below.  ## Authentication Methods  The authentication token can be passed either through the access_key parameter inside of the body of the REST API request, or   through the X-Access-Key header.  ## Timeouts  By default, all operations that don't complete within five seconds will return a message informing you that the action may take some  time to complete. When using the API, this can cause some actions, such as large volume creation, to be undesirably asynchronous.  You can specify your own timeout with the timeout parameter, in seconds, and a timeout value of -1 specifies an infinite timeout.  ## Specific Fields For Product  Some of the fields/actions used in the API should be used only for a specific product. The following tags are used to mark which   product responds to the fields/actions  VPSA Flash Array  VPSA Storage Array - Hybrid VPSA  ## Questions  If you have any questions or need support involving the REST API, please contact for assistance.   # noqa: E501

    OpenAPI spec version: 23.03-sp1
    Contact: support@zadarastorage.com
    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 Vpsa.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 add_user(self, add_user, **kwargs):  # noqa: E501
        """add_user  # noqa: E501

        Adds a new user.  Available to the primary user only.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_user(add_user, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddUser add_user: (required)
        :return: InlineResponse200211
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.add_user_with_http_info(add_user, **kwargs)  # noqa: E501
        else:
            (data) = self.add_user_with_http_info(add_user, **kwargs)  # noqa: E501
            return data

    def add_user_with_http_info(self, add_user, **kwargs):  # noqa: E501
        """add_user  # noqa: E501

        Adds a new user.  Available to the primary user only.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_user_with_http_info(add_user, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddUser add_user: (required)
        :return: InlineResponse200211
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['add_user']  # noqa: E501
        all_params.append('async_req')
        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 add_user" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'add_user' is set
        if self.api_client.client_side_validation and ('add_user' not in params or
                                                       params['add_user'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `add_user` when calling `add_user`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

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

        Change a user's password.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_user_pass(change_user_pass, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ChangeUserPass change_user_pass: (required)
        :return: InlineResponse200216
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.change_user_pass_with_http_info(change_user_pass, **kwargs)  # noqa: E501
        else:
            (data) = self.change_user_pass_with_http_info(change_user_pass, **kwargs)  # noqa: E501
            return data

    def change_user_pass_with_http_info(self, change_user_pass, **kwargs):  # noqa: E501
        """change_user_pass  # noqa: E501

        Change a user's password.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_user_pass_with_http_info(change_user_pass, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ChangeUserPass change_user_pass: (required)
        :return: InlineResponse200216
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['change_user_pass']  # noqa: E501
        all_params.append('async_req')
        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 change_user_pass" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'change_user_pass' is set
        if self.api_client.client_side_validation and ('change_user_pass' not in params or
                                                       params['change_user_pass'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `change_user_pass` when calling `change_user_pass`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/password.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200216',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_user_pass_by_temp_code(self, id, change_user_pass_by_temp_code, **kwargs):  # noqa: E501
        """change_user_pass_by_temp_code  # noqa: E501

        Change a user's password using a temporary password code.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_user_pass_by_temp_code(id, change_user_pass_by_temp_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param ChangeUserPassByTempCode change_user_pass_by_temp_code: (required)
        :return: InlineResponse200217
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.change_user_pass_by_temp_code_with_http_info(id, change_user_pass_by_temp_code, **kwargs)  # noqa: E501
        else:
            (data) = self.change_user_pass_by_temp_code_with_http_info(id, change_user_pass_by_temp_code, **kwargs)  # noqa: E501
            return data

    def change_user_pass_by_temp_code_with_http_info(self, id, change_user_pass_by_temp_code, **kwargs):  # noqa: E501
        """change_user_pass_by_temp_code  # noqa: E501

        Change a user's password using a temporary password code.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_user_pass_by_temp_code_with_http_info(id, change_user_pass_by_temp_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param ChangeUserPassByTempCode change_user_pass_by_temp_code: (required)
        :return: InlineResponse200217
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'change_user_pass_by_temp_code']  # noqa: E501
        all_params.append('async_req')
        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 change_user_pass_by_temp_code" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `change_user_pass_by_temp_code`")  # noqa: E501
        # verify the required parameter 'change_user_pass_by_temp_code' is set
        if self.api_client.client_side_validation and ('change_user_pass_by_temp_code' not in params or
                                                       params['change_user_pass_by_temp_code'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `change_user_pass_by_temp_code` when calling `change_user_pass_by_temp_code`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/{id}/password_code.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200217',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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, username, **kwargs):  # noqa: E501
        """delete_user  # noqa: E501

        Delete a user. Available to the primary user only.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_user(username, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: (required)
        :return: InlineResponse200213
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_user_with_http_info(username, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_user_with_http_info(username, **kwargs)  # noqa: E501
            return data

    def delete_user_with_http_info(self, username, **kwargs):  # noqa: E501
        """delete_user  # noqa: E501

        Delete a user. Available to the primary user only.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_user_with_http_info(username, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: (required)
        :return: InlineResponse200213
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['username']  # noqa: E501
        all_params.append('async_req')
        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 delete_user" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'username' is set
        if self.api_client.client_side_validation and ('username' not in params or
                                                       params['username'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `username` when calling `delete_user`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'username' in params:
            path_params['username'] = params['username']  # 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/{username}.json', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200213',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 disable_cloud_admin_access(self, **kwargs):  # noqa: E501
        """disable_cloud_admin_access  # noqa: E501

        Disables cloud admin access.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.disable_cloud_admin_access(async_req=True)
        >>> result = thread.get()

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

    def disable_cloud_admin_access_with_http_info(self, **kwargs):  # noqa: E501
        """disable_cloud_admin_access  # noqa: E501

        Disables cloud admin access.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.disable_cloud_admin_access_with_http_info(async_req=True)
        >>> result = thread.get()

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

        all_params = []  # noqa: E501
        all_params.append('async_req')
        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 disable_cloud_admin_access" % 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/admin_access/disable.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200220',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 enable_cloud_admin_access(self, **kwargs):  # noqa: E501
        """enable_cloud_admin_access  # noqa: E501

        Enables cloud admin access.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.enable_cloud_admin_access(async_req=True)
        >>> result = thread.get()

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

    def enable_cloud_admin_access_with_http_info(self, **kwargs):  # noqa: E501
        """enable_cloud_admin_access  # noqa: E501

        Enables cloud admin access.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.enable_cloud_admin_access_with_http_info(async_req=True)
        >>> result = thread.get()

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

        all_params = []  # noqa: E501
        all_params.append('async_req')
        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 enable_cloud_admin_access" % 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/admin_access/enable.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200219',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_pass_requirements(self, **kwargs):  # noqa: E501
        """get_pass_requirements  # noqa: E501

        Get the password requirements settings.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pass_requirements(async_req=True)
        >>> result = thread.get()

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

    def get_pass_requirements_with_http_info(self, **kwargs):  # noqa: E501
        """get_pass_requirements  # noqa: E501

        Get the password requirements settings.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pass_requirements_with_http_info(async_req=True)
        >>> result = thread.get()

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

        all_params = []  # noqa: E501
        all_params.append('async_req')
        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 get_pass_requirements" % 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/password_requirements_settings.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200222',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_user_details(self, get_user_details, **kwargs):  # noqa: E501
        """get_user_details  # noqa: E501

        Returns a user's details.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_user_details(get_user_details, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GetUserDetails get_user_details: (required)
        :return: InlineResponse200215
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_user_details_with_http_info(get_user_details, **kwargs)  # noqa: E501
        else:
            (data) = self.get_user_details_with_http_info(get_user_details, **kwargs)  # noqa: E501
            return data

    def get_user_details_with_http_info(self, get_user_details, **kwargs):  # noqa: E501
        """get_user_details  # noqa: E501

        Returns a user's details.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_user_details_with_http_info(get_user_details, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GetUserDetails get_user_details: (required)
        :return: InlineResponse200215
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['get_user_details']  # noqa: E501
        all_params.append('async_req')
        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 get_user_details" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'get_user_details' is set
        if self.api_client.client_side_validation and ('get_user_details' not in params or
                                                       params['get_user_details'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `get_user_details` when calling `get_user_details`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

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

        Issues a temporary password code to reset a user's password.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.issue_user_temp_code(issue_user_temp_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param IssueUserTempCode issue_user_temp_code: (required)
        :return: InlineResponse200218
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.issue_user_temp_code_with_http_info(issue_user_temp_code, **kwargs)  # noqa: E501
        else:
            (data) = self.issue_user_temp_code_with_http_info(issue_user_temp_code, **kwargs)  # noqa: E501
            return data

    def issue_user_temp_code_with_http_info(self, issue_user_temp_code, **kwargs):  # noqa: E501
        """issue_user_temp_code  # noqa: E501

        Issues a temporary password code to reset a user's password.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.issue_user_temp_code_with_http_info(issue_user_temp_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param IssueUserTempCode issue_user_temp_code: (required)
        :return: InlineResponse200218
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['issue_user_temp_code']  # noqa: E501
        all_params.append('async_req')
        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 issue_user_temp_code" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'issue_user_temp_code' is set
        if self.api_client.client_side_validation and ('issue_user_temp_code' not in params or
                                                       params['issue_user_temp_code'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `issue_user_temp_code` when calling `issue_user_temp_code`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

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

        List all users.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_users(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int start: The item number to start from. 0 starts from the beginning.
        :param int limit: The total number of records to return.
        :return: InlineResponse200210
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_users_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_users_with_http_info(**kwargs)  # noqa: E501
            return data

    def list_users_with_http_info(self, **kwargs):  # noqa: E501
        """list_users  # noqa: E501

        List all users.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_users_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int start: The item number to start from. 0 starts from the beginning.
        :param int limit: The total number of records to return.
        :return: InlineResponse200210
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start', 'limit']  # noqa: E501
        all_params.append('async_req')
        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 list_users" % key
                )
            params[key] = val
        del params['kwargs']

        if self.api_client.client_side_validation and ('start' in params and params['start'] < 0):  # noqa: E501
            raise ValueError("Invalid value for parameter `start` when calling `list_users`, must be a value greater than or equal to `0`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start' in params:
            query_params.append(('start', params['start']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200210',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 reset_user_access_key(self, username, reset_user_access_key, **kwargs):  # noqa: E501
        """reset_user_access_key  # noqa: E501

        Reset a user's access key.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.reset_user_access_key(username, reset_user_access_key, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: Username or email address. (required)
        :param ResetUserAccessKey reset_user_access_key: (required)
        :return: InlineResponse200214
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.reset_user_access_key_with_http_info(username, reset_user_access_key, **kwargs)  # noqa: E501
        else:
            (data) = self.reset_user_access_key_with_http_info(username, reset_user_access_key, **kwargs)  # noqa: E501
            return data

    def reset_user_access_key_with_http_info(self, username, reset_user_access_key, **kwargs):  # noqa: E501
        """reset_user_access_key  # noqa: E501

        Reset a user's access key.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.reset_user_access_key_with_http_info(username, reset_user_access_key, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: Username or email address. (required)
        :param ResetUserAccessKey reset_user_access_key: (required)
        :return: InlineResponse200214
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['username', 'reset_user_access_key']  # noqa: E501
        all_params.append('async_req')
        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 reset_user_access_key" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'username' is set
        if self.api_client.client_side_validation and ('username' not in params or
                                                       params['username'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `username` when calling `reset_user_access_key`")  # noqa: E501
        # verify the required parameter 'reset_user_access_key' is set
        if self.api_client.client_side_validation and ('reset_user_access_key' not in params or
                                                       params['reset_user_access_key'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `reset_user_access_key` when calling `reset_user_access_key`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/{username}/access_key.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200214',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_user_info(self, username, update_user_info, **kwargs):  # noqa: E501
        """update_user_info  # noqa: E501

        Update a user's info.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_user_info(username, update_user_info, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: (required)
        :param UpdateUserInfo update_user_info: (required)
        :return: InlineResponse200212
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_user_info_with_http_info(username, update_user_info, **kwargs)  # noqa: E501
        else:
            (data) = self.update_user_info_with_http_info(username, update_user_info, **kwargs)  # noqa: E501
            return data

    def update_user_info_with_http_info(self, username, update_user_info, **kwargs):  # noqa: E501
        """update_user_info  # noqa: E501

        Update a user's info.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_user_info_with_http_info(username, update_user_info, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: (required)
        :param UpdateUserInfo update_user_info: (required)
        :return: InlineResponse200212
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['username', 'update_user_info']  # noqa: E501
        all_params.append('async_req')
        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 update_user_info" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'username' is set
        if self.api_client.client_side_validation and ('username' not in params or
                                                       params['username'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `username` when calling `update_user_info`")  # noqa: E501
        # verify the required parameter 'update_user_info' is set
        if self.api_client.client_side_validation and ('update_user_info' not in params or
                                                       params['update_user_info'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `update_user_info` when calling `update_user_info`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/{username}.json', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200212',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_user_roles(self, username, update_user_roles, **kwargs):  # noqa: E501
        """update_user_roles  # noqa: E501

        Update a user's roles.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_user_roles(username, update_user_roles, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: (required)
        :param UpdateUserRoles update_user_roles: (required)
        :return: InlineResponse200221
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_user_roles_with_http_info(username, update_user_roles, **kwargs)  # noqa: E501
        else:
            (data) = self.update_user_roles_with_http_info(username, update_user_roles, **kwargs)  # noqa: E501
            return data

    def update_user_roles_with_http_info(self, username, update_user_roles, **kwargs):  # noqa: E501
        """update_user_roles  # noqa: E501

        Update a user's roles.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_user_roles_with_http_info(username, update_user_roles, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str username: (required)
        :param UpdateUserRoles update_user_roles: (required)
        :return: InlineResponse200221
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['username', 'update_user_roles']  # noqa: E501
        all_params.append('async_req')
        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 update_user_roles" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'username' is set
        if self.api_client.client_side_validation and ('username' not in params or
                                                       params['username'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `username` when calling `update_user_roles`")  # noqa: E501
        # verify the required parameter 'update_user_roles' is set
        if self.api_client.client_side_validation and ('update_user_roles' not in params or
                                                       params['update_user_roles'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `update_user_roles` when calling `update_user_roles`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/users/{username}/roles.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200221',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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)
