# coding: utf-8

"""
    Phantasma API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # 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 swagger_client.api_client import ApiClient


class TransactionApi(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_v1_get_address_transaction_count_get(self, **kwargs):  # noqa: E501
        """api_v1_get_address_transaction_count_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.api_v1_get_address_transaction_count_get(async_req=True)
        >>> result = thread.get()

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

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

        :param async_req bool
        :param str account:
        :param str chain_input:
        :return: int
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['account', 'chain_input']  # 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_v1_get_address_transaction_count_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

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

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

        :param async_req bool
        :param str account:
        :param int page:
        :param int page_size:
        :return: PaginatedResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_v1_get_address_transactions_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.api_v1_get_address_transactions_get_with_http_info(**kwargs)  # noqa: E501
            return data

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

        :param async_req bool
        :param str account:
        :param int page:
        :param int page_size:
        :return: PaginatedResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'account' in params:
            query_params.append(('account', params['account']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'page_size' in params:
            query_params.append(('pageSize', params['page_size']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

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

        :param async_req bool
        :param str chain_address_or_name:
        :param str block_hash:
        :param int index:
        :return: TransactionResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.api_v1_get_transaction_by_block_hash_and_index_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.api_v1_get_transaction_by_block_hash_and_index_get_with_http_info(**kwargs)  # noqa: E501
            return data

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

        :param async_req bool
        :param str chain_address_or_name:
        :param str block_hash:
        :param int index:
        :return: TransactionResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['chain_address_or_name', 'block_hash', 'index']  # 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_v1_get_transaction_by_block_hash_and_index_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'chain_address_or_name' in params:
            query_params.append(('chainAddressOrName', params['chain_address_or_name']))  # noqa: E501
        if 'block_hash' in params:
            query_params.append(('blockHash', params['block_hash']))  # noqa: E501
        if 'index' in params:
            query_params.append(('index', params['index']))  # 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 = []  # noqa: E501

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

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

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

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

        all_params = ['hash_text']  # 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_v1_get_transaction_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

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

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

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

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

        :param async_req bool
        :param str chain_input:
        :param str script_data:
        :return: ScriptResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['chain_input', 'script_data']  # 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_v1_invoke_raw_script_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'chain_input' in params:
            query_params.append(('chainInput', params['chain_input']))  # noqa: E501
        if 'script_data' in params:
            query_params.append(('scriptData', params['script_data']))  # 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 = []  # noqa: E501

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

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

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

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

        all_params = ['tx_data']  # 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_v1_send_raw_transaction_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

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

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