# coding: utf-8

#
# Copyright 2010-2014 Ning, Inc.
# Copyright 2014-2020 Groupon, Inc
# Copyright 2020-2021 Equinix, Inc
# Copyright 2014-2021 The Billing Project, LLC
#
# The Billing Project, LLC licenses this file to you under the Apache License, version 2.0
# (the "License"); you may not use this file except in compliance with the
# License.  You may obtain a copy of the License at:
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# License for the specific language governing permissions and limitations
# under the License.
#

"""
    Kill Bill

    Kill Bill is an open-source billing and payments platform  # noqa: E501

    OpenAPI spec version: 0.22.22-SNAPSHOT
    
    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 killbill.api_client import ApiClient


class AccountApi(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_account_blocking_state(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Block an account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.add_account_blocking_state(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param BlockingState body: (required)
        :param Str created_by: (required)
        :param Date requested_date:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: List[BlockingState]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.add_account_blocking_state_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.add_account_blocking_state_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def add_account_blocking_state_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Block an account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.add_account_blocking_state_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param BlockingState body: (required)
        :param Str created_by: (required)
        :param Date requested_date:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: List[BlockingState]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'requested_date', 'plugin_property', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `add_account_blocking_state`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'requested_date' in params:
            query_params.append(('requestedDate', params['requested_date']))  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/block', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[BlockingState]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def add_email(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add account email  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.add_email(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param AccountEmail body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: List[AccountEmail]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.add_email_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.add_email_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def add_email_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add account email  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.add_email_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param AccountEmail body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: List[AccountEmail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `add_email`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/emails', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[AccountEmail]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def close_account(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Close account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Bool cancel_all_subscriptions:
        :param Bool write_off_unpaid_invoices:
        :param Bool item_adjust_unpaid_invoices:
        :param Bool remove_future_notifications:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.close_account_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.close_account_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
            return data

    def close_account_with_http_info(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Close account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Bool cancel_all_subscriptions:
        :param Bool write_off_unpaid_invoices:
        :param Bool item_adjust_unpaid_invoices:
        :param Bool remove_future_notifications:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'created_by', 'cancel_all_subscriptions', 'write_off_unpaid_invoices', 'item_adjust_unpaid_invoices', 'remove_future_notifications', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `close_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'cancel_all_subscriptions' in params:
            query_params.append(('cancelAllSubscriptions', params['cancel_all_subscriptions']))  # noqa: E501
        if 'write_off_unpaid_invoices' in params:
            query_params.append(('writeOffUnpaidInvoices', params['write_off_unpaid_invoices']))  # noqa: E501
        if 'item_adjust_unpaid_invoices' in params:
            query_params.append(('itemAdjustUnpaidInvoices', params['item_adjust_unpaid_invoices']))  # noqa: E501
        if 'remove_future_notifications' in params:
            query_params.append(('removeFutureNotifications', params['remove_future_notifications']))  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_account(self, body=None, created_by=None, **kwargs):  # noqa: E501
        """Create account  # noqa: E501

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

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

    def create_account_with_http_info(self, body=None, created_by=None, **kwargs):  # noqa: E501
        """Create account  # noqa: E501

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

        :param async bool
        :param Account body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: Account
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Account',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_account_custom_fields(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add custom fields to account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_account_custom_fields(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param List[CustomField] body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: List[CustomField]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.create_account_custom_fields_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.create_account_custom_fields_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def create_account_custom_fields_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add custom fields to account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_account_custom_fields_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param List[CustomField] body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: List[CustomField]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `create_account_custom_fields`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/customFields', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[CustomField]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_account_tags(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add tags to account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_account_tags(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param List[Str] body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: List[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.create_account_tags_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.create_account_tags_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def create_account_tags_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add tags to account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_account_tags_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param List[Str] body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: List[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `create_account_tags`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/tags', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Tag]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_payment_method(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add a payment method  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_payment_method(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param PaymentMethod body: (required)
        :param Str created_by: (required)
        :param Bool is_default:
        :param Bool pay_all_unpaid_invoices:
        :param List[Str] control_plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: PaymentMethod
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.create_payment_method_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.create_payment_method_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def create_payment_method_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Add a payment method  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_payment_method_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param PaymentMethod body: (required)
        :param Str created_by: (required)
        :param Bool is_default:
        :param Bool pay_all_unpaid_invoices:
        :param List[Str] control_plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: PaymentMethod
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'is_default', 'pay_all_unpaid_invoices', 'control_plugin_name', 'plugin_property', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `create_payment_method`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'is_default' in params:
            query_params.append(('isDefault', params['is_default']))  # noqa: E501
        if 'pay_all_unpaid_invoices' in params:
            query_params.append(('payAllUnpaidInvoices', params['pay_all_unpaid_invoices']))  # noqa: E501
        if 'control_plugin_name' in params:
            query_params.append(('controlPluginName', params['control_plugin_name']))  # noqa: E501
            collection_formats['controlPluginName'] = 'multi'  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/paymentMethods', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PaymentMethod',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_account_custom_fields(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Remove custom fields from account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param List[Str] custom_field:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.delete_account_custom_fields_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_account_custom_fields_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
            return data

    def delete_account_custom_fields_with_http_info(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Remove custom fields from account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param List[Str] custom_field:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'created_by', 'custom_field', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `delete_account_custom_fields`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'custom_field' in params:
            query_params.append(('customField', params['custom_field']))  # noqa: E501
            collection_formats['customField'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/customFields', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_account_tags(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Remove tags from account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param List[Str] tag_def:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.delete_account_tags_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_account_tags_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
            return data

    def delete_account_tags_with_http_info(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Remove tags from account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param List[Str] tag_def:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'created_by', 'tag_def', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `delete_account_tags`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'tag_def' in params:
            query_params.append(('tagDef', params['tag_def']))  # noqa: E501
            collection_formats['tagDef'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/tags', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve an account by id  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: Account
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_account_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_account_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_account_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve an account by id  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: Account
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'account_with_balance', 'account_with_balance_and_cba', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'account_with_balance' in params:
            query_params.append(('accountWithBalance', params['account_with_balance']))  # noqa: E501
        if 'account_with_balance_and_cba' in params:
            query_params.append(('accountWithBalanceAndCBA', params['account_with_balance_and_cba']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Account',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_audit_logs(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve audit logs by account id  # noqa: E501

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

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

    def get_account_audit_logs_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve audit logs by account id  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :return: List[AuditLog]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account_audit_logs`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/auditLogs', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[AuditLog]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_audit_logs_with_history(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account audit logs with history by account id  # noqa: E501

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

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

    def get_account_audit_logs_with_history_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account audit logs with history by account id  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :return: List[AuditLog]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account_audit_logs_with_history`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/auditLogsWithHistory', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[AuditLog]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_bundles(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve bundles for account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str external_key:
        :param Str bundles_filter:
        :param Str audit:
        :return: List[Bundle]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_account_bundles_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_account_bundles_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_account_bundles_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve bundles for account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str external_key:
        :param Str bundles_filter:
        :param Str audit:
        :return: List[Bundle]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'external_key', 'bundles_filter', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account_bundles`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'external_key' in params:
            query_params.append(('externalKey', params['external_key']))  # noqa: E501
        if 'bundles_filter' in params:
            query_params.append(('bundlesFilter', params['bundles_filter']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/bundles', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Bundle]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_by_key(self, external_key=None, **kwargs):  # noqa: E501
        """Retrieve an account by external key  # noqa: E501

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

        :param async bool
        :param Str external_key: (required)
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: Account
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_account_by_key_with_http_info(external_key, **kwargs)  # noqa: E501
        else:
            (data) = self.get_account_by_key_with_http_info(external_key, **kwargs)  # noqa: E501
            return data

    def get_account_by_key_with_http_info(self, external_key=None, **kwargs):  # noqa: E501
        """Retrieve an account by external key  # noqa: E501

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

        :param async bool
        :param Str external_key: (required)
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: Account
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['external_key', 'account_with_balance', 'account_with_balance_and_cba', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'external_key' in params:
            query_params.append(('externalKey', params['external_key']))  # noqa: E501
        if 'account_with_balance' in params:
            query_params.append(('accountWithBalance', params['account_with_balance']))  # noqa: E501
        if 'account_with_balance_and_cba' in params:
            query_params.append(('accountWithBalanceAndCBA', params['account_with_balance_and_cba']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Account',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_custom_fields(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account custom fields  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str audit:
        :return: List[CustomField]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_account_custom_fields_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_account_custom_fields_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_account_custom_fields_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account custom fields  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str audit:
        :return: List[CustomField]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account_custom_fields`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/customFields', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[CustomField]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_email_audit_logs_with_history(self, account_id=None, account_email_id=None, **kwargs):  # noqa: E501
        """Retrieve account email audit logs with history by id  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str account_email_id: (required)
        :return: List[AuditLog]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_account_email_audit_logs_with_history_with_http_info(account_id, account_email_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_account_email_audit_logs_with_history_with_http_info(account_id, account_email_id, **kwargs)  # noqa: E501
            return data

    def get_account_email_audit_logs_with_history_with_http_info(self, account_id=None, account_email_id=None, **kwargs):  # noqa: E501
        """Retrieve account email audit logs with history by id  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str account_email_id: (required)
        :return: List[AuditLog]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account_email_audit_logs_with_history`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        if 'account_email_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_email_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_email_id` when calling `get_account_email_audit_logs_with_history`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

        path_params = {}
        if 'account_id' in params:
            path_params['accountId'] = params['account_id']  # noqa: E501
        if 'account_email_id' in params:
            path_params['accountEmailId'] = params['account_email_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/emails/{accountEmailId}/auditLogsWithHistory', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[AuditLog]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_tags(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account tags  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool included_deleted:
        :param Str audit:
        :return: List[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_account_tags_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_account_tags_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_account_tags_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account tags  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool included_deleted:
        :param Str audit:
        :return: List[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account_tags`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'included_deleted' in params:
            query_params.append(('includedDeleted', params['included_deleted']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/tags', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Tag]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_account_timeline(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account timeline  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool parallel:
        :param Str audit:
        :return: AccountTimeline
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_account_timeline_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_account_timeline_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_account_timeline_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account timeline  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool parallel:
        :param Str audit:
        :return: AccountTimeline
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_account_timeline`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'parallel' in params:
            query_params.append(('parallel', params['parallel']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/timeline', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AccountTimeline',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_accounts(self, **kwargs):  # noqa: E501
        """List accounts  # noqa: E501

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

        :param async bool
        :param Int offset:
        :param Int limit:
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: List[Account]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_accounts_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_accounts_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_accounts_with_http_info(self, **kwargs):  # noqa: E501
        """List accounts  # noqa: E501

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

        :param async bool
        :param Int offset:
        :param Int limit:
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: List[Account]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['offset', 'limit', 'account_with_balance', 'account_with_balance_and_cba', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'account_with_balance' in params:
            query_params.append(('accountWithBalance', params['account_with_balance']))  # noqa: E501
        if 'account_with_balance_and_cba' in params:
            query_params.append(('accountWithBalanceAndCBA', params['account_with_balance_and_cba']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/pagination', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Account]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_all_custom_fields(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account customFields  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str object_type:
        :param Str audit:
        :return: List[CustomField]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_all_custom_fields_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_all_custom_fields_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_all_custom_fields_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account customFields  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str object_type:
        :param Str audit:
        :return: List[CustomField]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_all_custom_fields`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'object_type' in params:
            query_params.append(('objectType', params['object_type']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/allCustomFields', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[CustomField]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_all_tags(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account tags  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str object_type:
        :param Bool included_deleted:
        :param Str audit:
        :return: List[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_all_tags_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_all_tags_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_all_tags_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account tags  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str object_type:
        :param Bool included_deleted:
        :param Str audit:
        :return: List[Tag]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'object_type', 'included_deleted', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_all_tags`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'object_type' in params:
            query_params.append(('objectType', params['object_type']))  # noqa: E501
        if 'included_deleted' in params:
            query_params.append(('includedDeleted', params['included_deleted']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/allTags', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Tag]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_blocking_state_audit_logs_with_history(self, blocking_id=None, **kwargs):  # noqa: E501
        """Retrieve blocking state audit logs with history by id  # noqa: E501

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

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

    def get_blocking_state_audit_logs_with_history_with_http_info(self, blocking_id=None, **kwargs):  # noqa: E501
        """Retrieve blocking state audit logs with history by id  # noqa: E501

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

        :param async bool
        :param Str blocking_id: (required)
        :return: List[AuditLog]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'blocking_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['blocking_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `blocking_id` when calling `get_blocking_state_audit_logs_with_history`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/block/{blockingId}/auditLogsWithHistory', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[AuditLog]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_blocking_states(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve blocking states for account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param List[Str] blocking_state_types:
        :param List[Str] blocking_state_svcs:
        :param Str audit:
        :return: List[BlockingState]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_blocking_states_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_blocking_states_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_blocking_states_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve blocking states for account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param List[Str] blocking_state_types:
        :param List[Str] blocking_state_svcs:
        :param Str audit:
        :return: List[BlockingState]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'blocking_state_types', 'blocking_state_svcs', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_blocking_states`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'blocking_state_types' in params:
            query_params.append(('blockingStateTypes', params['blocking_state_types']))  # noqa: E501
            collection_formats['blockingStateTypes'] = 'multi'  # noqa: E501
        if 'blocking_state_svcs' in params:
            query_params.append(('blockingStateSvcs', params['blocking_state_svcs']))  # noqa: E501
            collection_formats['blockingStateSvcs'] = 'multi'  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/block', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[BlockingState]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_children_accounts(self, account_id=None, **kwargs):  # noqa: E501
        """List children accounts  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: List[Account]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_children_accounts_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_children_accounts_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_children_accounts_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """List children accounts  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: List[Account]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'account_with_balance', 'account_with_balance_and_cba', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_children_accounts`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'account_with_balance' in params:
            query_params.append(('accountWithBalance', params['account_with_balance']))  # noqa: E501
        if 'account_with_balance_and_cba' in params:
            query_params.append(('accountWithBalanceAndCBA', params['account_with_balance_and_cba']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/children', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Account]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_emails(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve an account emails  # noqa: E501

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

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

    def get_emails_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve an account emails  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :return: List[AccountEmail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_emails`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/emails', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[AccountEmail]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_invoice_payments(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account invoice payments  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool with_plugin_info:
        :param Bool with_attempts:
        :param List[Str] plugin_property:
        :param Str audit:
        :return: List[InvoicePayment]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_invoice_payments_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_invoice_payments_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_invoice_payments_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account invoice payments  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool with_plugin_info:
        :param Bool with_attempts:
        :param List[Str] plugin_property:
        :param Str audit:
        :return: List[InvoicePayment]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'with_plugin_info', 'with_attempts', 'plugin_property', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_invoice_payments`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'with_plugin_info' in params:
            query_params.append(('withPluginInfo', params['with_plugin_info']))  # noqa: E501
        if 'with_attempts' in params:
            query_params.append(('withAttempts', params['with_attempts']))  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/invoicePayments', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[InvoicePayment]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_invoices_for_account(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account invoices  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Date start_date:
        :param Date end_date:
        :param Bool with_migration_invoices:
        :param Bool unpaid_invoices_only:
        :param Bool include_voided_invoices:
        :param Str invoices_filter:
        :param Str audit:
        :return: List[Invoice]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_invoices_for_account_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_invoices_for_account_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_invoices_for_account_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account invoices  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Date start_date:
        :param Date end_date:
        :param Bool with_migration_invoices:
        :param Bool unpaid_invoices_only:
        :param Bool include_voided_invoices:
        :param Str invoices_filter:
        :param Str audit:
        :return: List[Invoice]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'start_date', 'end_date', 'with_migration_invoices', 'unpaid_invoices_only', 'include_voided_invoices', 'invoices_filter', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_invoices_for_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'start_date' in params:
            query_params.append(('startDate', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            query_params.append(('endDate', params['end_date']))  # noqa: E501
        if 'with_migration_invoices' in params:
            query_params.append(('withMigrationInvoices', params['with_migration_invoices']))  # noqa: E501
        if 'unpaid_invoices_only' in params:
            query_params.append(('unpaidInvoicesOnly', params['unpaid_invoices_only']))  # noqa: E501
        if 'include_voided_invoices' in params:
            query_params.append(('includeVoidedInvoices', params['include_voided_invoices']))  # noqa: E501
        if 'invoices_filter' in params:
            query_params.append(('invoicesFilter', params['invoices_filter']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/invoices', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Invoice]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_overdue_account(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve overdue state for account  # noqa: E501

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

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

    def get_overdue_account_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve overdue state for account  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :return: OverdueState
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_overdue_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/overdue', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OverdueState',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_payment_methods_for_account(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account payment methods  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool with_plugin_info:
        :param Bool included_deleted:
        :param List[Str] plugin_property:
        :param Str audit:
        :return: List[PaymentMethod]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_payment_methods_for_account_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_payment_methods_for_account_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_payment_methods_for_account_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account payment methods  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool with_plugin_info:
        :param Bool included_deleted:
        :param List[Str] plugin_property:
        :param Str audit:
        :return: List[PaymentMethod]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'with_plugin_info', 'included_deleted', 'plugin_property', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_payment_methods_for_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'with_plugin_info' in params:
            query_params.append(('withPluginInfo', params['with_plugin_info']))  # noqa: E501
        if 'included_deleted' in params:
            query_params.append(('includedDeleted', params['included_deleted']))  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/paymentMethods', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[PaymentMethod]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_payments_for_account(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account payments  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool with_attempts:
        :param Bool with_plugin_info:
        :param List[Str] plugin_property:
        :param Str audit:
        :return: List[Payment]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_payments_for_account_with_http_info(account_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_payments_for_account_with_http_info(account_id, **kwargs)  # noqa: E501
            return data

    def get_payments_for_account_with_http_info(self, account_id=None, **kwargs):  # noqa: E501
        """Retrieve account payments  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Bool with_attempts:
        :param Bool with_plugin_info:
        :param List[Str] plugin_property:
        :param Str audit:
        :return: List[Payment]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'with_attempts', 'with_plugin_info', 'plugin_property', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `get_payments_for_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'with_attempts' in params:
            query_params.append(('withAttempts', params['with_attempts']))  # noqa: E501
        if 'with_plugin_info' in params:
            query_params.append(('withPluginInfo', params['with_plugin_info']))  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/payments', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Payment]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def modify_account_custom_fields(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Modify custom fields to account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.modify_account_custom_fields(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param List[CustomField] body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.modify_account_custom_fields_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.modify_account_custom_fields_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def modify_account_custom_fields_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Modify custom fields to account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.modify_account_custom_fields_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param List[CustomField] body: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `modify_account_custom_fields`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/customFields', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def pay_all_invoices(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Trigger a payment for all unpaid invoices  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Str payment_method_id:
        :param Bool external_payment:
        :param Float payment_amount:
        :param Date target_date:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: List[Invoice]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.pay_all_invoices_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.pay_all_invoices_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
            return data

    def pay_all_invoices_with_http_info(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Trigger a payment for all unpaid invoices  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Str payment_method_id:
        :param Bool external_payment:
        :param Float payment_amount:
        :param Date target_date:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: List[Invoice]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'created_by', 'payment_method_id', 'external_payment', 'payment_amount', 'target_date', 'plugin_property', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `pay_all_invoices`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'payment_method_id' in params:
            query_params.append(('paymentMethodId', params['payment_method_id']))  # noqa: E501
        if 'external_payment' in params:
            query_params.append(('externalPayment', params['external_payment']))  # noqa: E501
        if 'payment_amount' in params:
            query_params.append(('paymentAmount', params['payment_amount']))  # noqa: E501
        if 'target_date' in params:
            query_params.append(('targetDate', params['target_date']))  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/invoicePayments', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Invoice]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def process_payment(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Trigger a payment (authorization, purchase or credit)  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.process_payment(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param PaymentTransaction body: (required)
        :param Str created_by: (required)
        :param Str payment_method_id:
        :param List[Str] control_plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: Payment
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.process_payment_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.process_payment_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def process_payment_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Trigger a payment (authorization, purchase or credit)  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.process_payment_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param PaymentTransaction body: (required)
        :param Str created_by: (required)
        :param Str payment_method_id:
        :param List[Str] control_plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: Payment
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'payment_method_id', 'control_plugin_name', 'plugin_property', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `process_payment`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'payment_method_id' in params:
            query_params.append(('paymentMethodId', params['payment_method_id']))  # noqa: E501
        if 'control_plugin_name' in params:
            query_params.append(('controlPluginName', params['control_plugin_name']))  # noqa: E501
            collection_formats['controlPluginName'] = 'multi'  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/payments', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Payment',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def process_payment_by_external_key(self, body=None, external_key=None, created_by=None, **kwargs):  # noqa: E501
        """Trigger a payment using the account external key (authorization, purchase or credit)  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.process_payment_by_external_key(body, external_key, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param PaymentTransaction body: (required)
        :param Str external_key: (required)
        :param Str created_by: (required)
        :param Str payment_method_id:
        :param List[Str] control_plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: Payment
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.process_payment_by_external_key_with_http_info(body, external_key, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.process_payment_by_external_key_with_http_info(body, external_key, created_by, **kwargs)  # noqa: E501
            return data

    def process_payment_by_external_key_with_http_info(self, body=None, external_key=None, created_by=None, **kwargs):  # noqa: E501
        """Trigger a payment using the account external key (authorization, purchase or credit)  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.process_payment_by_external_key_with_http_info(body, external_key, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param PaymentTransaction body: (required)
        :param Str external_key: (required)
        :param Str created_by: (required)
        :param Str payment_method_id:
        :param List[Str] control_plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: Payment
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'external_key', 'created_by', 'payment_method_id', 'control_plugin_name', 'plugin_property', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'external_key' in params:
            query_params.append(('externalKey', params['external_key']))  # noqa: E501
        if 'payment_method_id' in params:
            query_params.append(('paymentMethodId', params['payment_method_id']))  # noqa: E501
        if 'control_plugin_name' in params:
            query_params.append(('controlPluginName', params['control_plugin_name']))  # noqa: E501
            collection_formats['controlPluginName'] = 'multi'  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/payments', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Payment',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def rebalance_existing_cba_on_account(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Rebalance account CBA  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.rebalance_existing_cba_on_account_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.rebalance_existing_cba_on_account_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
            return data

    def rebalance_existing_cba_on_account_with_http_info(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Rebalance account CBA  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'created_by', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `rebalance_existing_cba_on_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/cbaRebalancing', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def refresh_payment_methods(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Refresh account payment methods  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Str plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.refresh_payment_methods_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.refresh_payment_methods_with_http_info(account_id, created_by, **kwargs)  # noqa: E501
            return data

    def refresh_payment_methods_with_http_info(self, account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Refresh account payment methods  # noqa: E501

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

        :param async bool
        :param Str account_id: (required)
        :param Str created_by: (required)
        :param Str plugin_name:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'created_by', 'plugin_name', 'plugin_property', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `refresh_payment_methods`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'plugin_name' in params:
            query_params.append(('pluginName', params['plugin_name']))  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/paymentMethods/refresh', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def remove_email(self, account_id=None, email=None, created_by=None, **kwargs):  # noqa: E501
        """Delete email from account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.remove_email(account_id, email, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param Str email: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.remove_email_with_http_info(account_id, email, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.remove_email_with_http_info(account_id, email, created_by, **kwargs)  # noqa: E501
            return data

    def remove_email_with_http_info(self, account_id=None, email=None, created_by=None, **kwargs):  # noqa: E501
        """Delete email from account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.remove_email_with_http_info(account_id, email, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param Str email: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'email', 'created_by', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `remove_email`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

        path_params = {}
        if 'account_id' in params:
            path_params['accountId'] = params['account_id']  # noqa: E501
        if 'email' in params:
            path_params['email'] = params['email']  # noqa: E501

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/emails/{email}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def search_accounts(self, search_key=None, **kwargs):  # noqa: E501
        """Search accounts  # noqa: E501

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

        :param async bool
        :param Str search_key: (required)
        :param Int offset:
        :param Int limit:
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: List[Account]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.search_accounts_with_http_info(search_key, **kwargs)  # noqa: E501
        else:
            (data) = self.search_accounts_with_http_info(search_key, **kwargs)  # noqa: E501
            return data

    def search_accounts_with_http_info(self, search_key=None, **kwargs):  # noqa: E501
        """Search accounts  # noqa: E501

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

        :param async bool
        :param Str search_key: (required)
        :param Int offset:
        :param Int limit:
        :param Bool account_with_balance:
        :param Bool account_with_balance_and_cba:
        :param Str audit:
        :return: List[Account]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['search_key', 'offset', 'limit', 'account_with_balance', 'account_with_balance_and_cba', 'audit']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'search_key' in params and not re.search('.*', params['search_key']):  # noqa: E501
            raise ValueError("Invalid value for parameter `search_key` when calling `search_accounts`, must conform to the pattern `/.*/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'account_with_balance' in params:
            query_params.append(('accountWithBalance', params['account_with_balance']))  # noqa: E501
        if 'account_with_balance_and_cba' in params:
            query_params.append(('accountWithBalanceAndCBA', params['account_with_balance_and_cba']))  # noqa: E501
        if 'audit' in params:
            query_params.append(('audit', params['audit']))  # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/search/{searchKey}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='List[Account]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def set_default_payment_method(self, account_id=None, payment_method_id=None, created_by=None, **kwargs):  # noqa: E501
        """Set the default payment method  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_default_payment_method(account_id, payment_method_id, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param Str payment_method_id: (required)
        :param Str created_by: (required)
        :param Bool pay_all_unpaid_invoices:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.set_default_payment_method_with_http_info(account_id, payment_method_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.set_default_payment_method_with_http_info(account_id, payment_method_id, created_by, **kwargs)  # noqa: E501
            return data

    def set_default_payment_method_with_http_info(self, account_id=None, payment_method_id=None, created_by=None, **kwargs):  # noqa: E501
        """Set the default payment method  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_default_payment_method_with_http_info(account_id, payment_method_id, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param Str payment_method_id: (required)
        :param Str created_by: (required)
        :param Bool pay_all_unpaid_invoices:
        :param List[Str] plugin_property:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'payment_method_id', 'created_by', 'pay_all_unpaid_invoices', 'plugin_property', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `set_default_payment_method`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        if 'payment_method_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['payment_method_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `payment_method_id` when calling `set_default_payment_method`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

        path_params = {}
        if 'account_id' in params:
            path_params['accountId'] = params['account_id']  # noqa: E501
        if 'payment_method_id' in params:
            path_params['paymentMethodId'] = params['payment_method_id']  # noqa: E501

        query_params = []
        if 'pay_all_unpaid_invoices' in params:
            query_params.append(('payAllUnpaidInvoices', params['pay_all_unpaid_invoices']))  # noqa: E501
        if 'plugin_property' in params:
            query_params.append(('pluginProperty', params['plugin_property']))  # noqa: E501
            collection_formats['pluginProperty'] = 'multi'  # noqa: E501

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}/paymentMethods/{paymentMethodId}/setDefault', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def transfer_child_credit_to_parent(self, child_account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Move a given child credit to the parent level  # noqa: E501

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

        :param async bool
        :param Str child_account_id: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.transfer_child_credit_to_parent_with_http_info(child_account_id, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.transfer_child_credit_to_parent_with_http_info(child_account_id, created_by, **kwargs)  # noqa: E501
            return data

    def transfer_child_credit_to_parent_with_http_info(self, child_account_id=None, created_by=None, **kwargs):  # noqa: E501
        """Move a given child credit to the parent level  # noqa: E501

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

        :param async bool
        :param Str child_account_id: (required)
        :param Str created_by: (required)
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['child_account_id', 'created_by', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'child_account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['child_account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `child_account_id` when calling `transfer_child_credit_to_parent`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # 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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{childAccountId}/transferCredit', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_account(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Update account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_account(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param Account body: (required)
        :param Str created_by: (required)
        :param Bool treat_null_as_reset:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.update_account_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
        else:
            (data) = self.update_account_with_http_info(account_id, body, created_by, **kwargs)  # noqa: E501
            return data

    def update_account_with_http_info(self, account_id=None, body=None, created_by=None, **kwargs):  # noqa: E501
        """Update account  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_account_with_http_info(account_id, body, created_by, async=True)
        >>> result = thread.get()

        :param async bool
        :param Str account_id: (required)
        :param Account body: (required)
        :param Str created_by: (required)
        :param Bool treat_null_as_reset:
        :param Str reason:
        :param Str comment:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account_id', 'body', 'created_by', 'treat_null_as_reset', 'reason', 'comment']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        if 'account_id' in params and not re.search('\\w+-\\w+-\\w+-\\w+-\\w+', params['account_id']):  # noqa: E501
            raise ValueError("Invalid value for parameter `account_id` when calling `update_account`, must conform to the pattern `/\\w+-\\w+-\\w+-\\w+-\\w+/`")  # noqa: E501
        collection_formats = {}

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

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

        header_params = {}
        if 'created_by' in params:
            header_params['X-Killbill-CreatedBy'] = params['created_by']  # noqa: E501
        if 'reason' in params:
            header_params['X-Killbill-Reason'] = params['reason']  # noqa: E501
        if 'comment' in params:
            header_params['X-Killbill-Comment'] = params['comment']  # noqa: E501

        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 = ['Killbill Api Key', 'Killbill Api Secret', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/1.0/kb/accounts/{accountId}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
