# 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 ApiApi(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 api_credits_create(self, body, **kwargs):  # noqa: E501
        """api_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.api_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.api_credits_create_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.api_credits_create_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def api_credits_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_credits_list(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_credits_list_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_credits_list_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def api_credits_list_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_credits_retrieve(self, credit_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_credits_retrieve_with_http_info(credit_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_credits_retrieve_with_http_info(credit_id, **kwargs)  # noqa: E501
            return data

    def api_credits_retrieve_with_http_info(self, credit_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_credits_update_create(self, credit_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_credits_update_create_with_http_info(credit_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_credits_update_create_with_http_info(credit_id, **kwargs)  # noqa: E501
            return data

    def api_credits_update_create_with_http_info(self, credit_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_credits_void_create(self, credit_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_credits_void_create_with_http_info(credit_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_credits_void_create_with_http_info(credit_id, **kwargs)  # noqa: E501
            return data

    def api_credits_void_create_with_http_info(self, credit_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_customer_feature_access_list(self, customer_id, feature_name, **kwargs):  # noqa: E501
        """api_customer_feature_access_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.api_customer_feature_access_list(customer_id, feature_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str feature_name: Name of the feature to check access for. (required)
        :param list[SubscriptionFilterRequest] subscription_filters: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. This must be passed in as a stringified JSON object.
        :return: list[GetFeatureAccess]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_customer_feature_access_list_with_http_info(customer_id, feature_name,
                                                                        **kwargs)  # noqa: E501
        else:
            (data) = self.api_customer_feature_access_list_with_http_info(customer_id, feature_name,
                                                                          **kwargs)  # noqa: E501
            return data

    def api_customer_feature_access_list_with_http_info(self, customer_id, feature_name, **kwargs):  # noqa: E501
        """api_customer_feature_access_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.api_customer_feature_access_list_with_http_info(customer_id, feature_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str feature_name: Name of the feature to check access for. (required)
        :param list[SubscriptionFilterRequest] subscription_filters: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. This must be passed in as a stringified JSON object.
        :return: list[GetFeatureAccess]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'feature_name', '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 api_customer_feature_access_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 `api_customer_feature_access_list`")  # noqa: E501
        # verify the required parameter 'feature_name' is set
        if ('feature_name' not in params or
                params['feature_name'] is None):
            raise ValueError(
                "Missing the required parameter `feature_name` when calling `api_customer_feature_access_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 'feature_name' in params:
            query_params.append(('feature_name', params['feature_name']))  # 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']  # noqa: E501

        return self.api_client.call_api(
            '/api/customer_feature_access/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[GetFeatureAccess]',  # 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 api_customer_metric_access_list(self, customer_id, **kwargs):  # noqa: E501
        """api_customer_metric_access_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.api_customer_metric_access_list(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str event_name: The name of the event you are checking access for.
        :param str metric_id: The metric_id of the metric you are checking access for. Please note that you must porovide exactly one of event_name and metric_id are mutually; a validation error will be thrown if both or none are provided.
        :param list[SubscriptionFilterRequest] subscription_filters: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. This must be passed in as a stringified JSON object.
        :return: list[GetEventAccess]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_customer_metric_access_list_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_customer_metric_access_list_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def api_customer_metric_access_list_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """api_customer_metric_access_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.api_customer_metric_access_list_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str event_name: The name of the event you are checking access for.
        :param str metric_id: The metric_id of the metric you are checking access for. Please note that you must porovide exactly one of event_name and metric_id are mutually; a validation error will be thrown if both or none are provided.
        :param list[SubscriptionFilterRequest] subscription_filters: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. This must be passed in as a stringified JSON object.
        :return: list[GetEventAccess]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'event_name', 'metric_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 api_customer_metric_access_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 `api_customer_metric_access_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 'event_name' in params:
            query_params.append(('event_name', params['event_name']))  # noqa: E501
        if 'metric_id' in params:
            query_params.append(('metric_id', params['metric_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 = {}

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

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

        return self.api_client.call_api(
            '/api/customer_metric_access/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[GetEventAccess]',  # 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 api_customers_cost_analysis_retrieve(self, customer_id, end_date, start_date, **kwargs):  # noqa: E501
        """api_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.api_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.api_customers_cost_analysis_retrieve_with_http_info(customer_id, end_date, start_date,
                                                                            **kwargs)  # noqa: E501
        else:
            (data) = self.api_customers_cost_analysis_retrieve_with_http_info(customer_id, end_date, start_date,
                                                                              **kwargs)  # noqa: E501
            return data

    def api_customers_cost_analysis_retrieve_with_http_info(self, customer_id, end_date, start_date,
                                                            **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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 `api_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 `api_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(
            '/api/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 api_customers_create(self, body, **kwargs):  # noqa: E501
        """api_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.api_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.api_customers_create_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.api_customers_create_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def api_customers_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_customers_delete_create(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_customers_delete_create_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_customers_delete_create_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def api_customers_delete_create_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_customers_draft_invoice_retrieve(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_customers_draft_invoice_retrieve_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_customers_draft_invoice_retrieve_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def api_customers_draft_invoice_retrieve_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_customers_list(self, **kwargs):  # noqa: E501
        """api_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.api_customers_list(async_req=True)
        >>> result = thread.get()

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

    def api_customers_list_with_http_info(self, **kwargs):  # noqa: E501
        """api_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.api_customers_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[Customer]
                 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 api_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(
            '/api/customers/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[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 api_customers_retrieve(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_customers_retrieve(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: (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.api_customers_retrieve_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_customers_retrieve_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def api_customers_retrieve_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_customers_retrieve_with_http_info(customer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: (required)
        :return: Customer
                 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 api_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 `api_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(
            '/api/customers/{customer_id}/', 'GET',
            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 api_feature_access_retrieve(self, customer_id, feature_id, **kwargs):  # noqa: E501
        """api_feature_access_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.api_feature_access_retrieve(customer_id, feature_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str feature_id: The feature_id of the feature you want to check access for. (required)
        :param list[SubscriptionFilterRequest] subscription_filters: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. 
        :return: FeatureAccessResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_feature_access_retrieve_with_http_info(customer_id, feature_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_feature_access_retrieve_with_http_info(customer_id, feature_id, **kwargs)  # noqa: E501
            return data

    def api_feature_access_retrieve_with_http_info(self, customer_id, feature_id, **kwargs):  # noqa: E501
        """api_feature_access_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.api_feature_access_retrieve_with_http_info(customer_id, feature_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str feature_id: The feature_id of the feature you want to check access for. (required)
        :param list[SubscriptionFilterRequest] subscription_filters: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. 
        :return: FeatureAccessResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'feature_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 api_feature_access_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 `api_feature_access_retrieve`")  # noqa: E501
        # verify the required parameter 'feature_id' is set
        if ('feature_id' not in params or
                params['feature_id'] is None):
            raise ValueError(
                "Missing the required parameter `feature_id` when calling `api_feature_access_retrieve`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'feature_id' in params:
            query_params.append(('feature_id', params['feature_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 = {}

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

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

        return self.api_client.call_api(
            '/api/feature_access/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='FeatureAccessResponse',  # 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 api_healthcheck_retrieve(self, **kwargs):  # noqa: E501
        """api_healthcheck_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.api_healthcheck_retrieve(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :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.api_healthcheck_retrieve_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.api_healthcheck_retrieve_with_http_info(**kwargs)  # noqa: E501
            return data

    def api_healthcheck_retrieve_with_http_info(self, **kwargs):  # noqa: E501
        """api_healthcheck_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.api_healthcheck_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: None
                 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 api_healthcheck_retrieve" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        return self.api_client.call_api(
            '/api/healthcheck/', '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 api_invoices_list(self, **kwargs):  # noqa: E501
        """api_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.api_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[Invoice]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_invoices_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.api_invoices_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def api_invoices_list_with_http_info(self, **kwargs):  # noqa: E501
        """api_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.api_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[Invoice]
                 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 api_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(
            '/api/invoices/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Invoice]',  # noqa: E501
            auth_settings=auth_settings,
            async_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 api_invoices_partial_update(self, invoice_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_invoices_partial_update_with_http_info(invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_invoices_partial_update_with_http_info(invoice_id, **kwargs)  # noqa: E501
            return data

    def api_invoices_partial_update_with_http_info(self, invoice_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_invoices_pdf_url_retrieve(self, invoice_id, **kwargs):  # noqa: E501
        """api_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.api_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: Invoice
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_invoices_pdf_url_retrieve_with_http_info(invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_invoices_pdf_url_retrieve_with_http_info(invoice_id, **kwargs)  # noqa: E501
            return data

    def api_invoices_pdf_url_retrieve_with_http_info(self, invoice_id, **kwargs):  # noqa: E501
        """api_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.api_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: Invoice
                 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 api_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 `api_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(
            '/api/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='Invoice',  # 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 api_invoices_retrieve(self, invoice_id, **kwargs):  # noqa: E501
        """api_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.api_invoices_retrieve(invoice_id, async_req=True)
        >>> result = thread.get()

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

    def api_invoices_retrieve_with_http_info(self, invoice_id, **kwargs):  # noqa: E501
        """api_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.api_invoices_retrieve_with_http_info(invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str invoice_id: (required)
        :return: Invoice
                 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 api_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 `api_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(
            '/api/invoices/{invoice_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Invoice',  # 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 api_metric_access_retrieve(self, customer_id, metric_id, **kwargs):  # noqa: E501
        """api_metric_access_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.api_metric_access_retrieve(customer_id, metric_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str metric_id: The metric_id of the metric you want to check access for. (required)
        :param list[SubscriptionFilterRequest] subscription_filters: Used if you want to restrict the access check to only plans that fulfill certain subscription filter criteria. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. 
        :return: MetricAccessResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_metric_access_retrieve_with_http_info(customer_id, metric_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_metric_access_retrieve_with_http_info(customer_id, metric_id, **kwargs)  # noqa: E501
            return data

    def api_metric_access_retrieve_with_http_info(self, customer_id, metric_id, **kwargs):  # noqa: E501
        """api_metric_access_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.api_metric_access_retrieve_with_http_info(customer_id, metric_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str customer_id: The customer_id of the customer you want to check access. (required)
        :param str metric_id: The metric_id of the metric you want to check access for. (required)
        :param list[SubscriptionFilterRequest] subscription_filters: Used if you want to restrict the access check to only plans that fulfill certain subscription filter criteria. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. 
        :return: MetricAccessResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['customer_id', 'metric_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 api_metric_access_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 `api_metric_access_retrieve`")  # 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 `api_metric_access_retrieve`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'customer_id' in params:
            query_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'metric_id' in params:
            query_params.append(('metric_id', params['metric_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 = {}

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

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

        return self.api_client.call_api(
            '/api/metric_access/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MetricAccessResponse',  # 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 api_ping_retrieve(self, **kwargs):  # noqa: E501
        """api_ping_retrieve  # noqa: E501

        Ping the API to check if the API key is valid.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_ping_retrieve(async_req=True)
        >>> result = thread.get()

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

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

        Ping the API to check if the API key is valid.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_ping_retrieve_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ConfirmConnected
                 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 api_ping_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(
            '/api/ping/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ConfirmConnected',  # 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 api_plans_create(self, body, **kwargs):  # noqa: E501
        """api_plans_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.api_plans_create(body, async_req=True)
        >>> result = thread.get()

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

    def api_plans_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """api_plans_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.api_plans_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PlanRequest body: (required)
        :return: Plan
                 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 api_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 `api_plans_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 'plan_name' in params:
            form_params.append(('plan_name', params['plan_name']))  # noqa: E501
        if 'plan_duration' in params:
            form_params.append(('plan_duration', params['plan_duration']))  # noqa: E501
        if 'plan_description' in params:
            form_params.append(('plan_description', params['plan_description']))  # noqa: E501
        if 'external_links' in params:
            form_params.append(('external_links', params['external_links']))  # noqa: E501
            collection_formats['external_links'] = 'multi'  # noqa: E501
        if 'versions' in params:
            form_params.append(('versions', params['versions']))  # noqa: E501
            collection_formats['versions'] = 'multi'  # noqa: E501
        if 'plan_id' in params:
            form_params.append(('plan_id', params['plan_id']))  # noqa: E501
        if 'plan_name' in params:
            form_params.append(('plan_name', params['plan_name']))  # noqa: E501
        if 'plan_duration' in params:
            form_params.append(('plan_duration', params['plan_duration']))  # noqa: E501
        if 'plan_description' in params:
            form_params.append(('plan_description', params['plan_description']))  # noqa: E501
        if 'external_links' in params:
            form_params.append(('external_links', params['external_links']))  # noqa: E501
            collection_formats['external_links'] = 'multi'  # noqa: E501
        if 'versions' in params:
            form_params.append(('versions', params['versions']))  # noqa: E501
            collection_formats['versions'] = '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(
            '/api/plans/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Plan',  # 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 api_plans_get_plan_price_for_customer_create(self, body, plan_id, **kwargs):  # noqa: E501
        """api_plans_get_plan_price_for_customer_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.api_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.api_plans_get_plan_price_for_customer_create_with_http_info(body, plan_id,
                                                                                    **kwargs)  # noqa: E501
        else:
            (data) = self.api_plans_get_plan_price_for_customer_create_with_http_info(body, plan_id,
                                                                                      **kwargs)  # noqa: E501
            return data

    def api_plans_get_plan_price_for_customer_create_with_http_info(self, body, plan_id, **kwargs):  # noqa: E501
        """api_plans_get_plan_price_for_customer_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.api_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 api_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 `api_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 `api_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(
            '/api/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 api_plans_list(self, **kwargs):  # noqa: E501
        """api_plans_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.api_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[Plan]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_plans_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.api_plans_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def api_plans_list_with_http_info(self, **kwargs):  # noqa: E501
        """api_plans_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.api_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[Plan]
                 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 api_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(
            '/api/plans/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Plan]',  # 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 api_plans_retrieve(self, plan_id, **kwargs):  # noqa: E501
        """api_plans_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.api_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: Plan
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_plans_retrieve_with_http_info(plan_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_plans_retrieve_with_http_info(plan_id, **kwargs)  # noqa: E501
            return data

    def api_plans_retrieve_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """api_plans_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.api_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: Plan
                 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 api_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 `api_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(
            '/api/plans/{plan_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Plan',  # 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 api_subscriptions_add_create(self, body, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_add_create_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_add_create_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_add_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_addons_attach_create(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_addons_attach_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_addons_attach_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_addons_attach_create_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_addons_cancel_create(self, addon_id, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_addons_cancel_create_with_http_info(addon_id, subscription_id,
                                                                              **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_addons_cancel_create_with_http_info(addon_id, subscription_id,
                                                                                **kwargs)  # noqa: E501
            return data

    def api_subscriptions_addons_cancel_create_with_http_info(self, addon_id, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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 `api_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(
            '/api/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 api_subscriptions_cancel_create(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_cancel_create_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_cancel_create_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_cancel_create_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_components_change_prepaid_units_create(self, body, metric_id, subscription_id,
                                                                 **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_components_change_prepaid_units_create_with_http_info(body, metric_id,
                                                                                                subscription_id,
                                                                                                **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_components_change_prepaid_units_create_with_http_info(body, metric_id,
                                                                                                  subscription_id,
                                                                                                  **kwargs)  # noqa: E501
            return data

    def api_subscriptions_components_change_prepaid_units_create_with_http_info(self, body, metric_id, subscription_id,
                                                                                **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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 `api_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 `api_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(
            '/api/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 api_subscriptions_create(self, body, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_create_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_create_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_get_price_for_extension_create(self, body, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_get_price_for_extension_create_with_http_info(body, subscription_id,
                                                                                        **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_get_price_for_extension_create_with_http_info(body, subscription_id,
                                                                                          **kwargs)  # noqa: E501
            return data

    def api_subscriptions_get_price_for_extension_create_with_http_info(self, body, subscription_id,
                                                                        **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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 `api_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(
            '/api/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 api_subscriptions_get_price_for_renewal_retrieve(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_get_price_for_renewal_retrieve_with_http_info(subscription_id,
                                                                                        **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_get_price_for_renewal_retrieve_with_http_info(subscription_id,
                                                                                          **kwargs)  # noqa: E501
            return data

    def api_subscriptions_get_price_for_renewal_retrieve_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_list(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_list_with_http_info(customer_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_list_with_http_info(customer_id, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_list_with_http_info(self, customer_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_retrieve(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_retrieve_with_http_info(subscription_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_retrieve_with_http_info(subscription_id, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_retrieve_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_switch_plan_create(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_switch_plan_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_switch_plan_create_with_http_info(subscription_id, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_switch_plan_create_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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(
            '/api/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 api_subscriptions_update_create(self, customer_id, plan_id, **kwargs):  # noqa: E501
        """api_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.api_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.api_subscriptions_update_create_with_http_info(customer_id, plan_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_subscriptions_update_create_with_http_info(customer_id, plan_id, **kwargs)  # noqa: E501
            return data

    def api_subscriptions_update_create_with_http_info(self, customer_id, plan_id, **kwargs):  # noqa: E501
        """api_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.api_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 api_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 `api_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 `api_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(
            '/api/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 api_verify_idems_received_create(self, body, **kwargs):  # noqa: E501
        """api_verify_idems_received_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.api_verify_idems_received_create(body, async_req=True)
        >>> result = thread.get()

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

    def api_verify_idems_received_create_with_http_info(self, body, **kwargs):  # noqa: E501
        """api_verify_idems_received_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.api_verify_idems_received_create_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ConfirmIdemsReceivedRequestRequest body: (required)
        :return: ConfirmIdemsReceived
                 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 api_verify_idems_received_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 `api_verify_idems_received_create`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'idempotency_ids' in params:
            form_params.append(('idempotency_ids', params['idempotency_ids']))  # noqa: E501
            collection_formats['idempotency_ids'] = 'multi'  # noqa: E501
        if 'number_days_lookback' in params:
            form_params.append(('number_days_lookback', params['number_days_lookback']))  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_id']))  # noqa: E501
        if 'idempotency_ids' in params:
            form_params.append(('idempotency_ids', params['idempotency_ids']))  # noqa: E501
            collection_formats['idempotency_ids'] = 'multi'  # noqa: E501
        if 'number_days_lookback' in params:
            form_params.append(('number_days_lookback', params['number_days_lookback']))  # noqa: E501
        if 'customer_id' in params:
            form_params.append(('customer_id', params['customer_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(
            '/api/verify_idems_received/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ConfirmIdemsReceived',  # 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)
