# coding: utf-8

"""
    HEP REST API

    The REST API for HEP protocol  # noqa: E501

    OpenAPI spec version: v1
    Contact: xiawu@zeuux.org
    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 hep_rest_api.api_client import ApiClient


class RestApi(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 rest_dapps_read(self, api_version, dapp_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_dapps_read  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_dapps_read(api_version, dapp_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str dapp_id: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: Dapp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_dapps_read_with_http_info(api_version, dapp_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_dapps_read_with_http_info(api_version, dapp_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_dapps_read_with_http_info(self, api_version, dapp_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_dapps_read  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_dapps_read_with_http_info(api_version, dapp_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str dapp_id: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: Dapp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', 'dapp_id', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_dapps_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'dapp_id' is set
        if ('dapp_id' not in params or
                params['dapp_id'] is None):
            raise ValueError("Missing the required parameter `dapp_id` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_dapps_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_dapps_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'dapp_id' in params:
            path_params['dapp_id'] = params['dapp_id']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/dapps/{dapp_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Dapp',  # 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 rest_health_list(self, api_version, **kwargs):  # noqa: E501
        """rest_health_list  # noqa: E501

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

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

    def rest_health_list_with_http_info(self, api_version, **kwargs):  # noqa: E501
        """rest_health_list  # noqa: E501

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

        :param async_req bool
        :param str api_version: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        return self.api_client.call_api(
            '/rest/v{api_version}/health/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def rest_newchain_tx_read(self, api_version, txid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newchain_tx_read  # noqa: E501

        Retrieve the transaction information by given txid  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newchain_tx_read(api_version, txid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str txid: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: NewchainTransactionResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_newchain_tx_read_with_http_info(api_version, txid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_newchain_tx_read_with_http_info(api_version, txid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_newchain_tx_read_with_http_info(self, api_version, txid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newchain_tx_read  # noqa: E501

        Retrieve the transaction information by given txid  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newchain_tx_read_with_http_info(api_version, txid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str txid: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: NewchainTransactionResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', 'txid', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_newchain_tx_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'txid' is set
        if ('txid' not in params or
                params['txid'] is None):
            raise ValueError("Missing the required parameter `txid` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_newchain_tx_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_newchain_tx_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'txid' in params:
            path_params['txid'] = params['txid']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/newchain/tx/{txid}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='NewchainTransactionResponse',  # 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 rest_newforce_read(self, api_version, _date, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newforce_read  # noqa: E501

        Retrieve the daily newforce statistics  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newforce_read(api_version, _date, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str _date: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: NewforceDailyStatsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_newforce_read_with_http_info(api_version, _date, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_newforce_read_with_http_info(api_version, _date, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_newforce_read_with_http_info(self, api_version, _date, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newforce_read  # noqa: E501

        Retrieve the daily newforce statistics  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newforce_read_with_http_info(api_version, _date, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str _date: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: NewforceDailyStatsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', '_date', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_newforce_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_newforce_read`")  # noqa: E501
        # 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 `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_newforce_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_newforce_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if '_date' in params:
            path_params['date'] = params['_date']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/newforce/{date}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='NewforceDailyStatsResponse',  # 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 rest_newids_read(self, api_version, newid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newids_read  # noqa: E501

        Retrieve the information by given NewID  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newids_read(api_version, newid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str newid: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: NewidResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_newids_read_with_http_info(api_version, newid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_newids_read_with_http_info(api_version, newid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_newids_read_with_http_info(self, api_version, newid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newids_read  # noqa: E501

        Retrieve the information by given NewID  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newids_read_with_http_info(api_version, newid, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str newid: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: NewidResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', 'newid', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_newids_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'newid' is set
        if ('newid' not in params or
                params['newid'] is None):
            raise ValueError("Missing the required parameter `newid` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_newids_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_newids_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'newid' in params:
            path_params['newid'] = params['newid']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/newids/{newid}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='NewidResponse',  # 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 rest_newnet_caches_auth_create(self, body, api_version, **kwargs):  # noqa: E501
        """rest_newnet_caches_auth_create  # noqa: E501

        Caches the authentication request  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_auth_create(body, api_version, async_req=True)
        >>> result = thread.get()

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

    def rest_newnet_caches_auth_create_with_http_info(self, body, api_version, **kwargs):  # noqa: E501
        """rest_newnet_caches_auth_create  # noqa: E501

        Caches the authentication request  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_auth_create_with_http_info(body, api_version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AuthCacheRequest body: (required)
        :param str api_version: (required)
        :return: CreateAuthCacheResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/v{api_version}/newnet/caches/auth/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CreateAuthCacheResponse',  # 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 rest_newnet_caches_auth_read(self, api_version, auth_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newnet_caches_auth_read  # noqa: E501

        Get the authentication information by given request hash.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_auth_read(api_version, auth_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str auth_hash: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: AuthCacheResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_newnet_caches_auth_read_with_http_info(api_version, auth_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_newnet_caches_auth_read_with_http_info(api_version, auth_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_newnet_caches_auth_read_with_http_info(self, api_version, auth_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newnet_caches_auth_read  # noqa: E501

        Get the authentication information by given request hash.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_auth_read_with_http_info(api_version, auth_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str auth_hash: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: AuthCacheResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', 'auth_hash', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_newnet_caches_auth_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'auth_hash' is set
        if ('auth_hash' not in params or
                params['auth_hash'] is None):
            raise ValueError("Missing the required parameter `auth_hash` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_newnet_caches_auth_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_newnet_caches_auth_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'auth_hash' in params:
            path_params['auth_hash'] = params['auth_hash']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/newnet/caches/auth/{auth_hash}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AuthCacheResponse',  # 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 rest_newnet_caches_pay_create(self, body, api_version, **kwargs):  # noqa: E501
        """rest_newnet_caches_pay_create  # noqa: E501

        Cache the pay request  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_pay_create(body, api_version, async_req=True)
        >>> result = thread.get()

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

    def rest_newnet_caches_pay_create_with_http_info(self, body, api_version, **kwargs):  # noqa: E501
        """rest_newnet_caches_pay_create  # noqa: E501

        Cache the pay request  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_pay_create_with_http_info(body, api_version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PayCacheRequest body: (required)
        :param str api_version: (required)
        :return: CreatePayCacheResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/v{api_version}/newnet/caches/pay/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CreatePayCacheResponse',  # 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 rest_newnet_caches_pay_read(self, api_version, pay_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newnet_caches_pay_read  # noqa: E501

        Retrieve the pay information by given pay hash.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_pay_read(api_version, pay_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str pay_hash: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: PayCacheResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_newnet_caches_pay_read_with_http_info(api_version, pay_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_newnet_caches_pay_read_with_http_info(api_version, pay_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_newnet_caches_pay_read_with_http_info(self, api_version, pay_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_newnet_caches_pay_read  # noqa: E501

        Retrieve the pay information by given pay hash.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_newnet_caches_pay_read_with_http_info(api_version, pay_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str pay_hash: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: PayCacheResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', 'pay_hash', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_newnet_caches_pay_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'pay_hash' is set
        if ('pay_hash' not in params or
                params['pay_hash'] is None):
            raise ValueError("Missing the required parameter `pay_hash` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_newnet_caches_pay_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_newnet_caches_pay_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'pay_hash' in params:
            path_params['pay_hash'] = params['pay_hash']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/newnet/caches/pay/{pay_hash}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PayCacheResponse',  # 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 rest_oracles_read(self, api_version, oracle_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_oracles_read  # noqa: E501

        Get the oracle information by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_oracles_read(api_version, oracle_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str oracle_id: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: RetrieveOracleResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_oracles_read_with_http_info(api_version, oracle_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_oracles_read_with_http_info(api_version, oracle_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_oracles_read_with_http_info(self, api_version, oracle_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_oracles_read  # noqa: E501

        Get the oracle information by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_oracles_read_with_http_info(api_version, oracle_id, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str oracle_id: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: RetrieveOracleResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', 'oracle_id', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_oracles_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'oracle_id' is set
        if ('oracle_id' not in params or
                params['oracle_id'] is None):
            raise ValueError("Missing the required parameter `oracle_id` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_oracles_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_oracles_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'oracle_id' in params:
            path_params['oracle_id'] = params['oracle_id']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/oracles/{oracle_id}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RetrieveOracleResponse',  # 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 rest_proofs_create(self, body, api_version, **kwargs):  # noqa: E501
        """rest_proofs_create  # noqa: E501

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

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

    def rest_proofs_create_with_http_info(self, body, api_version, **kwargs):  # noqa: E501
        """rest_proofs_create  # noqa: E501

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

        :param async_req bool
        :param CreateProofRequest body: (required)
        :param str api_version: (required)
        :return: CreateProofResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/v{api_version}/proofs/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CreateProofResponse',  # 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 rest_proofs_delete(self, body, api_version, proof_hash, **kwargs):  # noqa: E501
        """rest_proofs_delete  # noqa: E501

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

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

    def rest_proofs_delete_with_http_info(self, body, api_version, proof_hash, **kwargs):  # noqa: E501
        """rest_proofs_delete  # noqa: E501

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

        :param async_req bool
        :param CancelProofRequest body: (required)
        :param str api_version: (required)
        :param str proof_hash: (required)
        :return: CancelProofResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'proof_hash' in params:
            path_params['proof_hash'] = params['proof_hash']  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/v{api_version}/proofs/{proof_hash}/', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CancelProofResponse',  # 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 rest_proofs_read(self, api_version, proof_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_proofs_read  # noqa: E501

        Get the proof by given proof hash.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_proofs_read(api_version, proof_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str proof_hash: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: ProofResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rest_proofs_read_with_http_info(api_version, proof_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
        else:
            (data) = self.rest_proofs_read_with_http_info(api_version, proof_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs)  # noqa: E501
            return data

    def rest_proofs_read_with_http_info(self, api_version, proof_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, **kwargs):  # noqa: E501
        """rest_proofs_read  # noqa: E501

        Get the proof by given proof hash.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rest_proofs_read_with_http_info(api_version, proof_hash, dapp_key, protocol, version, ts, nonce, os, language, dapp_signature_method, dapp_signature, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str api_version: (required)
        :param str proof_hash: (required)
        :param str dapp_key: The decentralized application access key (required)
        :param str protocol: The protocol name. default is 'HEP'. (required)
        :param str version: The protocol version such as '1.0' (required)
        :param int ts: The current timestamp (required)
        :param str nonce: The random string or auto-increment sequence (required)
        :param str os: The operating system of client such as ios, android, dweb,etc. (required)
        :param str language: The i18n language code such as zh, en, etc. (required)
        :param str dapp_signature_method: The signature method used by dapp. (required)
        :param str dapp_signature: The signature generated by dapp. (required)
        :return: ProofResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['api_version', 'proof_hash', 'dapp_key', 'protocol', 'version', 'ts', 'nonce', 'os', 'language', 'dapp_signature_method', 'dapp_signature']  # 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 rest_proofs_read" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'api_version' is set
        if ('api_version' not in params or
                params['api_version'] is None):
            raise ValueError("Missing the required parameter `api_version` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'proof_hash' is set
        if ('proof_hash' not in params or
                params['proof_hash'] is None):
            raise ValueError("Missing the required parameter `proof_hash` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'dapp_key' is set
        if ('dapp_key' not in params or
                params['dapp_key'] is None):
            raise ValueError("Missing the required parameter `dapp_key` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'protocol' is set
        if ('protocol' not in params or
                params['protocol'] is None):
            raise ValueError("Missing the required parameter `protocol` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'ts' is set
        if ('ts' not in params or
                params['ts'] is None):
            raise ValueError("Missing the required parameter `ts` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'nonce' is set
        if ('nonce' not in params or
                params['nonce'] is None):
            raise ValueError("Missing the required parameter `nonce` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'os' is set
        if ('os' not in params or
                params['os'] is None):
            raise ValueError("Missing the required parameter `os` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'language' is set
        if ('language' not in params or
                params['language'] is None):
            raise ValueError("Missing the required parameter `language` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature_method' is set
        if ('dapp_signature_method' not in params or
                params['dapp_signature_method'] is None):
            raise ValueError("Missing the required parameter `dapp_signature_method` when calling `rest_proofs_read`")  # noqa: E501
        # verify the required parameter 'dapp_signature' is set
        if ('dapp_signature' not in params or
                params['dapp_signature'] is None):
            raise ValueError("Missing the required parameter `dapp_signature` when calling `rest_proofs_read`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # noqa: E501
        if 'proof_hash' in params:
            path_params['proof_hash'] = params['proof_hash']  # noqa: E501

        query_params = []
        if 'dapp_key' in params:
            query_params.append(('dapp_key', params['dapp_key']))  # noqa: E501
        if 'protocol' in params:
            query_params.append(('protocol', params['protocol']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'ts' in params:
            query_params.append(('ts', params['ts']))  # noqa: E501
        if 'nonce' in params:
            query_params.append(('nonce', params['nonce']))  # noqa: E501
        if 'os' in params:
            query_params.append(('os', params['os']))  # noqa: E501
        if 'language' in params:
            query_params.append(('language', params['language']))  # noqa: E501
        if 'dapp_signature_method' in params:
            query_params.append(('dapp_signature_method', params['dapp_signature_method']))  # noqa: E501
        if 'dapp_signature' in params:
            query_params.append(('dapp_signature', params['dapp_signature']))  # 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(
            '/rest/v{api_version}/proofs/{proof_hash}/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ProofResponse',  # 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 rest_proofs_receipts_create(self, body, api_version, **kwargs):  # noqa: E501
        """rest_proofs_receipts_create  # noqa: E501

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

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

    def rest_proofs_receipts_create_with_http_info(self, body, api_version, **kwargs):  # noqa: E501
        """rest_proofs_receipts_create  # noqa: E501

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

        :param async_req bool
        :param RetrieveProofReceiptsRequest body: (required)
        :param str api_version: (required)
        :return: RetrieveProofReceiptsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'api_version' in params:
            path_params['api_version'] = params['api_version']  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/v{api_version}/proofs/receipts/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RetrieveProofReceiptsResponse',  # 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)
