# coding: utf-8

"""
    coinMerchant Api Documentation

    To generate an API key, please visit <a href='https://pay.coinsecure.in/payment-tools/api' target='_new' class='homeapi'>https://pay.coinsecure.in/payment-tools/api</a>.<br>Guidelines for use can be accessed at <a href='https://pay.coinsecure.in/api/guidelines'>https://pay.coinsecure.in/api/guidelines</a>.

    OpenAPI spec version: 1.0B
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
    
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient


class InvoiceDataApi(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):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    def get_canc_invoices(self, apikey, body, **kwargs):
        """
        GET ALL CANCELLED INVOICES
        Gets All Cancelled Invoice Details.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_canc_invoices(apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str apikey: Enter User Key (required)
        :param InvoiceIDFull body: Enter details to query Invoices (required)
        :return: SuccessInvoices
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['apikey', 'body']
        all_params.append('callback')

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

        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_canc_invoices`")
        # 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 `get_canc_invoices`")


        resource_path = '/invoice/getCancInvoices'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}
        if 'apikey' in params:
            header_params['apikey'] = params['apikey']

        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([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='SuccessInvoices',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_complete_invoices(self, apikey, body, **kwargs):
        """
        GET ALL COMPLETED INVOICES
        Gets All Completed Invoice Details.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_complete_invoices(apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str apikey: Enter User Key (required)
        :param InvoiceIDFull body: Enter details to query Invoices (required)
        :return: SuccessInvoices
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['apikey', 'body']
        all_params.append('callback')

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

        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_complete_invoices`")
        # 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 `get_complete_invoices`")


        resource_path = '/invoice/getCompleteInvoices'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}
        if 'apikey' in params:
            header_params['apikey'] = params['apikey']

        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([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='SuccessInvoices',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_conf_invoices(self, apikey, body, **kwargs):
        """
        GET ALL CONFIRMED INVOICES
        Gets All Confirmed Invoice Details.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_conf_invoices(apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str apikey: Enter User Key (required)
        :param InvoiceIDFull body: Enter details to query Invoices (required)
        :return: SuccessInvoices
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['apikey', 'body']
        all_params.append('callback')

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

        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_conf_invoices`")
        # 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 `get_conf_invoices`")


        resource_path = '/invoice/getConfInvoices'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}
        if 'apikey' in params:
            header_params['apikey'] = params['apikey']

        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([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='SuccessInvoices',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_invoice_from_id(self, invoice_id, apikey, **kwargs):
        """
        GET INVOICE FROM ID
        Gets Details of an Invoice ID.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_invoice_from_id(invoice_id, apikey, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str invoice_id:  (required)
        :param str apikey: Enter User Key (required)
        :return: SuccessInvoice
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['invoice_id', 'apikey']
        all_params.append('callback')

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


        resource_path = '/invoice/getInvoiceFromID/{invoiceID}'.replace('{format}', 'json')
        path_params = {}
        if 'invoice_id' in params:
            path_params['invoiceID'] = params['invoice_id']

        query_params = {}

        header_params = {}
        if 'apikey' in params:
            header_params['apikey'] = params['apikey']

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        response = self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='SuccessInvoice',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_paid_invoices(self, apikey, body, **kwargs):
        """
        GET ALL PAID INVOICES
        Gets All Paid Invoice Details.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_paid_invoices(apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str apikey: Enter User Key (required)
        :param InvoiceIDFull body: Enter details to query Invoices (required)
        :return: SuccessInvoices
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['apikey', 'body']
        all_params.append('callback')

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

        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_paid_invoices`")
        # 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 `get_paid_invoices`")


        resource_path = '/invoice/getPaidInvoices'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}
        if 'apikey' in params:
            header_params['apikey'] = params['apikey']

        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([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='SuccessInvoices',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_refund_invoices(self, apikey, body, **kwargs):
        """
        GET ALL REFUND INVOICES
        Gets All Refund Invoice Details.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_refund_invoices(apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str apikey: Enter User Key (required)
        :param InvoiceIDFull body: Enter details to query Invoices (required)
        :return: SuccessInvoices
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['apikey', 'body']
        all_params.append('callback')

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

        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_refund_invoices`")
        # 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 `get_refund_invoices`")


        resource_path = '/invoice/getRefundInvoices'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}
        if 'apikey' in params:
            header_params['apikey'] = params['apikey']

        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([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='SuccessInvoices',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_unprocessed_invoices(self, apikey, body, **kwargs):
        """
        GET ALL UNPROCESSED INVOICES
        Gets All Unprocessed Invoice Details.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_unprocessed_invoices(apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str apikey: Enter User Key (required)
        :param InvoiceIDFull body: Enter details to query Invoices (required)
        :return: SuccessInvoices
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['apikey', 'body']
        all_params.append('callback')

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

        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_unprocessed_invoices`")
        # 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 `get_unprocessed_invoices`")


        resource_path = '/invoice/getUnprocessedInvoices'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}
        if 'apikey' in params:
            header_params['apikey'] = params['apikey']

        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([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='SuccessInvoices',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response
