# coding: utf-8

"""
    Cloudera Manager API

    <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>  # noqa: E501

    OpenAPI spec version: 7.13.1
    
    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 cm_client.api_client import ApiClient


class ExternalAccountsResourceApi(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_account(self, **kwargs):  # noqa: E501
        """Create a new external account.  # noqa: E501

        Create a new external account. Account names and display names must be unique, i.e. they must not share names or display names with an existing account. Server generates an account ID for the requested account.  # 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_account(async_req=True)
        >>> result = thread.get()

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

    def create_account_with_http_info(self, **kwargs):  # noqa: E501
        """Create a new external account.  # noqa: E501

        Create a new external account. Account names and display names must be unique, i.e. they must not share names or display names with an existing account. Server generates an account ID for the requested account.  # 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_account_with_http_info(async_req=True)
        >>> result = thread.get()

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

        all_params = ['body']  # 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_account" % 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/create', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccount',  # 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_account(self, name, **kwargs):  # noqa: E501
        """Delete an external account, specifying its name.  # noqa: E501

        Delete an external account, specifying its name.  # 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_account(name, async_req=True)
        >>> result = thread.get()

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

    def delete_account_with_http_info(self, name, **kwargs):  # noqa: E501
        """Delete an external account, specifying its name.  # noqa: E501

        Delete an external account, specifying its name.  # 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_account_with_http_info(name, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'name' in params:
            path_params['name'] = params['name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/delete/{name}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccount',  # 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 external_account_command_by_name(self, command_name, name, **kwargs):  # noqa: E501
        """Executes a command on the external account specified by name.  # noqa: E501

        Executes a command on the external account specified by name. <p> Available since API v16.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.external_account_command_by_name(command_name, name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str command_name: The command name. (required)
        :param str name: The external account name. (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.external_account_command_by_name_with_http_info(command_name, name, **kwargs)  # noqa: E501
        else:
            (data) = self.external_account_command_by_name_with_http_info(command_name, name, **kwargs)  # noqa: E501
            return data

    def external_account_command_by_name_with_http_info(self, command_name, name, **kwargs):  # noqa: E501
        """Executes a command on the external account specified by name.  # noqa: E501

        Executes a command on the external account specified by name. <p> Available since API v16.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.external_account_command_by_name_with_http_info(command_name, name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str command_name: The command name. (required)
        :param str name: The external account name. (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'command_name' in params:
            path_params['commandName'] = params['command_name']  # noqa: E501
        if 'name' in params:
            path_params['name'] = params['name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/account/{name}/commands/{commandName}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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_supported_categories(self, **kwargs):  # noqa: E501
        """List of external account categories supported by this Cloudera Manager.  # noqa: E501

        List of external account categories supported by this Cloudera Manager.  # 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_supported_categories(async_req=True)
        >>> result = thread.get()

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

    def get_supported_categories_with_http_info(self, **kwargs):  # noqa: E501
        """List of external account categories supported by this Cloudera Manager.  # noqa: E501

        List of external account categories supported by this Cloudera Manager.  # 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_supported_categories_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ApiExternalAccountCategoryList
                 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_supported_categories" % 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/supportedCategories', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccountCategoryList',  # 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_supported_types(self, category_name, **kwargs):  # noqa: E501
        """List of external account types supported by this Cloudera Manager by category.  # noqa: E501

        List of external account types supported by this Cloudera Manager by category.  # 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_supported_types(category_name, async_req=True)
        >>> result = thread.get()

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

    def get_supported_types_with_http_info(self, category_name, **kwargs):  # noqa: E501
        """List of external account types supported by this Cloudera Manager by category.  # noqa: E501

        List of external account types supported by this Cloudera Manager by category.  # 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_supported_types_with_http_info(category_name, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'category_name' in params:
            path_params['categoryName'] = params['category_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/supportedTypes/{categoryName}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccountTypeList',  # 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_external_account_commands(self, type_name, **kwargs):  # noqa: E501
        """Lists all the commands that can be executed by name on the provided external account type.  # noqa: E501

        Lists all the commands that can be executed by name on the provided external account type. <p> Available since API v16.  # 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_external_account_commands(type_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str type_name: The external account type name (required)
        :return: ApiCommandMetadataList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_external_account_commands_with_http_info(type_name, **kwargs)  # noqa: E501
        else:
            (data) = self.list_external_account_commands_with_http_info(type_name, **kwargs)  # noqa: E501
            return data

    def list_external_account_commands_with_http_info(self, type_name, **kwargs):  # noqa: E501
        """Lists all the commands that can be executed by name on the provided external account type.  # noqa: E501

        Lists all the commands that can be executed by name on the provided external account type. <p> Available since API v16.  # 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_external_account_commands_with_http_info(type_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str type_name: The external account type name (required)
        :return: ApiCommandMetadataList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'type_name' in params:
            path_params['typeName'] = params['type_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/typeInfo/{typeName}/commandsByName', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommandMetadataList',  # 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 read_account(self, name, **kwargs):  # noqa: E501
        """Get a single external account by account name.  # noqa: E501

        Get a single external account by account name.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_account(name, async_req=True)
        >>> result = thread.get()

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

    def read_account_with_http_info(self, name, **kwargs):  # noqa: E501
        """Get a single external account by account name.  # noqa: E501

        Get a single external account by account name.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_account_with_http_info(name, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

        query_params = []
        if 'view' in params:
            query_params.append(('view', params['view']))  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/account/{name}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccount',  # 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 read_account_by_display_name(self, display_name, **kwargs):  # noqa: E501
        """Get a single external account by display name.  # noqa: E501

        Get a single external account by display name.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_account_by_display_name(display_name, async_req=True)
        >>> result = thread.get()

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

    def read_account_by_display_name_with_http_info(self, display_name, **kwargs):  # noqa: E501
        """Get a single external account by display name.  # noqa: E501

        Get a single external account by display name.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_account_by_display_name_with_http_info(display_name, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

        query_params = []
        if 'view' in params:
            query_params.append(('view', params['view']))  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/accountByDisplayName/{displayName}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccount',  # 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 read_account_credentials(self, name, **kwargs):  # noqa: E501
        """Get un-redacted credentials of an external account for the given account name, currently supported only for ALTUS accounts.  # noqa: E501

        Get un-redacted credentials of an external account for the given account name, currently supported only for ALTUS accounts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_account_credentials(name, async_req=True)
        >>> result = thread.get()

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

    def read_account_credentials_with_http_info(self, name, **kwargs):  # noqa: E501
        """Get un-redacted credentials of an external account for the given account name, currently supported only for ALTUS accounts.  # noqa: E501

        Get un-redacted credentials of an external account for the given account name, currently supported only for ALTUS accounts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_account_credentials_with_http_info(name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: The external account name (required)
        :return: ApiConfigList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'name' in params:
            path_params['name'] = params['name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/account/{name}/credentials', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiConfigList',  # 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 read_accounts(self, type_name, **kwargs):  # noqa: E501
        """Get a list of external accounts for a specific account type.  # noqa: E501

        Get a list of external accounts for a specific account type.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_accounts(type_name, async_req=True)
        >>> result = thread.get()

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

    def read_accounts_with_http_info(self, type_name, **kwargs):  # noqa: E501
        """Get a list of external accounts for a specific account type.  # noqa: E501

        Get a list of external accounts for a specific account type.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_accounts_with_http_info(type_name, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

        query_params = []
        if 'view' in params:
            query_params.append(('view', params['view']))  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/type/{typeName}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccountList',  # 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 read_config(self, name, **kwargs):  # noqa: E501
        """Get configs of external account for the given account name.  # noqa: E501

        Get configs of external account for the given account name.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_config(name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: The external account name (required)
        :param str view: The view to materialize, either \"summary\" or \"full\".
        :return: ApiConfigList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.read_config_with_http_info(name, **kwargs)  # noqa: E501
        else:
            (data) = self.read_config_with_http_info(name, **kwargs)  # noqa: E501
            return data

    def read_config_with_http_info(self, name, **kwargs):  # noqa: E501
        """Get configs of external account for the given account name.  # noqa: E501

        Get configs of external account for the given account name.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_config_with_http_info(name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: The external account name (required)
        :param str view: The view to materialize, either \"summary\" or \"full\".
        :return: ApiConfigList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'view' in params:
            query_params.append(('view', params['view']))  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/account/{name}/config', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiConfigList',  # 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_account(self, **kwargs):  # noqa: E501
        """Update an external account.  # noqa: E501

        Update an external account.  # 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_account(async_req=True)
        >>> result = thread.get()

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

    def update_account_with_http_info(self, **kwargs):  # noqa: E501
        """Update an external account.  # noqa: E501

        Update an external account.  # 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_account_with_http_info(async_req=True)
        >>> result = thread.get()

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

        all_params = ['body']  # 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_account" % 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/update', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiExternalAccount',  # 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_config(self, name, **kwargs):  # noqa: E501
        """Upadate configs of external account for the given account name.  # noqa: E501

        Upadate configs of external account for the given account name.  # 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_config(name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: The external account name (required)
        :param ApiConfigList body: Settings to update.
        :param str message: Optional message describing the changes.
        :return: ApiConfigList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_config_with_http_info(name, **kwargs)  # noqa: E501
        else:
            (data) = self.update_config_with_http_info(name, **kwargs)  # noqa: E501
            return data

    def update_config_with_http_info(self, name, **kwargs):  # noqa: E501
        """Upadate configs of external account for the given account name.  # noqa: E501

        Upadate configs of external account for the given account name.  # 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_config_with_http_info(name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: The external account name (required)
        :param ApiConfigList body: Settings to update.
        :param str message: Optional message describing the changes.
        :return: ApiConfigList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['name', 'body', 'message']  # 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_config" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'name' is set
        if ('name' not in params or
                params['name'] is None):
            raise ValueError("Missing the required parameter `name` when calling `update_config`")  # noqa: E501

        collection_formats = {}

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

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

        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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/externalAccounts/account/{name}/config', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiConfigList',  # 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)
