# coding: utf-8

"""
    Lotus API

    Lotus is an open-core pricing and billing engine. We enable API companies to automate and optimize their custom usage-based pricing for any metric.  # noqa: E501

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


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

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_actions_list(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str c: The pagination cursor value.
        :param int page_size: Number of results to return per page.
        :return: PaginatedActionList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_actions_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.app_actions_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def app_actions_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_actions_list  # noqa: E501

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_actions_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str c: The pagination cursor value.
        :param int page_size: Number of results to return per page.
        :return: PaginatedActionList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['c', 'page_size']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

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

        return self.api_client.call_api(
            '/app/actions/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PaginatedActionList',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addon_versions_create(self, body, **kwargs):  # noqa: E501
        """app_addon_versions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addon_versions_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_addon_versions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_addon_versions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addon_versions_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddOnVersionCreateRequest body: (required)
        :return: AddOnVersionDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'addon_id' in params:
            form_params.append(('addon_id', params['addon_id']))  # noqa: E501
        if 'recurring_charges' in params:
            form_params.append(('recurring_charges', params['recurring_charges']))  # noqa: E501
            collection_formats['recurring_charges'] = 'multi'  # noqa: E501
        if 'components' in params:
            form_params.append(('components', params['components']))  # noqa: E501
            collection_formats['components'] = 'multi'  # noqa: E501
        if 'features' in params:
            form_params.append(('features', params['features']))  # noqa: E501
            collection_formats['features'] = 'multi'  # noqa: E501
        if 'currency_code' in params:
            form_params.append(('currency_code', params['currency_code']))  # noqa: E501
        if 'invoice_when' in params:
            form_params.append(('invoice_when', params['invoice_when']))  # noqa: E501
        if 'billing_frequency' in params:
            form_params.append(('billing_frequency', params['billing_frequency']))  # noqa: E501
        if 'addon_id' in params:
            form_params.append(('addon_id', params['addon_id']))  # noqa: E501
        if 'recurring_charges' in params:
            form_params.append(('recurring_charges', params['recurring_charges']))  # noqa: E501
            collection_formats['recurring_charges'] = 'multi'  # noqa: E501
        if 'components' in params:
            form_params.append(('components', params['components']))  # noqa: E501
            collection_formats['components'] = 'multi'  # noqa: E501
        if 'features' in params:
            form_params.append(('features', params['features']))  # noqa: E501
            collection_formats['features'] = 'multi'  # noqa: E501
        if 'currency_code' in params:
            form_params.append(('currency_code', params['currency_code']))  # noqa: E501
        if 'invoice_when' in params:
            form_params.append(('invoice_when', params['invoice_when']))  # noqa: E501
        if 'billing_frequency' in params:
            form_params.append(('billing_frequency', params['billing_frequency']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addon_versions/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddOnVersionDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addon_versions_delete_create(self, version_id, **kwargs):  # noqa: E501
        """app_addon_versions_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addon_versions_delete_create(version_id, async_req=True)
        >>> result = thread.get()

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

    def app_addon_versions_delete_create_with_http_info(self, version_id, **kwargs):  # noqa: E501
        """app_addon_versions_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addon_versions_delete_create_with_http_info(version_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'version_id' in params:
            path_params['version_id'] = params['version_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addon_versions/{version_id}/delete/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeleteAddOnVersion',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addon_versions_partial_update(self, version_id, **kwargs):  # noqa: E501
        """app_addon_versions_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addon_versions_partial_update(version_id, async_req=True)
        >>> result = thread.get()

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

    def app_addon_versions_partial_update_with_http_info(self, version_id, **kwargs):  # noqa: E501
        """app_addon_versions_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addon_versions_partial_update_with_http_info(version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version_id: (required)
        :param PatchedAddOnVersionUpdateRequest body:
        :return: AddOnVersionUpdate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'addon_version_name' in params:
            form_params.append(('addon_version_name', params['addon_version_name']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501
        if 'addon_version_name' in params:
            form_params.append(('addon_version_name', params['addon_version_name']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addon_versions/{version_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddOnVersionUpdate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addons_create(self, body, **kwargs):  # noqa: E501
        """app_addons_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_addons_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_addons_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddOnCreateRequest body: (required)
        :return: AddOnDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'addon_name' in params:
            form_params.append(('addon_name', params['addon_name']))  # noqa: E501
        if 'addon_description' in params:
            form_params.append(('addon_description', params['addon_description']))  # noqa: E501
        if 'initial_version' in params:
            form_params.append(('initial_version', params['initial_version']))  # noqa: E501
        if 'addon_name' in params:
            form_params.append(('addon_name', params['addon_name']))  # noqa: E501
        if 'addon_description' in params:
            form_params.append(('addon_description', params['addon_description']))  # noqa: E501
        if 'initial_version' in params:
            form_params.append(('initial_version', params['initial_version']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addons/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddOnDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addons_delete_create(self, addon_id, **kwargs):  # noqa: E501
        """app_addons_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_delete_create(addon_id, async_req=True)
        >>> result = thread.get()

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

    def app_addons_delete_create_with_http_info(self, addon_id, **kwargs):  # noqa: E501
        """app_addons_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_delete_create_with_http_info(addon_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'addon_id' in params:
            path_params['addon_id'] = params['addon_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addons/{addon_id}/delete/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeleteAddOn',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addons_features_add_create(self, body, addon_id, **kwargs):  # noqa: E501
        """app_addons_features_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_features_add_create(body, addon_id, async_req=True)
        >>> result = thread.get()

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

    def app_addons_features_add_create_with_http_info(self, body, addon_id, **kwargs):  # noqa: E501
        """app_addons_features_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_features_add_create_with_http_info(body, addon_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddFeatureToAddOnRequest body: (required)
        :param str addon_id: (required)
        :return: AddFeatureToAddOnResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_addons_features_add_create" % 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 `app_addons_features_add_create`")  # noqa: E501
        # verify the required parameter 'addon_id' is set
        if ('addon_id' not in params or
                params['addon_id'] is None):
            raise ValueError(
                "Missing the required parameter `addon_id` when calling `app_addons_features_add_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addons/{addon_id}/features/add/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddFeatureToAddOnResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_list(async_req=True)
        >>> result = thread.get()

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

    def app_addons_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_addons_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[AddOnDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addons/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[AddOnDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addons_partial_update(self, addon_id, **kwargs):  # noqa: E501
        """app_addons_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_partial_update(addon_id, async_req=True)
        >>> result = thread.get()

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

    def app_addons_partial_update_with_http_info(self, addon_id, **kwargs):  # noqa: E501
        """app_addons_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_partial_update_with_http_info(addon_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str addon_id: (required)
        :param PatchedAddOnUpdateRequest body:
        :return: AddOnUpdate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'addon_name' in params:
            form_params.append(('addon_name', params['addon_name']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501
        if 'addon_name' in params:
            form_params.append(('addon_name', params['addon_name']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addons/{addon_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddOnUpdate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_addons_retrieve(self, addon_id, **kwargs):  # noqa: E501
        """app_addons_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_retrieve(addon_id, async_req=True)
        >>> result = thread.get()

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

    def app_addons_retrieve_with_http_info(self, addon_id, **kwargs):  # noqa: E501
        """app_addons_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_addons_retrieve_with_http_info(addon_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'addon_id' in params:
            path_params['addon_id'] = params['addon_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/addons/{addon_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddOnDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_analysis_create(self, body, **kwargs):  # noqa: E501
        """app_analysis_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_analysis_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_analysis_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_analysis_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_analysis_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param BacktestCreateRequest body: (required)
        :return: BacktestCreate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'substitutions' in params:
            form_params.append(('substitutions', params['substitutions']))  # noqa: E501
            collection_formats['substitutions'] = 'multi'  # noqa: E501
        if 'kpis' in params:
            form_params.append(('kpis', params['kpis']))  # noqa: E501
            collection_formats['kpis'] = 'multi'  # noqa: E501
        if 'backtest_name' in params:
            form_params.append(('backtest_name', params['backtest_name']))  # noqa: E501
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'substitutions' in params:
            form_params.append(('substitutions', params['substitutions']))  # noqa: E501
            collection_formats['substitutions'] = 'multi'  # noqa: E501
        if 'kpis' in params:
            form_params.append(('kpis', params['kpis']))  # noqa: E501
            collection_formats['kpis'] = 'multi'  # noqa: E501
        if 'backtest_name' in params:
            form_params.append(('backtest_name', params['backtest_name']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/analysis/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BacktestCreate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_analysis_list(async_req=True)
        >>> result = thread.get()

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

    def app_analysis_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_analysis_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_analysis_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[AnalysisSummary]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/analysis/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[AnalysisSummary]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_analysis_retrieve(self, analysis_id, **kwargs):  # noqa: E501
        """app_analysis_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_analysis_retrieve(analysis_id, async_req=True)
        >>> result = thread.get()

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

    def app_analysis_retrieve_with_http_info(self, analysis_id, **kwargs):  # noqa: E501
        """app_analysis_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_analysis_retrieve_with_http_info(analysis_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'analysis_id' in params:
            path_params['analysis_id'] = params['analysis_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/analysis/{analysis_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AnalysisDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_create(async_req=True)
        >>> result = thread.get()

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

    def app_api_tokens_create_with_http_info(self, **kwargs):  # noqa: E501
        """app_api_tokens_create  # noqa: E501

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_create_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'name' in params:
            form_params.append(('name', params['name']))  # noqa: E501
        if 'expiry_date' in params:
            form_params.append(('expiry_date', params['expiry_date']))  # noqa: E501
        if 'name' in params:
            form_params.append(('name', params['name']))  # noqa: E501
        if 'expiry_date' in params:
            form_params.append(('expiry_date', params['expiry_date']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/api_tokens/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='APITokenCreateResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_api_tokens_destroy(self, prefix, **kwargs):  # noqa: E501
        """app_api_tokens_destroy  # noqa: E501

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_destroy(prefix, async_req=True)
        >>> result = thread.get()

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

    def app_api_tokens_destroy_with_http_info(self, prefix, **kwargs):  # noqa: E501
        """app_api_tokens_destroy  # noqa: E501

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_destroy_with_http_info(prefix, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/api_tokens/{prefix}/', '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_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_list(async_req=True)
        >>> result = thread.get()

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

    def app_api_tokens_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_api_tokens_list  # noqa: E501

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[APIToken]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/api_tokens/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[APIToken]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_api_tokens_roll_create(self, prefix, **kwargs):  # noqa: E501
        """app_api_tokens_roll_create  # noqa: E501

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_roll_create(prefix, async_req=True)
        >>> result = thread.get()

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

    def app_api_tokens_roll_create_with_http_info(self, prefix, **kwargs):  # noqa: E501
        """app_api_tokens_roll_create  # noqa: E501

        API endpoint that allows API Tokens to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_api_tokens_roll_create_with_http_info(prefix, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'prefix' in params:
            path_params['prefix'] = params['prefix']  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/api_tokens/{prefix}/roll/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='APITokenRollResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_backtests_create(self, body, **kwargs):  # noqa: E501
        """app_backtests_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_backtests_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_backtests_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_backtests_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_backtests_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param BacktestCreateRequest body: (required)
        :return: BacktestCreate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'substitutions' in params:
            form_params.append(('substitutions', params['substitutions']))  # noqa: E501
            collection_formats['substitutions'] = 'multi'  # noqa: E501
        if 'kpis' in params:
            form_params.append(('kpis', params['kpis']))  # noqa: E501
            collection_formats['kpis'] = 'multi'  # noqa: E501
        if 'backtest_name' in params:
            form_params.append(('backtest_name', params['backtest_name']))  # noqa: E501
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'substitutions' in params:
            form_params.append(('substitutions', params['substitutions']))  # noqa: E501
            collection_formats['substitutions'] = 'multi'  # noqa: E501
        if 'kpis' in params:
            form_params.append(('kpis', params['kpis']))  # noqa: E501
            collection_formats['kpis'] = 'multi'  # noqa: E501
        if 'backtest_name' in params:
            form_params.append(('backtest_name', params['backtest_name']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/backtests/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BacktestCreate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_backtests_list(async_req=True)
        >>> result = thread.get()

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

    def app_backtests_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_backtests_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_backtests_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[BacktestSummary]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/backtests/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[BacktestSummary]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_backtests_retrieve(self, backtest_id, **kwargs):  # noqa: E501
        """app_backtests_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_backtests_retrieve(backtest_id, async_req=True)
        >>> result = thread.get()

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

    def app_backtests_retrieve_with_http_info(self, backtest_id, **kwargs):  # noqa: E501
        """app_backtests_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_backtests_retrieve_with_http_info(backtest_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'backtest_id' in params:
            path_params['backtest_id'] = params['backtest_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/backtests/{backtest_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BacktestDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_credits_create(self, body, **kwargs):  # noqa: E501
        """app_credits_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_credits_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_credits_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CustomerBalanceAdjustmentCreateRequest body: (required)
        :return: CustomerBalanceAdjustment
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'amount' in params:
            form_params.append(('amount', params['amount']))  # noqa: E501
        if 'currency_code' in params:
            form_params.append(('currency_code', params['currency_code']))  # noqa: E501
        if 'description' in params:
            form_params.append(('description', params['description']))  # noqa: E501
        if 'effective_at' in params:
            form_params.append(('effective_at', params['effective_at']))  # noqa: E501
        if 'expires_at' in params:
            form_params.append(('expires_at', params['expires_at']))  # noqa: E501
        if 'amount_paid' in params:
            form_params.append(('amount_paid', params['amount_paid']))  # noqa: E501
        if 'amount_paid_currency_code' in params:
            form_params.append(('amount_paid_currency_code', params['amount_paid_currency_code']))  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'amount' in params:
            form_params.append(('amount', params['amount']))  # noqa: E501
        if 'currency_code' in params:
            form_params.append(('currency_code', params['currency_code']))  # noqa: E501
        if 'description' in params:
            form_params.append(('description', params['description']))  # noqa: E501
        if 'effective_at' in params:
            form_params.append(('effective_at', params['effective_at']))  # noqa: E501
        if 'expires_at' in params:
            form_params.append(('expires_at', params['expires_at']))  # noqa: E501
        if 'amount_paid' in params:
            form_params.append(('amount_paid', params['amount_paid']))  # noqa: E501
        if 'amount_paid_currency_code' in params:
            form_params.append(('amount_paid_currency_code', params['amount_paid_currency_code']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/credits/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerBalanceAdjustment',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_credits_list(self, customer_id, **kwargs):  # noqa: E501
        """app_credits_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_list(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The id provided when creating the customer, we suggest matching with your internal customer id in your backend (required)
        :param str currency_code: Filter to adjustments in a specific currency
        :param datetime effective_after: Filter to adjustments that are effective after this date
        :param datetime effective_before: Filter to adjustments that are effective before this date
        :param datetime expires_after: Filter to adjustments that expire after this date
        :param datetime expires_before: Filter to adjustments that expire before this date
        :param datetime issued_after: Filter to adjustments that were issued after this date
        :param datetime issued_before: Filter to adjustments that were issued before this date
        :param list[str] status: Filter to a specific set of adjustment statuses. Defaults to both active and inactive.
        :return: list[CustomerBalanceAdjustment]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_credits_list_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_credits_list_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def app_credits_list_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """app_credits_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_list_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The id provided when creating the customer, we suggest matching with your internal customer id in your backend (required)
        :param str currency_code: Filter to adjustments in a specific currency
        :param datetime effective_after: Filter to adjustments that are effective after this date
        :param datetime effective_before: Filter to adjustments that are effective before this date
        :param datetime expires_after: Filter to adjustments that expire after this date
        :param datetime expires_before: Filter to adjustments that expire before this date
        :param datetime issued_after: Filter to adjustments that were issued after this date
        :param datetime issued_before: Filter to adjustments that were issued before this date
        :param list[str] status: Filter to a specific set of adjustment statuses. Defaults to both active and inactive.
        :return: list[CustomerBalanceAdjustment]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'currency_code', 'effective_after', 'effective_before', 'expires_after',
                      'expires_before', 'issued_after', 'issued_before', 'status']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'currency_code' in params:
            query_params.append(('currency_code', params['currency_code']))  # noqa: E501
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'effective_after' in params:
            query_params.append(('effective_after', params['effective_after']))  # noqa: E501
        if 'effective_before' in params:
            query_params.append(('effective_before', params['effective_before']))  # noqa: E501
        if 'expires_after' in params:
            query_params.append(('expires_after', params['expires_after']))  # noqa: E501
        if 'expires_before' in params:
            query_params.append(('expires_before', params['expires_before']))  # noqa: E501
        if 'issued_after' in params:
            query_params.append(('issued_after', params['issued_after']))  # noqa: E501
        if 'issued_before' in params:
            query_params.append(('issued_before', params['issued_before']))  # noqa: E501
        if 'status' in params:
            query_params.append(('status', params['status']))  # noqa: E501
            collection_formats['status'] = 'multi'  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/credits/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[CustomerBalanceAdjustment]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_credits_retrieve(self, credit_id, **kwargs):  # noqa: E501
        """app_credits_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_retrieve(credit_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str credit_id: The ID of the credit to retrieve or update. (required)
        :return: CustomerBalanceAdjustment
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_credits_retrieve_with_http_info(credit_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_credits_retrieve_with_http_info(credit_id, **kwargs)  # noqa: E501
            return data

    def app_credits_retrieve_with_http_info(self, credit_id, **kwargs):  # noqa: E501
        """app_credits_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_retrieve_with_http_info(credit_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str credit_id: The ID of the credit to retrieve or update. (required)
        :return: CustomerBalanceAdjustment
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'credit_id' in params:
            path_params['credit_id'] = params['credit_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/credits/{credit_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerBalanceAdjustment',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_credits_update_create(self, credit_id, **kwargs):  # noqa: E501
        """app_credits_update_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_update_create(credit_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str credit_id: The ID of the credit to retrieve or update. (required)
        :param CustomerBalanceAdjustmentUpdateRequest body:
        :return: CustomerBalanceAdjustment
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_credits_update_create_with_http_info(credit_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_credits_update_create_with_http_info(credit_id, **kwargs)  # noqa: E501
            return data

    def app_credits_update_create_with_http_info(self, credit_id, **kwargs):  # noqa: E501
        """app_credits_update_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_update_create_with_http_info(credit_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str credit_id: The ID of the credit to retrieve or update. (required)
        :param CustomerBalanceAdjustmentUpdateRequest body:
        :return: CustomerBalanceAdjustment
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'description' in params:
            form_params.append(('description', params['description']))  # noqa: E501
        if 'expires_at' in params:
            form_params.append(('expires_at', params['expires_at']))  # noqa: E501
        if 'description' in params:
            form_params.append(('description', params['description']))  # noqa: E501
        if 'expires_at' in params:
            form_params.append(('expires_at', params['expires_at']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/credits/{credit_id}/update/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerBalanceAdjustment',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_credits_void_create(self, credit_id, **kwargs):  # noqa: E501
        """app_credits_void_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_void_create(credit_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str credit_id: The ID of the credit to retrieve or update. (required)
        :return: CustomerBalanceAdjustment
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_credits_void_create_with_http_info(credit_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_credits_void_create_with_http_info(credit_id, **kwargs)  # noqa: E501
            return data

    def app_credits_void_create_with_http_info(self, credit_id, **kwargs):  # noqa: E501
        """app_credits_void_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_credits_void_create_with_http_info(credit_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str credit_id: The ID of the credit to retrieve or update. (required)
        :return: CustomerBalanceAdjustment
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'credit_id' in params:
            path_params['credit_id'] = params['credit_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/credits/{credit_id}/void/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerBalanceAdjustment',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_link_token_create(async_req=True)
        >>> result = thread.get()

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

    def app_crm_link_token_create_with_http_info(self, **kwargs):  # noqa: E501
        """app_crm_link_token_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_link_token_create_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/crm/link_token/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LinkTokenResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_list(async_req=True)
        >>> result = thread.get()

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

    def app_crm_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_crm_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[SingleCRMProvider]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/crm/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[SingleCRMProvider]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_crm_set_customer_source_create(self, body, **kwargs):  # noqa: E501
        """app_crm_set_customer_source_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_set_customer_source_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_crm_set_customer_source_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_crm_set_customer_source_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_set_customer_source_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UpdateCRMSourceOfTruthRequest body: (required)
        :return: SuccessResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'crm_provider_name' in params:
            form_params.append(('crm_provider_name', params['crm_provider_name']))  # noqa: E501
        if 'lotus_is_source' in params:
            form_params.append(('lotus_is_source', params['lotus_is_source']))  # noqa: E501
        if 'crm_provider_name' in params:
            form_params.append(('crm_provider_name', params['crm_provider_name']))  # noqa: E501
        if 'lotus_is_source' in params:
            form_params.append(('lotus_is_source', params['lotus_is_source']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/crm/set_customer_source/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SuccessResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_crm_store_token_create(self, body, **kwargs):  # noqa: E501
        """app_crm_store_token_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_store_token_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_crm_store_token_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_crm_store_token_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_crm_store_token_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param StoreTokenRequestRequest body: (required)
        :return: StoreTokenResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'public_token' in params:
            form_params.append(('publicToken', params['public_token']))  # noqa: E501
        if 'public_token' in params:
            form_params.append(('publicToken', params['public_token']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/crm/store_token/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StoreTokenResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_customers_cost_analysis_retrieve(self, customer_id, end_date, start_date, **kwargs):  # noqa: E501
        """app_customers_cost_analysis_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_cost_analysis_retrieve(customer_id, end_date, start_date, async_req=True)
        >>> result = thread.get()

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

    def app_customers_cost_analysis_retrieve_with_http_info(self, customer_id, end_date, start_date,
                                                            **kwargs):  # noqa: E501
        """app_customers_cost_analysis_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_cost_analysis_retrieve_with_http_info(customer_id, end_date, start_date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: (required)
        :param date end_date: (required)
        :param date start_date: (required)
        :return: CostAnalysis
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'end_date', 'start_date']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

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

        return self.api_client.call_api(
            '/app/customers/{customer_id}/cost_analysis/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CostAnalysis',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_customers_create(self, body, **kwargs):  # noqa: E501
        """app_customers_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_customers_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_customers_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CustomerCreateRequest body: (required)
        :return: Customer
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'customer_name' in params:
            form_params.append(('customer_name', params['customer_name']))  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501
        if 'payment_provider' in params:
            form_params.append(('payment_provider', params['payment_provider']))  # noqa: E501
        if 'payment_provider_id' in params:
            form_params.append(('payment_provider_id', params['payment_provider_id']))  # noqa: E501
        if 'properties' in params:
            form_params.append(('properties', params['properties']))  # noqa: E501
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'address' in params:
            form_params.append(('address', params['address']))  # noqa: E501
        if 'billing_address' in params:
            form_params.append(('billing_address', params['billing_address']))  # noqa: E501
        if 'shipping_address' in params:
            form_params.append(('shipping_address', params['shipping_address']))  # noqa: E501
        if 'tax_rate' in params:
            form_params.append(('tax_rate', params['tax_rate']))  # noqa: E501
        if 'customer_name' in params:
            form_params.append(('customer_name', params['customer_name']))  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501
        if 'payment_provider' in params:
            form_params.append(('payment_provider', params['payment_provider']))  # noqa: E501
        if 'payment_provider_id' in params:
            form_params.append(('payment_provider_id', params['payment_provider_id']))  # noqa: E501
        if 'properties' in params:
            form_params.append(('properties', params['properties']))  # noqa: E501
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'address' in params:
            form_params.append(('address', params['address']))  # noqa: E501
        if 'billing_address' in params:
            form_params.append(('billing_address', params['billing_address']))  # noqa: E501
        if 'shipping_address' in params:
            form_params.append(('shipping_address', params['shipping_address']))  # noqa: E501
        if 'tax_rate' in params:
            form_params.append(('tax_rate', params['tax_rate']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Customer',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_customers_delete_create(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_delete_create(customer_id, async_req=True)
        >>> result = thread.get()

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

    def app_customers_delete_create_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_delete_create_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'customer_id' in params:
            path_params['customer_id'] = params['customer_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/{customer_id}/delete/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerDeleteResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_customers_draft_invoice_retrieve(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_draft_invoice_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_draft_invoice_retrieve(customer_id, async_req=True)
        >>> result = thread.get()

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

    def app_customers_draft_invoice_retrieve_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_draft_invoice_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_draft_invoice_retrieve_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

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

        all_params = ['customer_id', 'include_next_period']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/{customer_id}/draft_invoice/', 'GET',
            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_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_list(async_req=True)
        >>> result = thread.get()

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

    def app_customers_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_customers_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[CustomerDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[CustomerDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_customers_partial_update(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_partial_update(customer_id, async_req=True)
        >>> result = thread.get()

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

    def app_customers_partial_update_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_partial_update_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: (required)
        :param PatchedCustomerUpdateRequest body:
        :return: CustomerUpdate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'billing_address' in params:
            form_params.append(('billing_address', params['billing_address']))  # noqa: E501
        if 'shipping_address' in params:
            form_params.append(('shipping_address', params['shipping_address']))  # noqa: E501
        if 'tax_rate' in params:
            form_params.append(('tax_rate', params['tax_rate']))  # noqa: E501
        if 'timezone' in params:
            form_params.append(('timezone', params['timezone']))  # noqa: E501
        if 'customer_name' in params:
            form_params.append(('customer_name', params['customer_name']))  # noqa: E501
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'billing_address' in params:
            form_params.append(('billing_address', params['billing_address']))  # noqa: E501
        if 'shipping_address' in params:
            form_params.append(('shipping_address', params['shipping_address']))  # noqa: E501
        if 'tax_rate' in params:
            form_params.append(('tax_rate', params['tax_rate']))  # noqa: E501
        if 'timezone' in params:
            form_params.append(('timezone', params['timezone']))  # noqa: E501
        if 'customer_name' in params:
            form_params.append(('customer_name', params['customer_name']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/{customer_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerUpdate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_customers_retrieve(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_retrieve(customer_id, async_req=True)
        >>> result = thread.get()

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

    def app_customers_retrieve_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """app_customers_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_customers_retrieve_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'customer_id' in params:
            path_params['customer_id'] = params['customer_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/{customer_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

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

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

    def app_customers_summary_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_customers_summary_retrieve  # noqa: E501

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

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/summary/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerSummary',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

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

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

    def app_customers_totals_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_customers_totals_retrieve  # noqa: E501

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

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/customers/totals/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomerWithRevenue',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_demo_login_create(self, body, **kwargs):  # noqa: E501
        """app_demo_login_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_demo_login_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_demo_login_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_demo_login_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_demo_login_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DemoLoginRequestRequest body: (required)
        :return: DemoLoginSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'username' in params:
            form_params.append(('username', params['username']))  # noqa: E501
        if 'password' in params:
            form_params.append(('password', params['password']))  # noqa: E501
        if 'username' in params:
            form_params.append(('username', params['username']))  # noqa: E501
        if 'password' in params:
            form_params.append(('password', params['password']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/demo_login/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DemoLoginSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_demo_register_create(self, body, **kwargs):  # noqa: E501
        """app_demo_register_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_demo_register_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_demo_register_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_demo_register_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_demo_register_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DemoRegistrationRequest body: (required)
        :return: DemoRegistrationSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'register' in params:
            form_params.append(('register', params['register']))  # noqa: E501
        if 'register' in params:
            form_params.append(('register', params['register']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/demo_register/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DemoRegistrationSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_events_list(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str c: The pagination cursor value.
        :param int page_size: Number of results to return per page.
        :return: PaginatedEventDetailList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_events_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.app_events_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def app_events_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_events_list  # noqa: E501

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_events_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str c: The pagination cursor value.
        :param int page_size: Number of results to return per page.
        :return: PaginatedEventDetailList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['c', 'page_size']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

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

        return self.api_client.call_api(
            '/app/events/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PaginatedEventDetailList',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_events_properties_retrieve(async_req=True)
        >>> result = thread.get()

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

    def app_events_properties_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_events_properties_retrieve  # noqa: E501

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_events_properties_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/events/properties/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='EventProperties',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_events_search_list(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str c: The pagination cursor value.
        :param str customer_id:
        :param str idempotency_id:
        :param int page_size: Number of results to return per page.
        :return: PaginatedEventDetailList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_events_search_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.app_events_search_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def app_events_search_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_events_search_list  # noqa: E501

        API endpoint that allows events to be viewed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_events_search_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str c: The pagination cursor value.
        :param str customer_id:
        :param str idempotency_id:
        :param int page_size: Number of results to return per page.
        :return: PaginatedEventDetailList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['c', 'customer_id', 'idempotency_id', 'page_size']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'c' in params:
            query_params.append(('c', params['c']))  # noqa: E501
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'idempotency_id' in params:
            query_params.append(('idempotency_id', params['idempotency_id']))  # noqa: E501
        if 'page_size' in params:
            query_params.append(('page_size', params['page_size']))  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/events/search/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PaginatedEventDetailList',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_external_plan_links_create(self, body, **kwargs):  # noqa: E501
        """app_external_plan_links_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_external_plan_links_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_external_plan_links_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_external_plan_links_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_external_plan_links_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ExternalPlanLinkRequest body: (required)
        :return: ExternalPlanLink
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501
        if 'external_plan_id' in params:
            form_params.append(('external_plan_id', params['external_plan_id']))  # noqa: E501
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501
        if 'external_plan_id' in params:
            form_params.append(('external_plan_id', params['external_plan_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/external_plan_links/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ExternalPlanLink',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_external_plan_links_destroy(self, external_plan_id, source, **kwargs):  # noqa: E501
        """app_external_plan_links_destroy  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_external_plan_links_destroy(external_plan_id, source, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str external_plan_id: (required)
        :param str source: * `stripe` - Stripe * `braintree` - Braintree (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_external_plan_links_destroy_with_http_info(external_plan_id, source, **kwargs)  # noqa: E501
        else:
            (data) = self.app_external_plan_links_destroy_with_http_info(external_plan_id, source,
                                                                         **kwargs)  # noqa: E501
            return data

    def app_external_plan_links_destroy_with_http_info(self, external_plan_id, source, **kwargs):  # noqa: E501
        """app_external_plan_links_destroy  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_external_plan_links_destroy_with_http_info(external_plan_id, source, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str external_plan_id: (required)
        :param str source: * `stripe` - Stripe * `braintree` - Braintree (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['external_plan_id', 'source']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/external_plan_links/{external_plan_id}/', '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_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_features_create(self, body, **kwargs):  # noqa: E501
        """app_features_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_features_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_features_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_features_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_features_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param FeatureCreateRequest body: (required)
        :return: FeatureDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'feature_name' in params:
            form_params.append(('feature_name', params['feature_name']))  # noqa: E501
        if 'feature_description' in params:
            form_params.append(('feature_description', params['feature_description']))  # noqa: E501
        if 'feature_name' in params:
            form_params.append(('feature_name', params['feature_name']))  # noqa: E501
        if 'feature_description' in params:
            form_params.append(('feature_description', params['feature_description']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/features/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='FeatureDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_features_list(async_req=True)
        >>> result = thread.get()

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

    def app_features_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_features_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_features_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[FeatureDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/features/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[FeatureDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_import_customers_create(self, body, **kwargs):  # noqa: E501
        """app_import_customers_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_import_customers_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_import_customers_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_import_customers_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_import_customers_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ImportCustomersRequestRequest body: (required)
        :return: ImportCustomerSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/import_customers/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ImportCustomerSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_import_payment_objects_create(self, body, **kwargs):  # noqa: E501
        """app_import_payment_objects_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_import_payment_objects_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_import_payment_objects_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_import_payment_objects_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_import_payment_objects_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ImportPaymentObjectsRequestRequest body: (required)
        :return: ImportPaymentObjectSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/import_payment_objects/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ImportPaymentObjectSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_import_subscriptions_create(self, body, **kwargs):  # noqa: E501
        """app_import_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_import_subscriptions_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_import_subscriptions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_import_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_import_subscriptions_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ImportSubscriptionsRequestRequest body: (required)
        :return: ImportSubscriptionsSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/import_subscriptions/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ImportSubscriptionsSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_invoices_create(self, body, **kwargs):  # noqa: E501
        """app_invoices_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_invoices_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_invoices_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param InvoiceDetailRequest body: (required)
        :return: InvoiceDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'invoice_id' in params:
            form_params.append(('invoice_id', params['invoice_id']))  # noqa: E501
        if 'line_items' in params:
            form_params.append(('line_items', params['line_items']))  # noqa: E501
            collection_formats['line_items'] = 'multi'  # noqa: E501
        if 'external_payment_obj_status' in params:
            form_params.append(('external_payment_obj_status', params['external_payment_obj_status']))  # noqa: E501
        if 'seller' in params:
            form_params.append(('seller', params['seller']))  # noqa: E501
        if 'cost_due' in params:
            form_params.append(('cost_due', params['cost_due']))  # noqa: E501
        if 'external_payment_obj_type' in params:
            form_params.append(('external_payment_obj_type', params['external_payment_obj_type']))  # noqa: E501
        if 'currency' in params:
            form_params.append(('currency', params['currency']))  # noqa: E501
        if 'invoice_id' in params:
            form_params.append(('invoice_id', params['invoice_id']))  # noqa: E501
        if 'line_items' in params:
            form_params.append(('line_items', params['line_items']))  # noqa: E501
            collection_formats['line_items'] = 'multi'  # noqa: E501
        if 'external_payment_obj_status' in params:
            form_params.append(('external_payment_obj_status', params['external_payment_obj_status']))  # noqa: E501
        if 'seller' in params:
            form_params.append(('seller', params['seller']))  # noqa: E501
        if 'cost_due' in params:
            form_params.append(('cost_due', params['cost_due']))  # noqa: E501
        if 'external_payment_obj_type' in params:
            form_params.append(('external_payment_obj_type', params['external_payment_obj_type']))  # noqa: E501
        if 'currency' in params:
            form_params.append(('currency', params['currency']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/invoices/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_list(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: A filter for invoices for a specific customer
        :param list[str] payment_status: A filter for invoices with a specific payment status
        :return: list[InvoiceDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_invoices_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.app_invoices_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def app_invoices_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_invoices_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: A filter for invoices for a specific customer
        :param list[str] payment_status: A filter for invoices with a specific payment status
        :return: list[InvoiceDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'payment_status']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'payment_status' in params:
            query_params.append(('payment_status', params['payment_status']))  # noqa: E501
            collection_formats['payment_status'] = 'multi'  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/invoices/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[InvoiceDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_invoices_partial_update(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_partial_update(invoice_id, async_req=True)
        >>> result = thread.get()

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

    def app_invoices_partial_update_with_http_info(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_partial_update_with_http_info(invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str invoice_id: (required)
        :param PatchedInvoiceUpdateRequest body:
        :return: InvoicePayment
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'payment_status' in params:
            form_params.append(('payment_status', params['payment_status']))  # noqa: E501
        if 'payment_status' in params:
            form_params.append(('payment_status', params['payment_status']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/invoices/{invoice_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoicePayment',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_invoices_pdf_url_retrieve(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_pdf_url_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_pdf_url_retrieve(invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str invoice_id: Either an invoice ID (in the format `invoice_<uuid>`) or an invoice number (in the format `YYMMDD-000001`) (required)
        :return: InvoiceDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_invoices_pdf_url_retrieve_with_http_info(invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_invoices_pdf_url_retrieve_with_http_info(invoice_id, **kwargs)  # noqa: E501
            return data

    def app_invoices_pdf_url_retrieve_with_http_info(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_pdf_url_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_pdf_url_retrieve_with_http_info(invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str invoice_id: Either an invoice ID (in the format `invoice_<uuid>`) or an invoice number (in the format `YYMMDD-000001`) (required)
        :return: InvoiceDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'invoice_id' in params:
            path_params['invoice_id'] = params['invoice_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/invoices/{invoice_id}/pdf_url/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_invoices_retrieve(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_retrieve(invoice_id, async_req=True)
        >>> result = thread.get()

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

    def app_invoices_retrieve_with_http_info(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_retrieve_with_http_info(invoice_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'invoice_id' in params:
            path_params['invoice_id'] = params['invoice_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/invoices/{invoice_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_invoices_send_create(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_send_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_send_create(invoice_id, async_req=True)
        >>> result = thread.get()

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

    def app_invoices_send_create_with_http_info(self, invoice_id, **kwargs):  # noqa: E501
        """app_invoices_send_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_invoices_send_create_with_http_info(invoice_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'invoice_id' in params:
            path_params['invoice_id'] = params['invoice_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/invoices/{invoice_id}/send/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_login_create(self, body, **kwargs):  # noqa: E501
        """app_login_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_login_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_login_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_login_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_login_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param LoginRequestRequest body: (required)
        :return: LoginSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'username' in params:
            form_params.append(('username', params['username']))  # noqa: E501
        if 'password' in params:
            form_params.append(('password', params['password']))  # noqa: E501
        if 'username' in params:
            form_params.append(('username', params['username']))  # noqa: E501
        if 'password' in params:
            form_params.append(('password', params['password']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/login/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LoginSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_logout_create(async_req=True)
        >>> result = thread.get()

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

    def app_logout_create_with_http_info(self, **kwargs):  # noqa: E501
        """app_logout_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_logout_create_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/logout/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LogoutSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_metrics_create(self, body, **kwargs):  # noqa: E501
        """app_metrics_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_metrics_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_metrics_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MetricCreateRequest body: (required)
        :return: MetricDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'event_name' in params:
            form_params.append(('event_name', params['event_name']))  # noqa: E501
        if 'property_name' in params:
            form_params.append(('property_name', params['property_name']))  # noqa: E501
        if 'usage_aggregation_type' in params:
            form_params.append(('usage_aggregation_type', params['usage_aggregation_type']))  # noqa: E501
        if 'billable_aggregation_type' in params:
            form_params.append(('billable_aggregation_type', params['billable_aggregation_type']))  # noqa: E501
        if 'granularity' in params:
            form_params.append(('granularity', params['granularity']))  # noqa: E501
        if 'event_type' in params:
            form_params.append(('event_type', params['event_type']))  # noqa: E501
        if 'metric_type' in params:
            form_params.append(('metric_type', params['metric_type']))  # noqa: E501
        if 'metric_name' in params:
            form_params.append(('metric_name', params['metric_name']))  # noqa: E501
        if 'proration' in params:
            form_params.append(('proration', params['proration']))  # noqa: E501
        if 'properties' in params:
            form_params.append(('properties', params['properties']))  # noqa: E501
        if 'is_cost_metric' in params:
            form_params.append(('is_cost_metric', params['is_cost_metric']))  # noqa: E501
        if 'custom_sql' in params:
            form_params.append(('custom_sql', params['custom_sql']))  # noqa: E501
        if 'categorical_filters' in params:
            form_params.append(('categorical_filters', params['categorical_filters']))  # noqa: E501
            collection_formats['categorical_filters'] = 'multi'  # noqa: E501
        if 'numeric_filters' in params:
            form_params.append(('numeric_filters', params['numeric_filters']))  # noqa: E501
            collection_formats['numeric_filters'] = 'multi'  # noqa: E501
        if 'event_name' in params:
            form_params.append(('event_name', params['event_name']))  # noqa: E501
        if 'property_name' in params:
            form_params.append(('property_name', params['property_name']))  # noqa: E501
        if 'usage_aggregation_type' in params:
            form_params.append(('usage_aggregation_type', params['usage_aggregation_type']))  # noqa: E501
        if 'billable_aggregation_type' in params:
            form_params.append(('billable_aggregation_type', params['billable_aggregation_type']))  # noqa: E501
        if 'granularity' in params:
            form_params.append(('granularity', params['granularity']))  # noqa: E501
        if 'event_type' in params:
            form_params.append(('event_type', params['event_type']))  # noqa: E501
        if 'metric_type' in params:
            form_params.append(('metric_type', params['metric_type']))  # noqa: E501
        if 'metric_name' in params:
            form_params.append(('metric_name', params['metric_name']))  # noqa: E501
        if 'proration' in params:
            form_params.append(('proration', params['proration']))  # noqa: E501
        if 'properties' in params:
            form_params.append(('properties', params['properties']))  # noqa: E501
        if 'is_cost_metric' in params:
            form_params.append(('is_cost_metric', params['is_cost_metric']))  # noqa: E501
        if 'custom_sql' in params:
            form_params.append(('custom_sql', params['custom_sql']))  # noqa: E501
        if 'categorical_filters' in params:
            form_params.append(('categorical_filters', params['categorical_filters']))  # noqa: E501
            collection_formats['categorical_filters'] = 'multi'  # noqa: E501
        if 'numeric_filters' in params:
            form_params.append(('numeric_filters', params['numeric_filters']))  # noqa: E501
            collection_formats['numeric_filters'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/metrics/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MetricDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_list(async_req=True)
        >>> result = thread.get()

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

    def app_metrics_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_metrics_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[MetricDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/metrics/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[MetricDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_metrics_partial_update(self, metric_id, **kwargs):  # noqa: E501
        """app_metrics_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_partial_update(metric_id, async_req=True)
        >>> result = thread.get()

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

    def app_metrics_partial_update_with_http_info(self, metric_id, **kwargs):  # noqa: E501
        """app_metrics_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_partial_update_with_http_info(metric_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str metric_id: (required)
        :param PatchedMetricUpdateRequest body:
        :return: MetricUpdate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'billable_metric_name' in params:
            form_params.append(('billable_metric_name', params['billable_metric_name']))  # noqa: E501
        if 'status' in params:
            form_params.append(('status', params['status']))  # noqa: E501
        if 'billable_metric_name' in params:
            form_params.append(('billable_metric_name', params['billable_metric_name']))  # noqa: E501
        if 'status' in params:
            form_params.append(('status', params['status']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/metrics/{metric_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MetricUpdate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_metrics_retrieve(self, metric_id, **kwargs):  # noqa: E501
        """app_metrics_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_retrieve(metric_id, async_req=True)
        >>> result = thread.get()

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

    def app_metrics_retrieve_with_http_info(self, metric_id, **kwargs):  # noqa: E501
        """app_metrics_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_metrics_retrieve_with_http_info(metric_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'metric_id' in params:
            path_params['metric_id'] = params['metric_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/metrics/{metric_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MetricDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_netsuite_customers_retrieve(async_req=True)
        >>> result = thread.get()

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

    def app_netsuite_customers_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_netsuite_customers_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_netsuite_customers_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/netsuite_customers/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='URLResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_netsuite_invoices_retrieve(async_req=True)
        >>> result = thread.get()

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

    def app_netsuite_invoices_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_netsuite_invoices_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_netsuite_invoices_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/netsuite_invoices/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='URLResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_organization_invite_create(self, body, **kwargs):  # noqa: E501
        """app_organization_invite_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organization_invite_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_organization_invite_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_organization_invite_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organization_invite_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param InviteRequestRequest body: (required)
        :return: InviteResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/organization/invite/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InviteResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_organization_invite_link_create(self, body, **kwargs):  # noqa: E501
        """app_organization_invite_link_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organization_invite_link_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_organization_invite_link_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_organization_invite_link_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organization_invite_link_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param InviteRequestRequest body: (required)
        :return: InviteLinkResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/organization/invite_link/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InviteLinkResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_organizations_create(self, body, **kwargs):  # noqa: E501
        """app_organizations_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_organizations_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_organizations_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param OrganizationCreateRequest body: (required)
        :return: Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'organization_name' in params:
            form_params.append(('organization_name', params['organization_name']))  # noqa: E501
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'organization_type' in params:
            form_params.append(('organization_type', params['organization_type']))  # noqa: E501
        if 'organization_name' in params:
            form_params.append(('organization_name', params['organization_name']))  # noqa: E501
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'organization_type' in params:
            form_params.append(('organization_type', params['organization_type']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/organizations/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Organization',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_list(async_req=True)
        >>> result = thread.get()

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

    def app_organizations_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_organizations_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[Organization]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/organizations/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Organization]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_organizations_partial_update(self, organization_id, **kwargs):  # noqa: E501
        """app_organizations_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_partial_update(organization_id, async_req=True)
        >>> result = thread.get()

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

    def app_organizations_partial_update_with_http_info(self, organization_id, **kwargs):  # noqa: E501
        """app_organizations_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_partial_update_with_http_info(organization_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str organization_id: (required)
        :param PatchedOrganizationUpdateRequest body:
        :return: Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'address' in params:
            form_params.append(('address', params['address']))  # noqa: E501
        if 'tax_rate' in params:
            form_params.append(('tax_rate', params['tax_rate']))  # noqa: E501
        if 'payment_grace_period' in params:
            form_params.append(('payment_grace_period', params['payment_grace_period']))  # noqa: E501
        if 'plan_tags' in params:
            form_params.append(('plan_tags', params['plan_tags']))  # noqa: E501
            collection_formats['plan_tags'] = 'multi'  # noqa: E501
        if 'subscription_filter_keys' in params:
            form_params.append(('subscription_filter_keys', params['subscription_filter_keys']))  # noqa: E501
            collection_formats['subscription_filter_keys'] = 'multi'  # noqa: E501
        if 'timezone' in params:
            form_params.append(('timezone', params['timezone']))  # noqa: E501
        if 'payment_provider' in params:
            form_params.append(('payment_provider', params['payment_provider']))  # noqa: E501
        if 'payment_provider_id' in params:
            form_params.append(('payment_provider_id', params['payment_provider_id']))  # noqa: E501
        if 'nango_connected' in params:
            form_params.append(('nango_connected', params['nango_connected']))  # noqa: E501
        if 'tax_providers' in params:
            form_params.append(('tax_providers', params['tax_providers']))  # noqa: E501
            collection_formats['tax_providers'] = 'multi'  # noqa: E501
        if 'gen_cust_in_stripe_after_lotus' in params:
            form_params.append(
                ('gen_cust_in_stripe_after_lotus', params['gen_cust_in_stripe_after_lotus']))  # noqa: E501
        if 'gen_cust_in_braintree_after_lotus' in params:
            form_params.append(
                ('gen_cust_in_braintree_after_lotus', params['gen_cust_in_braintree_after_lotus']))  # noqa: E501
        if 'lotus_is_customer_source_for_salesforce' in params:
            form_params.append(('lotus_is_customer_source_for_salesforce',
                                params['lotus_is_customer_source_for_salesforce']))  # noqa: E501
        if 'default_currency_code' in params:
            form_params.append(('default_currency_code', params['default_currency_code']))  # noqa: E501
        if 'address' in params:
            form_params.append(('address', params['address']))  # noqa: E501
        if 'tax_rate' in params:
            form_params.append(('tax_rate', params['tax_rate']))  # noqa: E501
        if 'payment_grace_period' in params:
            form_params.append(('payment_grace_period', params['payment_grace_period']))  # noqa: E501
        if 'plan_tags' in params:
            form_params.append(('plan_tags', params['plan_tags']))  # noqa: E501
            collection_formats['plan_tags'] = 'multi'  # noqa: E501
        if 'subscription_filter_keys' in params:
            form_params.append(('subscription_filter_keys', params['subscription_filter_keys']))  # noqa: E501
            collection_formats['subscription_filter_keys'] = 'multi'  # noqa: E501
        if 'timezone' in params:
            form_params.append(('timezone', params['timezone']))  # noqa: E501
        if 'payment_provider' in params:
            form_params.append(('payment_provider', params['payment_provider']))  # noqa: E501
        if 'payment_provider_id' in params:
            form_params.append(('payment_provider_id', params['payment_provider_id']))  # noqa: E501
        if 'nango_connected' in params:
            form_params.append(('nango_connected', params['nango_connected']))  # noqa: E501
        if 'tax_providers' in params:
            form_params.append(('tax_providers', params['tax_providers']))  # noqa: E501
            collection_formats['tax_providers'] = 'multi'  # noqa: E501
        if 'gen_cust_in_stripe_after_lotus' in params:
            form_params.append(
                ('gen_cust_in_stripe_after_lotus', params['gen_cust_in_stripe_after_lotus']))  # noqa: E501
        if 'gen_cust_in_braintree_after_lotus' in params:
            form_params.append(
                ('gen_cust_in_braintree_after_lotus', params['gen_cust_in_braintree_after_lotus']))  # noqa: E501
        if 'lotus_is_customer_source_for_salesforce' in params:
            form_params.append(('lotus_is_customer_source_for_salesforce',
                                params['lotus_is_customer_source_for_salesforce']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/organizations/{organization_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Organization',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_organizations_sync_crm_create(self, organization_id, **kwargs):  # noqa: E501
        """app_organizations_sync_crm_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_sync_crm_create(organization_id, async_req=True)
        >>> result = thread.get()

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

    def app_organizations_sync_crm_create_with_http_info(self, organization_id, **kwargs):  # noqa: E501
        """app_organizations_sync_crm_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_organizations_sync_crm_create_with_http_info(organization_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str organization_id: (required)
        :param CRMSyncRequestRequest body:
        :return: DeleteAddOn
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'crm_provider_names' in params:
            form_params.append(('crm_provider_names', params['crm_provider_names']))  # noqa: E501
            collection_formats['crm_provider_names'] = 'multi'  # noqa: E501
        if 'crm_provider_names' in params:
            form_params.append(('crm_provider_names', params['crm_provider_names']))  # noqa: E501
            collection_formats['crm_provider_names'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/organizations/{organization_id}/sync_crm/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeleteAddOn',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_payment_providers_create(self, body, **kwargs):  # noqa: E501
        """app_payment_providers_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_payment_providers_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_payment_providers_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_payment_providers_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_payment_providers_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PaymentProcesorPostRequestRequest body: (required)
        :return: PaymentProcesorPostResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'pp_info' in params:
            form_params.append(('pp_info', params['pp_info']))  # noqa: E501
        if 'pp_info' in params:
            form_params.append(('pp_info', params['pp_info']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/payment_providers/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PaymentProcesorPostResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_payment_providers_list(async_req=True)
        >>> result = thread.get()

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

    def app_payment_providers_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_payment_providers_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_payment_providers_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[SinglePaymentProcesor]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/payment_providers/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[SinglePaymentProcesor]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_period_metric_revenue_retrieve(self, end_date, start_date, **kwargs):  # noqa: E501
        """app_period_metric_revenue_retrieve  # noqa: E501

        Returns the revenue for an organization in a given time period.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_period_metric_revenue_retrieve(end_date, start_date, async_req=True)
        >>> result = thread.get()

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

    def app_period_metric_revenue_retrieve_with_http_info(self, end_date, start_date, **kwargs):  # noqa: E501
        """app_period_metric_revenue_retrieve  # noqa: E501

        Returns the revenue for an organization in a given time period.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_period_metric_revenue_retrieve_with_http_info(end_date, start_date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date end_date: (required)
        :param date start_date: (required)
        :return: PeriodMetricRevenueResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['end_date', 'start_date']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

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

        return self.api_client.call_api(
            '/app/period_metric_revenue/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PeriodMetricRevenueResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_period_metric_usage_retrieve(self, end_date, start_date, **kwargs):  # noqa: E501
        """app_period_metric_usage_retrieve  # noqa: E501

        Return current usage for a customer during a given billing period.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_period_metric_usage_retrieve(end_date, start_date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date end_date: (required)
        :param date start_date: (required)
        :param int top_n_customers:
        :return: PeriodMetricUsageResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_period_metric_usage_retrieve_with_http_info(end_date, start_date, **kwargs)  # noqa: E501
        else:
            (data) = self.app_period_metric_usage_retrieve_with_http_info(end_date, start_date, **kwargs)  # noqa: E501
            return data

    def app_period_metric_usage_retrieve_with_http_info(self, end_date, start_date, **kwargs):  # noqa: E501
        """app_period_metric_usage_retrieve  # noqa: E501

        Return current usage for a customer during a given billing period.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_period_metric_usage_retrieve_with_http_info(end_date, start_date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date end_date: (required)
        :param date start_date: (required)
        :param int top_n_customers:
        :return: PeriodMetricUsageResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['end_date', 'start_date', 'top_n_customers']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'end_date' in params:
            query_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'start_date' in params:
            query_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'top_n_customers' in params:
            query_params.append(('top_n_customers', params['top_n_customers']))  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/period_metric_usage/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PeriodMetricUsageResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_create(self, body, **kwargs):  # noqa: E501
        """app_plan_versions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_plan_versions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PlanVersionCreateRequest body: (required)
        :return: PlanVersionDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'recurring_charges' in params:
            form_params.append(('recurring_charges', params['recurring_charges']))  # noqa: E501
            collection_formats['recurring_charges'] = 'multi'  # noqa: E501
        if 'components' in params:
            form_params.append(('components', params['components']))  # noqa: E501
            collection_formats['components'] = 'multi'  # noqa: E501
        if 'features' in params:
            form_params.append(('features', params['features']))  # noqa: E501
            collection_formats['features'] = 'multi'  # noqa: E501
        if 'price_adjustment' in params:
            form_params.append(('price_adjustment', params['price_adjustment']))  # noqa: E501
        if 'day_anchor' in params:
            form_params.append(('day_anchor', params['day_anchor']))  # noqa: E501
        if 'month_anchor' in params:
            form_params.append(('month_anchor', params['month_anchor']))  # noqa: E501
        if 'currency_code' in params:
            form_params.append(('currency_code', params['currency_code']))  # noqa: E501
        if 'version' in params:
            form_params.append(('version', params['version']))  # noqa: E501
        if 'target_customer_ids' in params:
            form_params.append(('target_customer_ids', params['target_customer_ids']))  # noqa: E501
            collection_formats['target_customer_ids'] = 'multi'  # noqa: E501
        if 'localized_name' in params:
            form_params.append(('localized_name', params['localized_name']))  # noqa: E501
        if 'make_active' in params:
            form_params.append(('make_active', params['make_active']))  # noqa: E501
        if 'make_active_type' in params:
            form_params.append(('make_active_type', params['make_active_type']))  # noqa: E501
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'recurring_charges' in params:
            form_params.append(('recurring_charges', params['recurring_charges']))  # noqa: E501
            collection_formats['recurring_charges'] = 'multi'  # noqa: E501
        if 'components' in params:
            form_params.append(('components', params['components']))  # noqa: E501
            collection_formats['components'] = 'multi'  # noqa: E501
        if 'features' in params:
            form_params.append(('features', params['features']))  # noqa: E501
            collection_formats['features'] = 'multi'  # noqa: E501
        if 'price_adjustment' in params:
            form_params.append(('price_adjustment', params['price_adjustment']))  # noqa: E501
        if 'day_anchor' in params:
            form_params.append(('day_anchor', params['day_anchor']))  # noqa: E501
        if 'month_anchor' in params:
            form_params.append(('month_anchor', params['month_anchor']))  # noqa: E501
        if 'currency_code' in params:
            form_params.append(('currency_code', params['currency_code']))  # noqa: E501
        if 'version' in params:
            form_params.append(('version', params['version']))  # noqa: E501
        if 'target_customer_ids' in params:
            form_params.append(('target_customer_ids', params['target_customer_ids']))  # noqa: E501
            collection_formats['target_customer_ids'] = 'multi'  # noqa: E501
        if 'localized_name' in params:
            form_params.append(('localized_name', params['localized_name']))  # noqa: E501
        if 'make_active' in params:
            form_params.append(('make_active', params['make_active']))  # noqa: E501
        if 'make_active_type' in params:
            form_params.append(('make_active_type', params['make_active_type']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanVersionDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_delete_create(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_delete_create(version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_delete_create_with_http_info(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_delete_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_delete_create_with_http_info(version_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'version_id' in params:
            path_params['version_id'] = params['version_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/delete/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeletePlanVersion',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_features_add_create(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_features_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_features_add_create(body, version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_features_add_create_with_http_info(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_features_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_features_add_create_with_http_info(body, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddFeatureRequest body: (required)
        :param str version_id: (required)
        :return: AddFeatureResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plan_versions_features_add_create" % 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 `app_plan_versions_features_add_create`")  # noqa: E501
        # verify the required parameter 'version_id' is set
        if ('version_id' not in params or
                params['version_id'] is None):
            raise ValueError(
                "Missing the required parameter `version_id` when calling `app_plan_versions_features_add_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/features/add/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddFeatureResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_list(async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_plan_versions_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[PlanVersionDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[PlanVersionDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_make_public_create(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_make_public_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_make_public_create(body, version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_make_public_create_with_http_info(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_make_public_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_make_public_create_with_http_info(body, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MakePublicRequestRequest body: (required)
        :param str version_id: (required)
        :return: MakePublicResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plan_versions_make_public_create" % 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 `app_plan_versions_make_public_create`")  # noqa: E501
        # verify the required parameter 'version_id' is set
        if ('version_id' not in params or
                params['version_id'] is None):
            raise ValueError(
                "Missing the required parameter `version_id` when calling `app_plan_versions_make_public_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'version' in params:
            form_params.append(('version', params['version']))  # noqa: E501
        if 'version' in params:
            form_params.append(('version', params['version']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/make_public/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MakePublicResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_partial_update(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_partial_update(version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_partial_update_with_http_info(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_partial_update  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_partial_update_with_http_info(version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version_id: (required)
        :param PatchedPlanVersionUpdateRequest body:
        :return: PlanVersionUpdate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'localized_name' in params:
            form_params.append(('localized_name', params['localized_name']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501
        if 'localized_name' in params:
            form_params.append(('localized_name', params['localized_name']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanVersionUpdate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_replacement_make_create(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_replacement_make_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_replacement_make_create(body, version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_replacement_make_create_with_http_info(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_replacement_make_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_replacement_make_create_with_http_info(body, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MakeReplaceWithRequest body: (required)
        :param str version_id: (required)
        :return: MakeReplaceWithResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plan_versions_replacement_make_create" % 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 `app_plan_versions_replacement_make_create`")  # noqa: E501
        # verify the required parameter 'version_id' is set
        if ('version_id' not in params or
                params['version_id'] is None):
            raise ValueError(
                "Missing the required parameter `version_id` when calling `app_plan_versions_replacement_make_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'versions_to_replace' in params:
            form_params.append(('versions_to_replace', params['versions_to_replace']))  # noqa: E501
            collection_formats['versions_to_replace'] = 'multi'  # noqa: E501
        if 'versions_to_replace' in params:
            form_params.append(('versions_to_replace', params['versions_to_replace']))  # noqa: E501
            collection_formats['versions_to_replace'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/replacement/make/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MakeReplaceWithResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_replacement_set_create(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_replacement_set_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_replacement_set_create(body, version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_replacement_set_create_with_http_info(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_replacement_set_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_replacement_set_create_with_http_info(body, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SetReplaceWithRequest body: (required)
        :param str version_id: (required)
        :return: SetReplaceWithResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plan_versions_replacement_set_create" % 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 `app_plan_versions_replacement_set_create`")  # noqa: E501
        # verify the required parameter 'version_id' is set
        if ('version_id' not in params or
                params['version_id'] is None):
            raise ValueError(
                "Missing the required parameter `version_id` when calling `app_plan_versions_replacement_set_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'replace_with' in params:
            form_params.append(('replace_with', params['replace_with']))  # noqa: E501
        if 'replace_with' in params:
            form_params.append(('replace_with', params['replace_with']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/replacement/set/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SetReplaceWithResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_retrieve(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_retrieve(version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_retrieve_with_http_info(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_retrieve_with_http_info(version_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'version_id' in params:
            path_params['version_id'] = params['version_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanVersionDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_subscriptions_list(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_subscriptions_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_subscriptions_list(version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_subscriptions_list_with_http_info(self, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_subscriptions_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_subscriptions_list_with_http_info(version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version_id: (required)
        :return: list[PlanVersionHistoricalSubscription]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'version_id' in params:
            path_params['version_id'] = params['version_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/subscriptions/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[PlanVersionHistoricalSubscription]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_target_customers_add_create(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_target_customers_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_target_customers_add_create(body, version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_target_customers_add_create_with_http_info(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_target_customers_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_target_customers_add_create_with_http_info(body, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param TargetCustomersRequest body: (required)
        :param str version_id: (required)
        :return: AddTargetCustomerResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plan_versions_target_customers_add_create" % 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 `app_plan_versions_target_customers_add_create`")  # noqa: E501
        # verify the required parameter 'version_id' is set
        if ('version_id' not in params or
                params['version_id'] is None):
            raise ValueError(
                "Missing the required parameter `version_id` when calling `app_plan_versions_target_customers_add_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'customer_ids' in params:
            form_params.append(('customer_ids', params['customer_ids']))  # noqa: E501
            collection_formats['customer_ids'] = 'multi'  # noqa: E501
        if 'customer_ids' in params:
            form_params.append(('customer_ids', params['customer_ids']))  # noqa: E501
            collection_formats['customer_ids'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/target_customers/add/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddTargetCustomerResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plan_versions_target_customers_remove_create(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_target_customers_remove_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_target_customers_remove_create(body, version_id, async_req=True)
        >>> result = thread.get()

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

    def app_plan_versions_target_customers_remove_create_with_http_info(self, body, version_id, **kwargs):  # noqa: E501
        """app_plan_versions_target_customers_remove_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plan_versions_target_customers_remove_create_with_http_info(body, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param TargetCustomersRequest body: (required)
        :param str version_id: (required)
        :return: RemoveTargetCustomerResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plan_versions_target_customers_remove_create" % 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 `app_plan_versions_target_customers_remove_create`")  # noqa: E501
        # verify the required parameter 'version_id' is set
        if ('version_id' not in params or
                params['version_id'] is None):
            raise ValueError(
                "Missing the required parameter `version_id` when calling `app_plan_versions_target_customers_remove_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'customer_ids' in params:
            form_params.append(('customer_ids', params['customer_ids']))  # noqa: E501
            collection_formats['customer_ids'] = 'multi'  # noqa: E501
        if 'customer_ids' in params:
            form_params.append(('customer_ids', params['customer_ids']))  # noqa: E501
            collection_formats['customer_ids'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plan_versions/{version_id}/target_customers/remove/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RemoveTargetCustomerResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_by_customer_retrieve(async_req=True)
        >>> result = thread.get()

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

    def app_plans_by_customer_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_plans_by_customer_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_by_customer_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans_by_customer/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlansByNumCustomers',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_create(self, body, **kwargs):  # noqa: E501
        """app_plans_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_plans_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_plans_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PlanCreateRequest body: (required)
        :return: PlanDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'plan_name' in params:
            form_params.append(('plan_name', params['plan_name']))  # noqa: E501
        if 'plan_description' in params:
            form_params.append(('plan_description', params['plan_description']))  # noqa: E501
        if 'plan_duration' in params:
            form_params.append(('plan_duration', params['plan_duration']))  # noqa: E501
        if 'initial_external_links' in params:
            form_params.append(('initial_external_links', params['initial_external_links']))  # noqa: E501
            collection_formats['initial_external_links'] = 'multi'  # noqa: E501
        if 'initial_version' in params:
            form_params.append(('initial_version', params['initial_version']))  # noqa: E501
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501
        if 'plan_name' in params:
            form_params.append(('plan_name', params['plan_name']))  # noqa: E501
        if 'plan_description' in params:
            form_params.append(('plan_description', params['plan_description']))  # noqa: E501
        if 'plan_duration' in params:
            form_params.append(('plan_duration', params['plan_duration']))  # noqa: E501
        if 'initial_external_links' in params:
            form_params.append(('initial_external_links', params['initial_external_links']))  # noqa: E501
            collection_formats['initial_external_links'] = 'multi'  # noqa: E501
        if 'initial_version' in params:
            form_params.append(('initial_version', params['initial_version']))  # noqa: E501
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_delete_create(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_delete_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_delete_create(plan_id, async_req=True)
        >>> result = thread.get()

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

    def app_plans_delete_create_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_delete_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_delete_create_with_http_info(plan_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'plan_id' in params:
            path_params['plan_id'] = params['plan_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/delete/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeletePlan',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_features_add_create(self, body, plan_id, **kwargs):  # noqa: E501
        """app_plans_features_add_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_features_add_create(body, plan_id, async_req=True)
        >>> result = thread.get()

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

    def app_plans_features_add_create_with_http_info(self, body, plan_id, **kwargs):  # noqa: E501
        """app_plans_features_add_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_features_add_create_with_http_info(body, plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddFeatureToPlanRequest body: (required)
        :param str plan_id: (required)
        :return: AddFeatureToPlanResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plans_features_add_create" % 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 `app_plans_features_add_create`")  # noqa: E501
        # verify the required parameter 'plan_id' is set
        if ('plan_id' not in params or
                params['plan_id'] is None):
            raise ValueError(
                "Missing the required parameter `plan_id` when calling `app_plans_features_add_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'all_versions' in params:
            form_params.append(('all_versions', params['all_versions']))  # noqa: E501
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'all_versions' in params:
            form_params.append(('all_versions', params['all_versions']))  # noqa: E501
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/features/add/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddFeatureToPlanResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_get_plan_price_for_customer_create(self, body, plan_id, **kwargs):  # noqa: E501
        """app_plans_get_plan_price_for_customer_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_get_plan_price_for_customer_create(body, plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CustomerPlanPriceRequest body: (required)
        :param str plan_id: The ID of the plan to get price (required)
        :return: Price
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_plans_get_plan_price_for_customer_create_with_http_info(body, plan_id,
                                                                                    **kwargs)  # noqa: E501
        else:
            (data) = self.app_plans_get_plan_price_for_customer_create_with_http_info(body, plan_id,
                                                                                      **kwargs)  # noqa: E501
            return data

    def app_plans_get_plan_price_for_customer_create_with_http_info(self, body, plan_id, **kwargs):  # noqa: E501
        """app_plans_get_plan_price_for_customer_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_get_plan_price_for_customer_create_with_http_info(body, plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CustomerPlanPriceRequest body: (required)
        :param str plan_id: The ID of the plan to get price (required)
        :return: Price
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plans_get_plan_price_for_customer_create" % 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 `app_plans_get_plan_price_for_customer_create`")  # noqa: E501
        # verify the required parameter 'plan_id' is set
        if ('plan_id' not in params or
                params['plan_id'] is None):
            raise ValueError(
                "Missing the required parameter `plan_id` when calling `app_plans_get_plan_price_for_customer_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'component_fixed_charges_initial_units' in params:
            form_params.append(('component_fixed_charges_initial_units',
                                params['component_fixed_charges_initial_units']))  # noqa: E501
            collection_formats['component_fixed_charges_initial_units'] = 'multi'  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'component_fixed_charges_initial_units' in params:
            form_params.append(('component_fixed_charges_initial_units',
                                params['component_fixed_charges_initial_units']))  # noqa: E501
            collection_formats['component_fixed_charges_initial_units'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/get_plan_price_for_customer/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Price',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_list(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str duration: Filter to plans that have this duration.  * `monthly` - Monthly * `quarterly` - Quarterly * `yearly` - Yearly
        :param list[str] exclude_tags: Filter to plans that do not have any of the tags in this list.
        :param list[str] include_tags: Filter to plans that have any of the tags in this list.
        :param list[str] include_tags_all: Filter to plans that have all of the tags in this list.
        :param str version_currency_code: Filter to versions that have the currency specified by this currency code.
        :param str version_custom_type: Filter to versions that have this custom type. If you choose custom_only, you will only see versions that have target customers. If you choose public_only, you will only see versions that do not have target customers.  * `custom_only` - Custom Only * `public_only` - Public Only * `all` - All
        :param list[str] version_status: Filter to versions that have this status. Ended means it has an active_to date in the past. Not started means it has an active_from date in the future or null.
        :return: list[PlanDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_plans_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.app_plans_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def app_plans_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_plans_list  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str duration: Filter to plans that have this duration.  * `monthly` - Monthly * `quarterly` - Quarterly * `yearly` - Yearly
        :param list[str] exclude_tags: Filter to plans that do not have any of the tags in this list.
        :param list[str] include_tags: Filter to plans that have any of the tags in this list.
        :param list[str] include_tags_all: Filter to plans that have all of the tags in this list.
        :param str version_currency_code: Filter to versions that have the currency specified by this currency code.
        :param str version_custom_type: Filter to versions that have this custom type. If you choose custom_only, you will only see versions that have target customers. If you choose public_only, you will only see versions that do not have target customers.  * `custom_only` - Custom Only * `public_only` - Public Only * `all` - All
        :param list[str] version_status: Filter to versions that have this status. Ended means it has an active_to date in the past. Not started means it has an active_from date in the future or null.
        :return: list[PlanDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['duration', 'exclude_tags', 'include_tags', 'include_tags_all', 'version_currency_code',
                      'version_custom_type', 'version_status']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'duration' in params:
            query_params.append(('duration', params['duration']))  # noqa: E501
        if 'exclude_tags' in params:
            query_params.append(('exclude_tags', params['exclude_tags']))  # noqa: E501
            collection_formats['exclude_tags'] = 'multi'  # noqa: E501
        if 'include_tags' in params:
            query_params.append(('include_tags', params['include_tags']))  # noqa: E501
            collection_formats['include_tags'] = 'multi'  # noqa: E501
        if 'include_tags_all' in params:
            query_params.append(('include_tags_all', params['include_tags_all']))  # noqa: E501
            collection_formats['include_tags_all'] = 'multi'  # noqa: E501
        if 'version_currency_code' in params:
            query_params.append(('version_currency_code', params['version_currency_code']))  # noqa: E501
        if 'version_custom_type' in params:
            query_params.append(('version_custom_type', params['version_custom_type']))  # noqa: E501
        if 'version_status' in params:
            query_params.append(('version_status', params['version_status']))  # noqa: E501
            collection_formats['version_status'] = 'multi'  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[PlanDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_partial_update(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_partial_update  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_partial_update(plan_id, async_req=True)
        >>> result = thread.get()

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

    def app_plans_partial_update_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_partial_update  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_partial_update_with_http_info(plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: (required)
        :param PatchedPlanUpdateRequest body:
        :return: PlanUpdate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'plan_name' in params:
            form_params.append(('plan_name', params['plan_name']))  # noqa: E501
        if 'plan_description' in params:
            form_params.append(('plan_description', params['plan_description']))  # noqa: E501
        if 'taxjar_code' in params:
            form_params.append(('taxjar_code', params['taxjar_code']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501
        if 'plan_name' in params:
            form_params.append(('plan_name', params['plan_name']))  # noqa: E501
        if 'plan_description' in params:
            form_params.append(('plan_description', params['plan_description']))  # noqa: E501
        if 'taxjar_code' in params:
            form_params.append(('taxjar_code', params['taxjar_code']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanUpdate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_retrieve(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_retrieve  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_retrieve(plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: (required)
        :param str version_currency_code: Filter to versions that have the currency specified by this currency code.
        :param str version_custom_type: Filter to versions that have this custom type. If you choose custom_only, you will only see versions that have target customers. If you choose public_only, you will only see versions that do not have target customers.  * `custom_only` - Custom Only * `public_only` - Public Only * `all` - All
        :param list[str] version_status: Filter to versions that have this status. Ended means it has an active_to date in the past. Not started means it has an active_from date in the future or null.
        :return: PlanDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_plans_retrieve_with_http_info(plan_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_plans_retrieve_with_http_info(plan_id, **kwargs)  # noqa: E501
            return data

    def app_plans_retrieve_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_retrieve  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_retrieve_with_http_info(plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: (required)
        :param str version_currency_code: Filter to versions that have the currency specified by this currency code.
        :param str version_custom_type: Filter to versions that have this custom type. If you choose custom_only, you will only see versions that have target customers. If you choose public_only, you will only see versions that do not have target customers.  * `custom_only` - Custom Only * `public_only` - Public Only * `all` - All
        :param list[str] version_status: Filter to versions that have this status. Ended means it has an active_to date in the past. Not started means it has an active_from date in the future or null.
        :return: PlanDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['plan_id', 'version_currency_code', 'version_custom_type', 'version_status']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

        query_params = []
        if 'version_currency_code' in params:
            query_params.append(('version_currency_code', params['version_currency_code']))  # noqa: E501
        if 'version_custom_type' in params:
            query_params.append(('version_custom_type', params['version_custom_type']))  # noqa: E501
        if 'version_status' in params:
            query_params.append(('version_status', params['version_status']))  # noqa: E501
            collection_formats['version_status'] = 'multi'  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_tags_add_create(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_tags_add_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_tags_add_create(plan_id, async_req=True)
        >>> result = thread.get()

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

    def app_plans_tags_add_create_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_tags_add_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_tags_add_create_with_http_info(plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: (required)
        :param AddPlanTagsRequest body:
        :return: AddPlanTags
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/tags/add/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddPlanTags',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_tags_remove_create(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_tags_remove_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_tags_remove_create(plan_id, async_req=True)
        >>> result = thread.get()

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

    def app_plans_tags_remove_create_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_tags_remove_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_tags_remove_create_with_http_info(plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: (required)
        :param RemovePlanTagsRequest body:
        :return: RemovePlanTags
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/tags/remove/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RemovePlanTags',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_tags_set_create(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_tags_set_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_tags_set_create(plan_id, async_req=True)
        >>> result = thread.get()

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

    def app_plans_tags_set_create_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_tags_set_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_tags_set_create_with_http_info(plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: (required)
        :param SetPlanTagsRequest body:
        :return: SetPlanTagsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501
        if 'tags' in params:
            form_params.append(('tags', params['tags']))  # noqa: E501
            collection_formats['tags'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/tags/set/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SetPlanTagsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_versions_active_dates_update_create(self, plan_id, version_number, **kwargs):  # noqa: E501
        """app_plans_versions_active_dates_update_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_active_dates_update_create(plan_id, version_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: The ID of the plan whose versions we're changing the active dates. (required)
        :param int version_number: The version number to update. (required)
        :param ChangeActiveDatesRequest body:
        :return: ChangeActiveDateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_plans_versions_active_dates_update_create_with_http_info(plan_id, version_number,
                                                                                     **kwargs)  # noqa: E501
        else:
            (data) = self.app_plans_versions_active_dates_update_create_with_http_info(plan_id, version_number,
                                                                                       **kwargs)  # noqa: E501
            return data

    def app_plans_versions_active_dates_update_create_with_http_info(self, plan_id, version_number,
                                                                     **kwargs):  # noqa: E501
        """app_plans_versions_active_dates_update_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_active_dates_update_create_with_http_info(plan_id, version_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str plan_id: The ID of the plan whose versions we're changing the active dates. (required)
        :param int version_number: The version number to update. (required)
        :param ChangeActiveDatesRequest body:
        :return: ChangeActiveDateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['plan_id', 'version_number', 'body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'all_versions' in params:
            form_params.append(('all_versions', params['all_versions']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'all_versions' in params:
            form_params.append(('all_versions', params['all_versions']))  # noqa: E501
        if 'active_from' in params:
            form_params.append(('active_from', params['active_from']))  # noqa: E501
        if 'active_to' in params:
            form_params.append(('active_to', params['active_to']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/versions/{version_number}/active_dates/update/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ChangeActiveDateResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_versions_features_add_create(self, body, plan_id, version_number, **kwargs):  # noqa: E501
        """app_plans_versions_features_add_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_features_add_create(body, plan_id, version_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddFeatureToPlanRequest body: (required)
        :param str plan_id: The ID of the plan whose versions we're adding a feature to. (required)
        :param int version_number: The version number to update. (required)
        :return: AddFeatureToPlanVersionNumberResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_plans_versions_features_add_create_with_http_info(body, plan_id, version_number,
                                                                              **kwargs)  # noqa: E501
        else:
            (data) = self.app_plans_versions_features_add_create_with_http_info(body, plan_id, version_number,
                                                                                **kwargs)  # noqa: E501
            return data

    def app_plans_versions_features_add_create_with_http_info(self, body, plan_id, version_number,
                                                              **kwargs):  # noqa: E501
        """app_plans_versions_features_add_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_features_add_create_with_http_info(body, plan_id, version_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddFeatureToPlanRequest body: (required)
        :param str plan_id: The ID of the plan whose versions we're adding a feature to. (required)
        :param int version_number: The version number to update. (required)
        :return: AddFeatureToPlanVersionNumberResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'plan_id', 'version_number']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plans_versions_features_add_create" % 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 `app_plans_versions_features_add_create`")  # noqa: E501
        # verify the required parameter 'plan_id' is set
        if ('plan_id' not in params or
                params['plan_id'] is None):
            raise ValueError(
                "Missing the required parameter `plan_id` when calling `app_plans_versions_features_add_create`")  # noqa: E501
        # verify the required parameter 'version_number' is set
        if ('version_number' not in params or
                params['version_number'] is None):
            raise ValueError(
                "Missing the required parameter `version_number` when calling `app_plans_versions_features_add_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'all_versions' in params:
            form_params.append(('all_versions', params['all_versions']))  # noqa: E501
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501
        if 'version_ids' in params:
            form_params.append(('version_ids', params['version_ids']))  # noqa: E501
            collection_formats['version_ids'] = 'multi'  # noqa: E501
        if 'all_versions' in params:
            form_params.append(('all_versions', params['all_versions']))  # noqa: E501
        if 'feature_id' in params:
            form_params.append(('feature_id', params['feature_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/versions/{version_number}/features/add/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddFeatureToPlanVersionNumberResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_versions_next_retrieve(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_versions_next_retrieve  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_next_retrieve(plan_id, async_req=True)
        >>> result = thread.get()

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

    def app_plans_versions_next_retrieve_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """app_plans_versions_next_retrieve  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_next_retrieve_with_http_info(plan_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'plan_id' in params:
            path_params['plan_id'] = params['plan_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/versions/next/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='NextPlanVersionNumberResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_versions_replacement_set_create(self, body, plan_id, version_number, **kwargs):  # noqa: E501
        """app_plans_versions_replacement_set_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_replacement_set_create(body, plan_id, version_number, async_req=True)
        >>> result = thread.get()

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

    def app_plans_versions_replacement_set_create_with_http_info(self, body, plan_id, version_number,
                                                                 **kwargs):  # noqa: E501
        """app_plans_versions_replacement_set_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_replacement_set_create_with_http_info(body, plan_id, version_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PlansSetReplaceWithForVersionNumberRequest body: (required)
        :param str plan_id: (required)
        :param str version_number: (required)
        :return: PlanVersionNumberSetReplaceWithResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'plan_id', 'version_number']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plans_versions_replacement_set_create" % 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 `app_plans_versions_replacement_set_create`")  # noqa: E501
        # verify the required parameter 'plan_id' is set
        if ('plan_id' not in params or
                params['plan_id'] is None):
            raise ValueError(
                "Missing the required parameter `plan_id` when calling `app_plans_versions_replacement_set_create`")  # noqa: E501
        # verify the required parameter 'version_number' is set
        if ('version_number' not in params or
                params['version_number'] is None):
            raise ValueError(
                "Missing the required parameter `version_number` when calling `app_plans_versions_replacement_set_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'replacement_version_number' in params:
            form_params.append(('replacement_version_number', params['replacement_version_number']))  # noqa: E501
        if 'replacement_version_number' in params:
            form_params.append(('replacement_version_number', params['replacement_version_number']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/versions/{version_number}/replacement/set/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanVersionNumberSetReplaceWithResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_plans_versions_transition_set_create(self, body, plan_id, version_number, **kwargs):  # noqa: E501
        """app_plans_versions_transition_set_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_transition_set_create(body, plan_id, version_number, async_req=True)
        >>> result = thread.get()

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

    def app_plans_versions_transition_set_create_with_http_info(self, body, plan_id, version_number,
                                                                **kwargs):  # noqa: E501
        """app_plans_versions_transition_set_create  # noqa: E501

        ViewSet for viewing and editing Plans.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_plans_versions_transition_set_create_with_http_info(body, plan_id, version_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PlansSetTransitionToForVersionNumberRequest body: (required)
        :param str plan_id: (required)
        :param str version_number: (required)
        :return: PlanVersionNumberSetTransitionToResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'plan_id', 'version_number']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_plans_versions_transition_set_create" % 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 `app_plans_versions_transition_set_create`")  # noqa: E501
        # verify the required parameter 'plan_id' is set
        if ('plan_id' not in params or
                params['plan_id'] is None):
            raise ValueError(
                "Missing the required parameter `plan_id` when calling `app_plans_versions_transition_set_create`")  # noqa: E501
        # verify the required parameter 'version_number' is set
        if ('version_number' not in params or
                params['version_number'] is None):
            raise ValueError(
                "Missing the required parameter `version_number` when calling `app_plans_versions_transition_set_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'transition_to_plan_id' in params:
            form_params.append(('transition_to_plan_id', params['transition_to_plan_id']))  # noqa: E501
        if 'transition_to_plan_id' in params:
            form_params.append(('transition_to_plan_id', params['transition_to_plan_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/plans/{plan_id}/versions/{version_number}/transition/set/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PlanVersionNumberSetTransitionToResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_pricing_units_create(self, body, **kwargs):  # noqa: E501
        """app_pricing_units_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_pricing_units_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_pricing_units_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_pricing_units_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_pricing_units_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PricingUnitDetailRequest body: (required)
        :return: PricingUnitDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'code' in params:
            form_params.append(('code', params['code']))  # noqa: E501
        if 'name' in params:
            form_params.append(('name', params['name']))  # noqa: E501
        if 'symbol' in params:
            form_params.append(('symbol', params['symbol']))  # noqa: E501
        if 'code' in params:
            form_params.append(('code', params['code']))  # noqa: E501
        if 'name' in params:
            form_params.append(('name', params['name']))  # noqa: E501
        if 'symbol' in params:
            form_params.append(('symbol', params['symbol']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/pricing_units/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PricingUnitDetail',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_pricing_units_list(async_req=True)
        >>> result = thread.get()

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

    def app_pricing_units_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_pricing_units_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_pricing_units_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[PricingUnitDetail]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/pricing_units/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[PricingUnitDetail]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_register_create(self, body, **kwargs):  # noqa: E501
        """app_register_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_register_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_register_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_register_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_register_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RegistrationRequest body: (required)
        :return: RegistrationSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'register' in params:
            form_params.append(('register', params['register']))  # noqa: E501
        if 'register' in params:
            form_params.append(('register', params['register']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/register/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RegistrationSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_session_retrieve(async_req=True)
        >>> result = thread.get()

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

    def app_session_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_session_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_session_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/session/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SessionSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_stripe_cancel_at_period_end_subscriptions_create(self, body, **kwargs):  # noqa: E501
        """app_stripe_cancel_at_period_end_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_stripe_cancel_at_period_end_subscriptions_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_stripe_cancel_at_period_end_subscriptions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_stripe_cancel_at_period_end_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_stripe_cancel_at_period_end_subscriptions_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param StripeMultiSubscriptionsRequest body: (required)
        :return: StripeTurnOffAutoRenewalSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'stripe_subscription_ids' in params:
            form_params.append(('stripe_subscription_ids', params['stripe_subscription_ids']))  # noqa: E501
            collection_formats['stripe_subscription_ids'] = 'multi'  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'stripe_subscription_ids' in params:
            form_params.append(('stripe_subscription_ids', params['stripe_subscription_ids']))  # noqa: E501
            collection_formats['stripe_subscription_ids'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/stripe/cancel_at_period_end_subscriptions/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StripeTurnOffAutoRenewalSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_stripe_cancel_subscriptions_create(self, body, **kwargs):  # noqa: E501
        """app_stripe_cancel_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_stripe_cancel_subscriptions_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_stripe_cancel_subscriptions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_stripe_cancel_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_stripe_cancel_subscriptions_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param StripeMultiSubscriptionsRequest body: (required)
        :return: StripeCancelSubscriptionsSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'stripe_subscription_ids' in params:
            form_params.append(('stripe_subscription_ids', params['stripe_subscription_ids']))  # noqa: E501
            collection_formats['stripe_subscription_ids'] = 'multi'  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'stripe_subscription_ids' in params:
            form_params.append(('stripe_subscription_ids', params['stripe_subscription_ids']))  # noqa: E501
            collection_formats['stripe_subscription_ids'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/stripe/cancel_subscriptions/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StripeCancelSubscriptionsSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_add_create(self, body, **kwargs):  # noqa: E501
        """app_subscriptions_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_add_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_subscriptions_add_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_subscriptions_add_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_add_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SubscriptionRecordCreateSerializerOldRequest body: (required)
        :return: SubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'auto_renew' in params:
            form_params.append(('auto_renew', params['auto_renew']))  # noqa: E501
        if 'is_new' in params:
            form_params.append(('is_new', params['is_new']))  # noqa: E501
        if 'subscription_filters' in params:
            form_params.append(('subscription_filters', params['subscription_filters']))  # noqa: E501
            collection_formats['subscription_filters'] = 'multi'  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'auto_renew' in params:
            form_params.append(('auto_renew', params['auto_renew']))  # noqa: E501
        if 'is_new' in params:
            form_params.append(('is_new', params['is_new']))  # noqa: E501
        if 'subscription_filters' in params:
            form_params.append(('subscription_filters', params['subscription_filters']))  # noqa: E501
            collection_formats['subscription_filters'] = 'multi'  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/add/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriptionRecord',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_addons_attach_create(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_addons_attach_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_addons_attach_create(subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subscription_id: The ID of the subscription to add an addon to. (required)
        :param AddOnSubscriptionRecordCreateRequest body:
        :return: AddOnSubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_subscriptions_addons_attach_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_subscriptions_addons_attach_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
            return data

    def app_subscriptions_addons_attach_create_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_addons_attach_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_addons_attach_create_with_http_info(subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subscription_id: The ID of the subscription to add an addon to. (required)
        :param AddOnSubscriptionRecordCreateRequest body:
        :return: AddOnSubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'addon_id' in params:
            form_params.append(('addon_id', params['addon_id']))  # noqa: E501
        if 'quantity' in params:
            form_params.append(('quantity', params['quantity']))  # noqa: E501
        if 'metadata' in params:
            form_params.append(('metadata', params['metadata']))  # noqa: E501
        if 'addon_id' in params:
            form_params.append(('addon_id', params['addon_id']))  # noqa: E501
        if 'quantity' in params:
            form_params.append(('quantity', params['quantity']))  # noqa: E501
        if 'metadata' in params:
            form_params.append(('metadata', params['metadata']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/{subscription_id}/addons/attach/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AddOnSubscriptionRecord',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_addons_cancel_create(self, addon_id, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_addons_cancel_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_addons_cancel_create(addon_id, subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str addon_id: The ID of the addon within the subscription update. (required)
        :param str subscription_id: The ID of the subscription to update. (required)
        :param SubscriptionRecordCancelRequest body:
        :return: list[AddOnSubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_subscriptions_addons_cancel_create_with_http_info(addon_id, subscription_id,
                                                                              **kwargs)  # noqa: E501
        else:
            (data) = self.app_subscriptions_addons_cancel_create_with_http_info(addon_id, subscription_id,
                                                                                **kwargs)  # noqa: E501
            return data

    def app_subscriptions_addons_cancel_create_with_http_info(self, addon_id, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_addons_cancel_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_addons_cancel_create_with_http_info(addon_id, subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str addon_id: The ID of the addon within the subscription update. (required)
        :param str subscription_id: The ID of the subscription to update. (required)
        :param SubscriptionRecordCancelRequest body:
        :return: list[AddOnSubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['addon_id', 'subscription_id', 'body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'flat_fee_behavior' in params:
            form_params.append(('flat_fee_behavior', params['flat_fee_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501
        if 'flat_fee_behavior' in params:
            form_params.append(('flat_fee_behavior', params['flat_fee_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/{subscription_id}/addons/{addon_id}/cancel/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[AddOnSubscriptionRecord]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_cancel_create(self, customer_id, **kwargs):  # noqa: E501
        """app_subscriptions_cancel_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_cancel_create(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: Filter to a specific customer. (required)
        :param SubscriptionRecordCancelRequest body:
        :param str plan_id: Filter to a specific plan. If not specified, all plans will be included in the cancellation request.
        :param list[SubscriptionFilterRequest] subscription_filters: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.
        :return: list[SubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_subscriptions_cancel_create_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_subscriptions_cancel_create_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def app_subscriptions_cancel_create_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """app_subscriptions_cancel_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_cancel_create_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: Filter to a specific customer. (required)
        :param SubscriptionRecordCancelRequest body:
        :param str plan_id: Filter to a specific plan. If not specified, all plans will be included in the cancellation request.
        :param list[SubscriptionFilterRequest] subscription_filters: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.
        :return: list[SubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'body', 'plan_id', 'subscription_filters']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'plan_id' in params:
            query_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'subscription_filters' in params:
            query_params.append(('subscription_filters', params['subscription_filters']))  # noqa: E501
            collection_formats['subscription_filters'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'flat_fee_behavior' in params:
            form_params.append(('flat_fee_behavior', params['flat_fee_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501
        if 'flat_fee_behavior' in params:
            form_params.append(('flat_fee_behavior', params['flat_fee_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/cancel/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[SubscriptionRecord]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_components_change_prepaid_units_create(self, body, metric_id, subscription_id,
                                                                 **kwargs):  # noqa: E501
        """app_subscriptions_components_change_prepaid_units_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_components_change_prepaid_units_create(body, metric_id, subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ChangePrepaidUnitsRequest body: (required)
        :param str metric_id: The ID of the metric to alter the prepaid usage for. (required)
        :param str subscription_id: The ID of the subscription which will have its plans switched. (required)
        :return: SubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_subscriptions_components_change_prepaid_units_create_with_http_info(body, metric_id,
                                                                                                subscription_id,
                                                                                                **kwargs)  # noqa: E501
        else:
            (data) = self.app_subscriptions_components_change_prepaid_units_create_with_http_info(body, metric_id,
                                                                                                  subscription_id,
                                                                                                  **kwargs)  # noqa: E501
            return data

    def app_subscriptions_components_change_prepaid_units_create_with_http_info(self, body, metric_id, subscription_id,
                                                                                **kwargs):  # noqa: E501
        """app_subscriptions_components_change_prepaid_units_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_components_change_prepaid_units_create_with_http_info(body, metric_id, subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ChangePrepaidUnitsRequest body: (required)
        :param str metric_id: The ID of the metric to alter the prepaid usage for. (required)
        :param str subscription_id: The ID of the subscription which will have its plans switched. (required)
        :return: SubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'metric_id', 'subscription_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_subscriptions_components_change_prepaid_units_create" % 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 `app_subscriptions_components_change_prepaid_units_create`")  # noqa: E501
        # verify the required parameter 'metric_id' is set
        if ('metric_id' not in params or
                params['metric_id'] is None):
            raise ValueError(
                "Missing the required parameter `metric_id` when calling `app_subscriptions_components_change_prepaid_units_create`")  # noqa: E501
        # verify the required parameter 'subscription_id' is set
        if ('subscription_id' not in params or
                params['subscription_id'] is None):
            raise ValueError(
                "Missing the required parameter `subscription_id` when calling `app_subscriptions_components_change_prepaid_units_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'units' in params:
            form_params.append(('units', params['units']))  # noqa: E501
        if 'invoice_now' in params:
            form_params.append(('invoice_now', params['invoice_now']))  # noqa: E501
        if 'units' in params:
            form_params.append(('units', params['units']))  # noqa: E501
        if 'invoice_now' in params:
            form_params.append(('invoice_now', params['invoice_now']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/{subscription_id}/components/{metric_id}/change_prepaid_units/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriptionRecord',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_create(self, body, **kwargs):  # noqa: E501
        """app_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_subscriptions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SubscriptionRecordCreateRequest body: (required)
        :return: SubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'auto_renew' in params:
            form_params.append(('auto_renew', params['auto_renew']))  # noqa: E501
        if 'is_new' in params:
            form_params.append(('is_new', params['is_new']))  # noqa: E501
        if 'subscription_filters' in params:
            form_params.append(('subscription_filters', params['subscription_filters']))  # noqa: E501
            collection_formats['subscription_filters'] = 'multi'  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'component_fixed_charges_initial_units' in params:
            form_params.append(('component_fixed_charges_initial_units',
                                params['component_fixed_charges_initial_units']))  # noqa: E501
            collection_formats['component_fixed_charges_initial_units'] = 'multi'  # noqa: E501
        if 'metadata' in params:
            form_params.append(('metadata', params['metadata']))  # noqa: E501
        if 'start_date' in params:
            form_params.append(('start_date', params['start_date']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'auto_renew' in params:
            form_params.append(('auto_renew', params['auto_renew']))  # noqa: E501
        if 'is_new' in params:
            form_params.append(('is_new', params['is_new']))  # noqa: E501
        if 'subscription_filters' in params:
            form_params.append(('subscription_filters', params['subscription_filters']))  # noqa: E501
            collection_formats['subscription_filters'] = 'multi'  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'component_fixed_charges_initial_units' in params:
            form_params.append(('component_fixed_charges_initial_units',
                                params['component_fixed_charges_initial_units']))  # noqa: E501
            collection_formats['component_fixed_charges_initial_units'] = 'multi'  # noqa: E501
        if 'metadata' in params:
            form_params.append(('metadata', params['metadata']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriptionRecord',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_get_price_for_extension_create(self, body, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_get_price_for_extension_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_get_price_for_extension_create(body, subscription_id, async_req=True)
        >>> result = thread.get()

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

    def app_subscriptions_get_price_for_extension_create_with_http_info(self, body, subscription_id,
                                                                        **kwargs):  # noqa: E501
        """app_subscriptions_get_price_for_extension_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_get_price_for_extension_create_with_http_info(body, subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UnitMetricExtensionRequest body: (required)
        :param str subscription_id: (required)
        :return: Price
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method app_subscriptions_get_price_for_extension_create" % 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 `app_subscriptions_get_price_for_extension_create`")  # noqa: E501
        # verify the required parameter 'subscription_id' is set
        if ('subscription_id' not in params or
                params['subscription_id'] is None):
            raise ValueError(
                "Missing the required parameter `subscription_id` when calling `app_subscriptions_get_price_for_extension_create`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'metric_id' in params:
            form_params.append(('metric_id', params['metric_id']))  # noqa: E501
        if 'units' in params:
            form_params.append(('units', params['units']))  # noqa: E501
        if 'metric_id' in params:
            form_params.append(('metric_id', params['metric_id']))  # noqa: E501
        if 'units' in params:
            form_params.append(('units', params['units']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/{subscription_id}/get_price_for_extension/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Price',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_get_price_for_renewal_retrieve(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_get_price_for_renewal_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_get_price_for_renewal_retrieve(subscription_id, async_req=True)
        >>> result = thread.get()

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

    def app_subscriptions_get_price_for_renewal_retrieve_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_get_price_for_renewal_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_get_price_for_renewal_retrieve_with_http_info(subscription_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'subscription_id' in params:
            path_params['subscription_id'] = params['subscription_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/{subscription_id}/get_price_for_renewal/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Price',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_list(self, customer_id, **kwargs):  # noqa: E501
        """app_subscriptions_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_list(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: Filter to a specific customer. (required)
        :param str plan_id: Filter to a specific plan.
        :param datetime range_end: If specified, will only return subscriptions with a start date before this date.
        :param datetime range_start: If specified, will only return subscriptions with an end date after this date.
        :param list[str] status: Filter to a specific set of subscription statuses. Defaults to active.
        :param list[SubscriptionFilterRequest] subscription_filters: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.
        :return: list[SubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_subscriptions_list_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_subscriptions_list_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def app_subscriptions_list_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """app_subscriptions_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_list_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: Filter to a specific customer. (required)
        :param str plan_id: Filter to a specific plan.
        :param datetime range_end: If specified, will only return subscriptions with a start date before this date.
        :param datetime range_start: If specified, will only return subscriptions with an end date after this date.
        :param list[str] status: Filter to a specific set of subscription statuses. Defaults to active.
        :param list[SubscriptionFilterRequest] subscription_filters: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.
        :return: list[SubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'plan_id', 'range_end', 'range_start', 'status',
                      'subscription_filters']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'plan_id' in params:
            query_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'range_end' in params:
            query_params.append(('range_end', params['range_end']))  # noqa: E501
        if 'range_start' in params:
            query_params.append(('range_start', params['range_start']))  # noqa: E501
        if 'status' in params:
            query_params.append(('status', params['status']))  # noqa: E501
            collection_formats['status'] = 'multi'  # noqa: E501
        if 'subscription_filters' in params:
            query_params.append(('subscription_filters', params['subscription_filters']))  # noqa: E501
            collection_formats['subscription_filters'] = 'multi'  # 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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[SubscriptionRecord]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_retrieve(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_retrieve(subscription_id, async_req=True)
        >>> result = thread.get()

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

    def app_subscriptions_retrieve_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_retrieve  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_retrieve_with_http_info(subscription_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'subscription_id' in params:
            path_params['subscription_id'] = params['subscription_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/{subscription_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriptionRecord',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_switch_plan_create(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_switch_plan_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_switch_plan_create(subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subscription_id: The ID of the subscription which will have its plans switched. (required)
        :param SubscriptionRecordSwitchPlanRequest body:
        :return: SubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_subscriptions_switch_plan_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_subscriptions_switch_plan_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
            return data

    def app_subscriptions_switch_plan_create_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """app_subscriptions_switch_plan_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_switch_plan_create_with_http_info(subscription_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subscription_id: The ID of the subscription which will have its plans switched. (required)
        :param SubscriptionRecordSwitchPlanRequest body:
        :return: SubscriptionRecord
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'switch_plan_id' in params:
            form_params.append(('switch_plan_id', params['switch_plan_id']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'component_fixed_charges_initial_units' in params:
            form_params.append(('component_fixed_charges_initial_units',
                                params['component_fixed_charges_initial_units']))  # noqa: E501
            collection_formats['component_fixed_charges_initial_units'] = 'multi'  # noqa: E501
        if 'switch_plan_id' in params:
            form_params.append(('switch_plan_id', params['switch_plan_id']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'component_fixed_charges_initial_units' in params:
            form_params.append(('component_fixed_charges_initial_units',
                                params['component_fixed_charges_initial_units']))  # noqa: E501
            collection_formats['component_fixed_charges_initial_units'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/{subscription_id}/switch_plan/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriptionRecord',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_subscriptions_update_create(self, customer_id, plan_id, **kwargs):  # noqa: E501
        """app_subscriptions_update_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_update_create(customer_id, plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: Filter to a specific customer. (required)
        :param str plan_id: Filter to a specific plan. (required)
        :param SubscriptionRecordUpdateSerializerOldRequest body:
        :param list[SubscriptionFilterRequest] subscription_filters: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.
        :return: list[SubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.app_subscriptions_update_create_with_http_info(customer_id, plan_id, **kwargs)  # noqa: E501
        else:
            (data) = self.app_subscriptions_update_create_with_http_info(customer_id, plan_id, **kwargs)  # noqa: E501
            return data

    def app_subscriptions_update_create_with_http_info(self, customer_id, plan_id, **kwargs):  # noqa: E501
        """app_subscriptions_update_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_subscriptions_update_create_with_http_info(customer_id, plan_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: Filter to a specific customer. (required)
        :param str plan_id: Filter to a specific plan. (required)
        :param SubscriptionRecordUpdateSerializerOldRequest body:
        :param list[SubscriptionFilterRequest] subscription_filters: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.
        :return: list[SubscriptionRecord]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'plan_id', 'body', 'subscription_filters']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'plan_id' in params:
            query_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'subscription_filters' in params:
            query_params.append(('subscription_filters', params['subscription_filters']))  # noqa: E501
            collection_formats['subscription_filters'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'replace_plan_id' in params:
            form_params.append(('replace_plan_id', params['replace_plan_id']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'turn_off_auto_renew' in params:
            form_params.append(('turn_off_auto_renew', params['turn_off_auto_renew']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501
        if 'replace_plan_id' in params:
            form_params.append(('replace_plan_id', params['replace_plan_id']))  # noqa: E501
        if 'invoicing_behavior' in params:
            form_params.append(('invoicing_behavior', params['invoicing_behavior']))  # noqa: E501
        if 'usage_behavior' in params:
            form_params.append(('usage_behavior', params['usage_behavior']))  # noqa: E501
        if 'turn_off_auto_renew' in params:
            form_params.append(('turn_off_auto_renew', params['turn_off_auto_renew']))  # noqa: E501
        if 'end_date' in params:
            form_params.append(('end_date', params['end_date']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/subscriptions/update/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[SubscriptionRecord]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_switch_organization_create(self, body, **kwargs):  # noqa: E501
        """app_switch_organization_create  # noqa: E501

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

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

    def app_switch_organization_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_switch_organization_create  # noqa: E501

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

        :param async_req bool
        :param ChangeUserOrganizationRequestRequest body: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'transfer_to_organization_id' in params:
            form_params.append(('transfer_to_organization_id', params['transfer_to_organization_id']))  # noqa: E501
        if 'transfer_to_organization_id' in params:
            form_params.append(('transfer_to_organization_id', params['transfer_to_organization_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/switch_organization/', 'POST',
            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_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        Pagination-enabled endpoint for retrieving an organization's event stream.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_timezones_retrieve(async_req=True)
        >>> result = thread.get()

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

    def app_timezones_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """app_timezones_retrieve  # noqa: E501

        Pagination-enabled endpoint for retrieving an organization's event stream.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_timezones_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/timezones/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TimezonesResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_transfer_subscriptions_create(self, body, **kwargs):  # noqa: E501
        """app_transfer_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_transfer_subscriptions_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_transfer_subscriptions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_transfer_subscriptions_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_transfer_subscriptions_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param TransferSubscriptionsRequestRequest body: (required)
        :return: TransferSubscriptionsSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501
        if 'end_now' in params:
            form_params.append(('end_now', params['end_now']))  # noqa: E501
        if 'source' in params:
            form_params.append(('source', params['source']))  # noqa: E501
        if 'end_now' in params:
            form_params.append(('end_now', params['end_now']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/transfer_subscriptions/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TransferSubscriptionsSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_usage_alerts_create(self, body, **kwargs):  # noqa: E501
        """app_usage_alerts_create  # noqa: E501

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_usage_alerts_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_usage_alerts_create  # noqa: E501

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UsageAlertCreateRequest body: (required)
        :return: UsageAlertCreate
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'metric_id' in params:
            form_params.append(('metric_id', params['metric_id']))  # noqa: E501
        if 'plan_version_id' in params:
            form_params.append(('plan_version_id', params['plan_version_id']))  # noqa: E501
        if 'threshold' in params:
            form_params.append(('threshold', params['threshold']))  # noqa: E501
        if 'metric_id' in params:
            form_params.append(('metric_id', params['metric_id']))  # noqa: E501
        if 'plan_version_id' in params:
            form_params.append(('plan_version_id', params['plan_version_id']))  # noqa: E501
        if 'threshold' in params:
            form_params.append(('threshold', params['threshold']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/usage_alerts/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='UsageAlertCreate',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_usage_alerts_destroy(self, usage_alert_id, **kwargs):  # noqa: E501
        """app_usage_alerts_destroy  # noqa: E501

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_destroy(usage_alert_id, async_req=True)
        >>> result = thread.get()

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

    def app_usage_alerts_destroy_with_http_info(self, usage_alert_id, **kwargs):  # noqa: E501
        """app_usage_alerts_destroy  # noqa: E501

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_destroy_with_http_info(usage_alert_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/usage_alerts/{usage_alert_id}/', '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_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_list(async_req=True)
        >>> result = thread.get()

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

    def app_usage_alerts_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_usage_alerts_list  # noqa: E501

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[UsageAlert]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/usage_alerts/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[UsageAlert]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_usage_alerts_retrieve(self, usage_alert_id, **kwargs):  # noqa: E501
        """app_usage_alerts_retrieve  # noqa: E501

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_retrieve(usage_alert_id, async_req=True)
        >>> result = thread.get()

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

    def app_usage_alerts_retrieve_with_http_info(self, usage_alert_id, **kwargs):  # noqa: E501
        """app_usage_alerts_retrieve  # noqa: E501

        ViewSet for viewing and editing UsageAlerts.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_usage_alerts_retrieve_with_http_info(usage_alert_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'usage_alert_id' in params:
            path_params['usage_alert_id'] = params['usage_alert_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/usage_alerts/{usage_alert_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='UsageAlert',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_user_password_reset_create(self, body, **kwargs):  # noqa: E501
        """app_user_password_reset_create  # noqa: E501

        Verifies the token and resets the password.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_user_password_reset_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_user_password_reset_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_user_password_reset_create  # noqa: E501

        Verifies the token and resets the password.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_user_password_reset_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ResetPasswordRequestRequest body: (required)
        :return: ResetPasswordSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'user_id' in params:
            form_params.append(('userId', params['user_id']))  # noqa: E501
        if 'password' in params:
            form_params.append(('password', params['password']))  # noqa: E501
        if 'token' in params:
            form_params.append(('token', params['token']))  # noqa: E501
        if 'user_id' in params:
            form_params.append(('userId', params['user_id']))  # noqa: E501
        if 'password' in params:
            form_params.append(('password', params['password']))  # noqa: E501
        if 'token' in params:
            form_params.append(('token', params['token']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

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

        return self.api_client.call_api(
            '/app/user/password/reset/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResetPasswordSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_user_password_reset_init_create(self, body, **kwargs):  # noqa: E501
        """app_user_password_reset_init_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_user_password_reset_init_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_user_password_reset_init_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_user_password_reset_init_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_user_password_reset_init_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param EmailRequest body: (required)
        :return: InitResetPasswordSuccess
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

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

        return self.api_client.call_api(
            '/app/user/password/reset/init/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InitResetPasswordSuccess',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_users_create(self, body, **kwargs):  # noqa: E501
        """app_users_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_users_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_users_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_users_create  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_users_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UserRequest body: (required)
        :return: User
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'username' in params:
            form_params.append(('username', params['username']))  # noqa: E501
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501
        if 'organization_name' in params:
            form_params.append(('organization_name', params['organization_name']))  # noqa: E501
        if 'organization_id' in params:
            form_params.append(('organization_id', params['organization_id']))  # noqa: E501
        if 'username' in params:
            form_params.append(('username', params['username']))  # noqa: E501
        if 'email' in params:
            form_params.append(('email', params['email']))  # noqa: E501
        if 'organization_name' in params:
            form_params.append(('organization_name', params['organization_name']))  # noqa: E501
        if 'organization_id' in params:
            form_params.append(('organization_id', params['organization_id']))  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

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

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

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_users_list(async_req=True)
        >>> result = thread.get()

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

    def app_users_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_users_list  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_users_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[User]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/users/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[User]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_webhooks_create(self, body, **kwargs):  # noqa: E501
        """app_webhooks_create  # noqa: E501

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_create(body, async_req=True)
        >>> result = thread.get()

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

    def app_webhooks_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """app_webhooks_create  # noqa: E501

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param WebhookEndpointRequest body: (required)
        :return: WebhookEndpoint
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'name' in params:
            form_params.append(('name', params['name']))  # noqa: E501
        if 'webhook_url' in params:
            form_params.append(('webhook_url', params['webhook_url']))  # noqa: E501
        if 'triggers_in' in params:
            form_params.append(('triggers_in', params['triggers_in']))  # noqa: E501
            collection_formats['triggers_in'] = 'multi'  # noqa: E501
        if 'name' in params:
            form_params.append(('name', params['name']))  # noqa: E501
        if 'webhook_url' in params:
            form_params.append(('webhook_url', params['webhook_url']))  # noqa: E501
        if 'triggers_in' in params:
            form_params.append(('triggers_in', params['triggers_in']))  # noqa: E501
            collection_formats['triggers_in'] = 'multi'  # noqa: E501

        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', 'application/x-www-form-urlencoded', 'multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/webhooks/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='WebhookEndpoint',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_webhooks_destroy(self, webhook_endpoint_id, **kwargs):  # noqa: E501
        """app_webhooks_destroy  # noqa: E501

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_destroy(webhook_endpoint_id, async_req=True)
        >>> result = thread.get()

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

    def app_webhooks_destroy_with_http_info(self, webhook_endpoint_id, **kwargs):  # noqa: E501
        """app_webhooks_destroy  # noqa: E501

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_destroy_with_http_info(webhook_endpoint_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/webhooks/{webhook_endpoint_id}/', '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_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_list(async_req=True)
        >>> result = thread.get()

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

    def app_webhooks_list_with_http_info(self, **kwargs):  # noqa: E501
        """app_webhooks_list  # noqa: E501

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[WebhookEndpoint]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/webhooks/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[WebhookEndpoint]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def app_webhooks_retrieve(self, webhook_endpoint_id, **kwargs):  # noqa: E501
        """app_webhooks_retrieve  # noqa: E501

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_retrieve(webhook_endpoint_id, async_req=True)
        >>> result = thread.get()

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

    def app_webhooks_retrieve_with_http_info(self, webhook_endpoint_id, **kwargs):  # noqa: E501
        """app_webhooks_retrieve  # noqa: E501

        API endpoint that allows alerts to be viewed or edited.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.app_webhooks_retrieve_with_http_info(webhook_endpoint_id, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}
        if 'webhook_endpoint_id' in params:
            path_params['webhook_endpoint_id'] = params['webhook_endpoint_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 = ['OrganizationApiKeyAuth', 'knoxTokenAuth']  # noqa: E501

        return self.api_client.call_api(
            '/app/webhooks/{webhook_endpoint_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='WebhookEndpoint',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
