# coding: utf-8

"""
    Knowledge-Graph Query API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from deepsearch.cps.apis.kg.query.api_client import ApiClient
from deepsearch.cps.apis.kg.query.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


class NodeDataRetrievalApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def retrieve_many_node_data_json(self, data, **kwargs):  # noqa: E501
        """retrieve_many_node_data_json  # noqa: E501

        Bulk retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_many_node_data_json(data, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param list[InlineObject] data: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.retrieve_many_node_data_json_with_http_info(data, **kwargs)  # noqa: E501

    def retrieve_many_node_data_json_with_http_info(self, data, **kwargs):  # noqa: E501
        """retrieve_many_node_data_json  # noqa: E501

        Bulk retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_many_node_data_json_with_http_info(data, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param list[InlineObject] data: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(dict(str, object), status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'data'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method retrieve_many_node_data_json" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'data' is set
        if self.api_client.client_side_validation and ('data' not in local_var_params or  # noqa: E501
                                                        local_var_params['data'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `data` when calling `retrieve_many_node_data_json`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'data' in local_var_params:
            body_params = local_var_params['data']
        # 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 = ['Bearer']  # noqa: E501

        return self.api_client.call_api(
            '/retrieveManyNodeDataJson', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def retrieve_node_annotations(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_annotations  # noqa: E501

        Retrieve the Annotations associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_annotations(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param bool render_markup: If selected the output json will contain the rendered html snippets
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.retrieve_node_annotations_with_http_info(db, id, **kwargs)  # noqa: E501

    def retrieve_node_annotations_with_http_info(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_annotations  # noqa: E501

        Retrieve the Annotations associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_annotations_with_http_info(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param bool render_markup: If selected the output json will contain the rendered html snippets
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'db',
            'id',
            'render_markup'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method retrieve_node_annotations" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'db' is set
        if self.api_client.client_side_validation and ('db' not in local_var_params or  # noqa: E501
                                                        local_var_params['db'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `db` when calling `retrieve_node_annotations`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                        local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `id` when calling `retrieve_node_annotations`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'db' in local_var_params and local_var_params['db'] is not None:  # noqa: E501
            query_params.append(('_db', local_var_params['db']))  # noqa: E501
        if 'id' in local_var_params and local_var_params['id'] is not None:  # noqa: E501
            query_params.append(('_id', local_var_params['id']))  # noqa: E501
        if 'render_markup' in local_var_params and local_var_params['render_markup'] is not None:  # noqa: E501
            query_params.append(('render_markup', local_var_params['render_markup']))  # 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', 'text/html'])  # noqa: E501

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

        return self.api_client.call_api(
            '/retrieveNodeAnnotations', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def retrieve_node_data_by_key(self, db, id, key, **kwargs):  # noqa: E501
        """retrieve_node_data_by_key  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_by_key(db, id, key, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param str key: The data key to retrieve (required)
        :param int index: The index for the data inside this key
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.retrieve_node_data_by_key_with_http_info(db, id, key, **kwargs)  # noqa: E501

    def retrieve_node_data_by_key_with_http_info(self, db, id, key, **kwargs):  # noqa: E501
        """retrieve_node_data_by_key  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_by_key_with_http_info(db, id, key, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param str key: The data key to retrieve (required)
        :param int index: The index for the data inside this key
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'db',
            'id',
            'key',
            'index'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method retrieve_node_data_by_key" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'db' is set
        if self.api_client.client_side_validation and ('db' not in local_var_params or  # noqa: E501
                                                        local_var_params['db'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `db` when calling `retrieve_node_data_by_key`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                        local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `id` when calling `retrieve_node_data_by_key`")  # noqa: E501
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in local_var_params or  # noqa: E501
                                                        local_var_params['key'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `key` when calling `retrieve_node_data_by_key`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'db' in local_var_params and local_var_params['db'] is not None:  # noqa: E501
            query_params.append(('_db', local_var_params['db']))  # noqa: E501
        if 'id' in local_var_params and local_var_params['id'] is not None:  # noqa: E501
            query_params.append(('_id', local_var_params['id']))  # noqa: E501
        if 'key' in local_var_params and local_var_params['key'] is not None:  # noqa: E501
            query_params.append(('key', local_var_params['key']))  # noqa: E501
        if 'index' in local_var_params and local_var_params['index'] is not None:  # noqa: E501
            query_params.append(('index', local_var_params['index']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/retrieveNodeDataByKey', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def retrieve_node_data_image(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_data_image  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_image(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.retrieve_node_data_image_with_http_info(db, id, **kwargs)  # noqa: E501

    def retrieve_node_data_image_with_http_info(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_data_image  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_image_with_http_info(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'db',
            'id'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method retrieve_node_data_image" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'db' is set
        if self.api_client.client_side_validation and ('db' not in local_var_params or  # noqa: E501
                                                        local_var_params['db'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `db` when calling `retrieve_node_data_image`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                        local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `id` when calling `retrieve_node_data_image`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'db' in local_var_params and local_var_params['db'] is not None:  # noqa: E501
            query_params.append(('_db', local_var_params['db']))  # noqa: E501
        if 'id' in local_var_params and local_var_params['id'] is not None:  # noqa: E501
            query_params.append(('_id', local_var_params['id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/retrieveNodeDataImage', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def retrieve_node_data_json(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_data_json  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_json(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param InlineObject options:
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.retrieve_node_data_json_with_http_info(db, id, **kwargs)  # noqa: E501

    def retrieve_node_data_json_with_http_info(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_data_json  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_json_with_http_info(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param InlineObject options:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(dict(str, object), status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'db',
            'id',
            'options'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method retrieve_node_data_json" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'db' is set
        if self.api_client.client_side_validation and ('db' not in local_var_params or  # noqa: E501
                                                        local_var_params['db'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `db` when calling `retrieve_node_data_json`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                        local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `id` when calling `retrieve_node_data_json`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'db' in local_var_params and local_var_params['db'] is not None:  # noqa: E501
            query_params.append(('_db', local_var_params['db']))  # noqa: E501
        if 'id' in local_var_params and local_var_params['id'] is not None:  # noqa: E501
            query_params.append(('_id', local_var_params['id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'options' in local_var_params:
            body_params = local_var_params['options']
        # 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 = ['Bearer']  # noqa: E501

        return self.api_client.call_api(
            '/retrieveNodeDataJson', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def retrieve_node_data_keys(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_data_keys  # noqa: E501

        Retrieve the data keys available for the node  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_keys(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.retrieve_node_data_keys_with_http_info(db, id, **kwargs)  # noqa: E501

    def retrieve_node_data_keys_with_http_info(self, db, id, **kwargs):  # noqa: E501
        """retrieve_node_data_keys  # noqa: E501

        Retrieve the data keys available for the node  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_keys_with_http_info(db, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'db',
            'id'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method retrieve_node_data_keys" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'db' is set
        if self.api_client.client_side_validation and ('db' not in local_var_params or  # noqa: E501
                                                        local_var_params['db'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `db` when calling `retrieve_node_data_keys`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                        local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `id` when calling `retrieve_node_data_keys`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'db' in local_var_params and local_var_params['db'] is not None:  # noqa: E501
            query_params.append(('_db', local_var_params['db']))  # noqa: E501
        if 'id' in local_var_params and local_var_params['id'] is not None:  # noqa: E501
            query_params.append(('_id', local_var_params['id']))  # 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 = ['Bearer']  # noqa: E501

        return self.api_client.call_api(
            '/retrieveNodeDataKeys', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def retrieve_node_data_url_by_key(self, db, id, key, **kwargs):  # noqa: E501
        """retrieve_node_data_url_by_key  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_url_by_key(db, id, key, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param str key: The data key to retrieve (required)
        :param int index: The index for the data inside this key
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.retrieve_node_data_url_by_key_with_http_info(db, id, key, **kwargs)  # noqa: E501

    def retrieve_node_data_url_by_key_with_http_info(self, db, id, key, **kwargs):  # noqa: E501
        """retrieve_node_data_url_by_key  # noqa: E501

        Retrieve the data associated with the nodes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.retrieve_node_data_url_by_key_with_http_info(db, id, key, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str db: Hash of the database (found in the `_db` field of the node) (required)
        :param str id: Hash of the database-entry (found in the `_id` field of the node) (required)
        :param str key: The data key to retrieve (required)
        :param int index: The index for the data inside this key
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'db',
            'id',
            'key',
            'index'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method retrieve_node_data_url_by_key" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'db' is set
        if self.api_client.client_side_validation and ('db' not in local_var_params or  # noqa: E501
                                                        local_var_params['db'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `db` when calling `retrieve_node_data_url_by_key`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                        local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `id` when calling `retrieve_node_data_url_by_key`")  # noqa: E501
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in local_var_params or  # noqa: E501
                                                        local_var_params['key'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `key` when calling `retrieve_node_data_url_by_key`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'db' in local_var_params and local_var_params['db'] is not None:  # noqa: E501
            query_params.append(('_db', local_var_params['db']))  # noqa: E501
        if 'id' in local_var_params and local_var_params['id'] is not None:  # noqa: E501
            query_params.append(('_id', local_var_params['id']))  # noqa: E501
        if 'key' in local_var_params and local_var_params['key'] is not None:  # noqa: E501
            query_params.append(('key', local_var_params['key']))  # noqa: E501
        if 'index' in local_var_params and local_var_params['index'] is not None:  # noqa: E501
            query_params.append(('index', local_var_params['index']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/retrieveNodeDataUrlByKey', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
