# coding: utf-8

"""
    IIMMPACT API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 2020-09-14T13:01:14Z
    
    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 iimmpact.api_client import ApiClient


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

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

        :param async_req bool
        :param str _date: (required)
        :param str limit:
        :param str remarks:
        :param str sort:
        :param str type:
        :param str direction:
        :param str page:
        :param str amount:
        :return: BalanceStatementResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.v1_balance_statement_get_with_http_info(_date, **kwargs)  # noqa: E501
        else:
            (data) = self.v1_balance_statement_get_with_http_info(_date, **kwargs)  # noqa: E501
            return data

    def v1_balance_statement_get_with_http_info(self, _date, **kwargs):  # noqa: E501
        """v1_balance_statement_get  # noqa: E501

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

        :param async_req bool
        :param str _date: (required)
        :param str limit:
        :param str remarks:
        :param str sort:
        :param str type:
        :param str direction:
        :param str page:
        :param str amount:
        :return: BalanceStatementResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'remarks' in params:
            query_params.append(('remarks', params['remarks']))  # noqa: E501
        if 'sort' in params:
            query_params.append(('sort', params['sort']))  # noqa: E501
        if 'type' in params:
            query_params.append(('type', params['type']))  # noqa: E501
        if 'direction' in params:
            query_params.append(('direction', params['direction']))  # noqa: E501
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'amount' in params:
            query_params.append(('amount', params['amount']))  # 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

        # 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 = ['SSO']  # noqa: E501

        return self.api_client.call_api(
            '/v1/balance-statement', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BalanceStatementResponse',  # 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 v1_transactions_get(self, _date, **kwargs):  # noqa: E501
        """v1_transactions_get  # noqa: E501

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

        :param async_req bool
        :param str _date: (required)
        :param str refid:
        :param str limit:
        :param str sort:
        :param str offset:
        :param str direction:
        :param str status:
        :param str account:
        :param str accept_encoding:
        :param str sn:
        :param str product:
        :return: TransactionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.v1_transactions_get_with_http_info(_date, **kwargs)  # noqa: E501
        else:
            (data) = self.v1_transactions_get_with_http_info(_date, **kwargs)  # noqa: E501
            return data

    def v1_transactions_get_with_http_info(self, _date, **kwargs):  # noqa: E501
        """v1_transactions_get  # noqa: E501

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

        :param async_req bool
        :param str _date: (required)
        :param str refid:
        :param str limit:
        :param str sort:
        :param str offset:
        :param str direction:
        :param str status:
        :param str account:
        :param str accept_encoding:
        :param str sn:
        :param str product:
        :return: TransactionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['_date', 'refid', 'limit', 'sort', 'offset', 'direction', 'status', 'account', 'accept_encoding', 'sn', 'product']  # 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 v1_transactions_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter '_date' is set
        if ('_date' not in params or
                params['_date'] is None):
            raise ValueError("Missing the required parameter `_date` when calling `v1_transactions_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'refid' in params:
            query_params.append(('refid', params['refid']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'sort' in params:
            query_params.append(('sort', params['sort']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'direction' in params:
            query_params.append(('direction', params['direction']))  # noqa: E501
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'status' in params:
            query_params.append(('status', params['status']))  # noqa: E501
        if 'account' in params:
            query_params.append(('account', params['account']))  # noqa: E501
        if 'sn' in params:
            query_params.append(('sn', params['sn']))  # noqa: E501
        if 'product' in params:
            query_params.append(('product', params['product']))  # noqa: E501

        header_params = {}
        if 'accept_encoding' in params:
            header_params['Accept-Encoding'] = params['accept_encoding']  # noqa: E501

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/v1/transactions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TransactionsResponse',  # 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)
