# coding: utf-8

"""
    BTCPay Greenfield API

    A full API to use your BTCPay Server  # noqa: E501

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


class InvoicesApi(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 invoices_activate_payment_method(self, store_id, invoice_id, payment_method, **kwargs):  # noqa: E501
        """Activate Payment Method  # noqa: E501

        Activate an invoice payment method (if lazy payments mode is enabled)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_activate_payment_method(store_id, invoice_id, payment_method, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to query (required)
        :param str invoice_id: The invoice to update (required)
        :param str payment_method: The payment method to activate (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_activate_payment_method_with_http_info(store_id, invoice_id, payment_method, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_activate_payment_method_with_http_info(store_id, invoice_id, payment_method, **kwargs)  # noqa: E501
            return data

    def invoices_activate_payment_method_with_http_info(self, store_id, invoice_id, payment_method, **kwargs):  # noqa: E501
        """Activate Payment Method  # noqa: E501

        Activate an invoice payment method (if lazy payments mode is enabled)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_activate_payment_method_with_http_info(store_id, invoice_id, payment_method, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to query (required)
        :param str invoice_id: The invoice to update (required)
        :param str payment_method: The payment method to activate (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'store_id' in params:
            path_params['storeId'] = params['store_id']  # noqa: E501
        if 'invoice_id' in params:
            path_params['invoiceId'] = params['invoice_id']  # noqa: E501
        if 'payment_method' in params:
            path_params['paymentMethod'] = params['payment_method']  # 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 = ['API_Key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods/{paymentMethod}/activate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def invoices_archive_invoice(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Archive invoice  # noqa: E501

        Archives the specified invoice.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_archive_invoice(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store the invoice belongs to (required)
        :param str invoice_id: The invoice to remove (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_archive_invoice_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_archive_invoice_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
            return data

    def invoices_archive_invoice_with_http_info(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Archive invoice  # noqa: E501

        Archives the specified invoice.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_archive_invoice_with_http_info(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store the invoice belongs to (required)
        :param str invoice_id: The invoice to remove (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'store_id' in params:
            path_params['storeId'] = params['store_id']  # noqa: E501
        if 'invoice_id' in params:
            path_params['invoiceId'] = 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 = ['API_Key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices/{invoiceId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def invoices_create_invoice(self, body, store_id, **kwargs):  # noqa: E501
        """Create a new invoice  # noqa: E501

        Create a new invoice  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_create_invoice(body, store_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateInvoiceRequest body: (required)
        :param str store_id: The store to query (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_create_invoice_with_http_info(body, store_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_create_invoice_with_http_info(body, store_id, **kwargs)  # noqa: E501
            return data

    def invoices_create_invoice_with_http_info(self, body, store_id, **kwargs):  # noqa: E501
        """Create a new invoice  # noqa: E501

        Create a new invoice  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_create_invoice_with_http_info(body, store_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateInvoiceRequest body: (required)
        :param str store_id: The store to query (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'store_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 invoices_create_invoice" % 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 `invoices_create_invoice`")  # noqa: E501
        # verify the required parameter 'store_id' is set
        if ('store_id' not in params or
                params['store_id'] is None):
            raise ValueError("Missing the required parameter `store_id` when calling `invoices_create_invoice`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceData',  # 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 invoices_get_invoice(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Get invoice  # noqa: E501

        View information about the specified invoice  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_get_invoice(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to fetch (required)
        :param str invoice_id: The invoice to fetch (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_get_invoice_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_get_invoice_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
            return data

    def invoices_get_invoice_with_http_info(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Get invoice  # noqa: E501

        View information about the specified invoice  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_get_invoice_with_http_info(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to fetch (required)
        :param str invoice_id: The invoice to fetch (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'store_id' in params:
            path_params['storeId'] = params['store_id']  # noqa: E501
        if 'invoice_id' in params:
            path_params['invoiceId'] = 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 = ['API_Key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices/{invoiceId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceData',  # 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 invoices_get_invoice_payment_methods(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Get invoice payment methods  # noqa: E501

        View information about the specified invoice's payment methods  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_get_invoice_payment_methods(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to fetch (required)
        :param str invoice_id: The invoice to fetch (required)
        :param bool only_accounted_payments: If default or true, only returns payments which are accounted (in Bitcoin, this mean not returning RBF'd or double spent payments)
        :return: list[InvoicePaymentMethodDataModel]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_get_invoice_payment_methods_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_get_invoice_payment_methods_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
            return data

    def invoices_get_invoice_payment_methods_with_http_info(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Get invoice payment methods  # noqa: E501

        View information about the specified invoice's payment methods  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_get_invoice_payment_methods_with_http_info(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to fetch (required)
        :param str invoice_id: The invoice to fetch (required)
        :param bool only_accounted_payments: If default or true, only returns payments which are accounted (in Bitcoin, this mean not returning RBF'd or double spent payments)
        :return: list[InvoicePaymentMethodDataModel]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

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

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[InvoicePaymentMethodDataModel]',  # 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 invoices_get_invoices(self, store_id, **kwargs):  # noqa: E501
        """Get invoices  # noqa: E501

        View information about the existing invoices  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_get_invoices(store_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to query (required)
        :param list[str] order_id: Array of OrderIds to fetch the invoices for
        :param str text_search: A term that can help locating specific invoices.
        :param float skip: Number of records to skip
        :param float take: Number of records returned in response
        :return: InvoiceDataList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_get_invoices_with_http_info(store_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_get_invoices_with_http_info(store_id, **kwargs)  # noqa: E501
            return data

    def invoices_get_invoices_with_http_info(self, store_id, **kwargs):  # noqa: E501
        """Get invoices  # noqa: E501

        View information about the existing invoices  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_get_invoices_with_http_info(store_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to query (required)
        :param list[str] order_id: Array of OrderIds to fetch the invoices for
        :param str text_search: A term that can help locating specific invoices.
        :param float skip: Number of records to skip
        :param float take: Number of records returned in response
        :return: InvoiceDataList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'order_id' in params:
            query_params.append(('orderId', params['order_id']))  # noqa: E501
            collection_formats['orderId'] = 'multi'  # noqa: E501
        if 'text_search' in params:
            query_params.append(('textSearch', params['text_search']))  # noqa: E501
        if 'skip' in params:
            query_params.append(('skip', params['skip']))  # noqa: E501
        if 'take' in params:
            query_params.append(('take', params['take']))  # 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 = ['API_Key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceDataList',  # 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 invoices_mark_invoice_status(self, body, store_id, invoice_id, **kwargs):  # noqa: E501
        """Mark invoice status  # noqa: E501

        Mark an invoice as invalid or settled.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_mark_invoice_status(body, store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MarkInvoiceStatusRequest body: (required)
        :param str store_id: The store to query (required)
        :param str invoice_id: The invoice to update (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_mark_invoice_status_with_http_info(body, store_id, invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_mark_invoice_status_with_http_info(body, store_id, invoice_id, **kwargs)  # noqa: E501
            return data

    def invoices_mark_invoice_status_with_http_info(self, body, store_id, invoice_id, **kwargs):  # noqa: E501
        """Mark invoice status  # noqa: E501

        Mark an invoice as invalid or settled.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_mark_invoice_status_with_http_info(body, store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MarkInvoiceStatusRequest body: (required)
        :param str store_id: The store to query (required)
        :param str invoice_id: The invoice to update (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices/{invoiceId}/status', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceData',  # 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 invoices_unarchive_invoice(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Unarchive invoice  # noqa: E501

        Unarchive an invoice  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_unarchive_invoice(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to query (required)
        :param str invoice_id: The invoice to update (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_unarchive_invoice_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_unarchive_invoice_with_http_info(store_id, invoice_id, **kwargs)  # noqa: E501
            return data

    def invoices_unarchive_invoice_with_http_info(self, store_id, invoice_id, **kwargs):  # noqa: E501
        """Unarchive invoice  # noqa: E501

        Unarchive an invoice  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_unarchive_invoice_with_http_info(store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str store_id: The store to query (required)
        :param str invoice_id: The invoice to update (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'store_id' in params:
            path_params['storeId'] = params['store_id']  # noqa: E501
        if 'invoice_id' in params:
            path_params['invoiceId'] = 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 = ['API_Key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices/{invoiceId}/unarchive', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceData',  # 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 invoices_update_invoice(self, body, store_id, invoice_id, **kwargs):  # noqa: E501
        """Update invoice  # noqa: E501

        Updates the specified invoice.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_update_invoice(body, store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UpdateInvoiceRequest body: (required)
        :param str store_id: The store the invoice belongs to (required)
        :param str invoice_id: The invoice to update (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.invoices_update_invoice_with_http_info(body, store_id, invoice_id, **kwargs)  # noqa: E501
        else:
            (data) = self.invoices_update_invoice_with_http_info(body, store_id, invoice_id, **kwargs)  # noqa: E501
            return data

    def invoices_update_invoice_with_http_info(self, body, store_id, invoice_id, **kwargs):  # noqa: E501
        """Update invoice  # noqa: E501

        Updates the specified invoice.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.invoices_update_invoice_with_http_info(body, store_id, invoice_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UpdateInvoiceRequest body: (required)
        :param str store_id: The store the invoice belongs to (required)
        :param str invoice_id: The invoice to update (required)
        :return: InvoiceData
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/api/v1/stores/{storeId}/invoices/{invoiceId}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceData',  # 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)
