# coding: utf-8

"""
    Command Center operations

    Command Center operations  # 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 CommandCenter.api_client import ApiClient


class RemoteAuthenticationsApi(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 create_remote_authentication_server(self, create_remote_authentication_server, **kwargs):  # noqa: E501
        """create_remote_authentication_server  # noqa: E501

        Create remote authentication server.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_remote_authentication_server(create_remote_authentication_server, async_req=True)
        >>> result = thread.get()

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

    def create_remote_authentication_server_with_http_info(self, create_remote_authentication_server, **kwargs):  # noqa: E501
        """create_remote_authentication_server  # noqa: E501

        Create remote authentication server.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_remote_authentication_server_with_http_info(create_remote_authentication_server, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateRemoteAuthenticationServer create_remote_authentication_server: (required)
        :return: InlineResponse20046
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'create_remote_authentication_server' in params:
            body_params = params['create_remote_authentication_server']
        # 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(
            '/remote_authentications.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20046',  # 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_remote_authentication_server(self, auth_server_id, **kwargs):  # noqa: E501
        """delete_remote_authentication_server  # noqa: E501

        Deletes remote authentication server.  # 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_remote_authentication_server(auth_server_id, async_req=True)
        >>> result = thread.get()

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

    def delete_remote_authentication_server_with_http_info(self, auth_server_id, **kwargs):  # noqa: E501
        """delete_remote_authentication_server  # noqa: E501

        Deletes remote authentication server.  # 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_remote_authentication_server_with_http_info(auth_server_id, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

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

        return self.api_client.call_api(
            '/remote_authentications/{auth_server_id}.json', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Default',  # 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_remote_authentication_server(self, auth_server_id, **kwargs):  # noqa: E501
        """get_remote_authentication_server  # noqa: E501

        Return a single remote authentication server.  # 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_remote_authentication_server(auth_server_id, async_req=True)
        >>> result = thread.get()

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

    def get_remote_authentication_server_with_http_info(self, auth_server_id, **kwargs):  # noqa: E501
        """get_remote_authentication_server  # noqa: E501

        Return a single remote authentication server.  # 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_remote_authentication_server_with_http_info(auth_server_id, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

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

        return self.api_client.call_api(
            '/remote_authentications/{auth_server_id}.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20047',  # 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_list_of_remote_directory(self, auth_server_id, username, password, **kwargs):  # noqa: E501
        """get_user_list_of_remote_directory  # noqa: E501

        Get user list of a remote directory.  # 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_list_of_remote_directory(auth_server_id, username, password, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str auth_server_id: (required)
        :param str username: remote administrator domain and username. Zadara doesn't store your username. (required)
        :param str password: remote administrator password. Zadara doesn't store your password. Your credentials are only used to authenticate session with your directory. (required)
        :return: InlineResponse20048
                 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_list_of_remote_directory_with_http_info(auth_server_id, username, password, **kwargs)  # noqa: E501
        else:
            (data) = self.get_user_list_of_remote_directory_with_http_info(auth_server_id, username, password, **kwargs)  # noqa: E501
            return data

    def get_user_list_of_remote_directory_with_http_info(self, auth_server_id, username, password, **kwargs):  # noqa: E501
        """get_user_list_of_remote_directory  # noqa: E501

        Get user list of a remote directory.  # 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_list_of_remote_directory_with_http_info(auth_server_id, username, password, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str auth_server_id: (required)
        :param str username: remote administrator domain and username. Zadara doesn't store your username. (required)
        :param str password: remote administrator password. Zadara doesn't store your password. Your credentials are only used to authenticate session with your directory. (required)
        :return: InlineResponse20048
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'username' in params:
            query_params.append(('username', params['username']))  # noqa: E501
        if 'password' in params:
            query_params.append(('password', params['password']))  # 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(
            '/remote_authentications/{auth_server_id}/users.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20048',  # 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 import_users_from_remote_directory(self, auth_server_id, import_users_from_remote_directory, **kwargs):  # noqa: E501
        """import_users_from_remote_directory  # noqa: E501

        Imports users from remote directory.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.import_users_from_remote_directory(auth_server_id, import_users_from_remote_directory, async_req=True)
        >>> result = thread.get()

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

    def import_users_from_remote_directory_with_http_info(self, auth_server_id, import_users_from_remote_directory, **kwargs):  # noqa: E501
        """import_users_from_remote_directory  # noqa: E501

        Imports users from remote directory.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.import_users_from_remote_directory_with_http_info(auth_server_id, import_users_from_remote_directory, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str auth_server_id: (required)
        :param ImportUsersFromRemoteDirectory import_users_from_remote_directory: (required)
        :return: InlineResponse20049
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'import_users_from_remote_directory' in params:
            body_params = params['import_users_from_remote_directory']
        # 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(
            '/remote_authentications/{auth_server_id}/users/import.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20049',  # 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_remote_authentication_servers(self, **kwargs):  # noqa: E501
        """list_remote_authentication_servers  # noqa: E501

        Return remote authentication servers list.  # 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_remote_authentication_servers(async_req=True)
        >>> result = thread.get()

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

    def list_remote_authentication_servers_with_http_info(self, **kwargs):  # noqa: E501
        """list_remote_authentication_servers  # noqa: E501

        Return remote authentication servers list.  # 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_remote_authentication_servers_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: InlineResponse20045
                 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 list_remote_authentication_servers" % 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(
            '/remote_authentications.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20045',  # 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)
