#!/usr/bin/env python
#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#  @generated
#

from __future__ import print_function
from __future__ import absolute_import

import os
import sys

if (not sys.argv[0].endswith("par") and
    not sys.argv[0].endswith("xar") and
    os.getenv('PAR_UNPACK_TMP') == None):

    f = open(sys.argv[0], "r")

    f.readline() # This will be #!/bin/bash
    line = f.readline()
    f.close()

    # The par generator tool always has '# This par was made' as the
    # second line. See fbcode/tools/make_par/make_par.py
    if (not line.startswith('# This par was made')):
        print("""WARNING
        You are trying to run *-remote.py which is
        incorrect as the paths are not set up correctly.
        Instead, you should generate your thrift file with
        thrift_library and then run the resulting
        *-remote.par.
        For more information, please read
        http://fburl.com/python-remotes""")
        exit()

from . import GraphStorageService
from . import ttypes

from nebula3.fbthrift.util.remote import Function
from nebula3.fbthrift.remote import Remote

FUNCTIONS = {
    'getNeighbors': Function('getNeighbors', 'GraphStorageService', 'GetNeighborsResponse', [('GetNeighborsRequest', 'req', 'GetNeighborsRequest')]),
    'getDstBySrc': Function('getDstBySrc', 'GraphStorageService', 'GetDstBySrcResponse', [('GetDstBySrcRequest', 'req', 'GetDstBySrcRequest')]),
    'getProps': Function('getProps', 'GraphStorageService', 'GetPropResponse', [('GetPropRequest', 'req', 'GetPropRequest')]),
    'addVertices': Function('addVertices', 'GraphStorageService', 'ExecResponse', [('AddVerticesRequest', 'req', 'AddVerticesRequest')]),
    'addEdges': Function('addEdges', 'GraphStorageService', 'ExecResponse', [('AddEdgesRequest', 'req', 'AddEdgesRequest')]),
    'deleteEdges': Function('deleteEdges', 'GraphStorageService', 'ExecResponse', [('DeleteEdgesRequest', 'req', 'DeleteEdgesRequest')]),
    'deleteVertices': Function('deleteVertices', 'GraphStorageService', 'ExecResponse', [('DeleteVerticesRequest', 'req', 'DeleteVerticesRequest')]),
    'deleteTags': Function('deleteTags', 'GraphStorageService', 'ExecResponse', [('DeleteTagsRequest', 'req', 'DeleteTagsRequest')]),
    'updateVertex': Function('updateVertex', 'GraphStorageService', 'UpdateResponse', [('UpdateVertexRequest', 'req', 'UpdateVertexRequest')]),
    'updateEdge': Function('updateEdge', 'GraphStorageService', 'UpdateResponse', [('UpdateEdgeRequest', 'req', 'UpdateEdgeRequest')]),
    'scanVertex': Function('scanVertex', 'GraphStorageService', 'ScanResponse', [('ScanVertexRequest', 'req', 'ScanVertexRequest')]),
    'scanEdge': Function('scanEdge', 'GraphStorageService', 'ScanResponse', [('ScanEdgeRequest', 'req', 'ScanEdgeRequest')]),
    'getUUID': Function('getUUID', 'GraphStorageService', 'GetUUIDResp', [('GetUUIDReq', 'req', 'GetUUIDReq')]),
    'lookupIndex': Function('lookupIndex', 'GraphStorageService', 'LookupIndexResp', [('LookupIndexRequest', 'req', 'LookupIndexRequest')]),
    'lookupAndTraverse': Function('lookupAndTraverse', 'GraphStorageService', 'GetNeighborsResponse', [('LookupAndTraverseRequest', 'req', 'LookupAndTraverseRequest')]),
    'chainUpdateEdge': Function('chainUpdateEdge', 'GraphStorageService', 'UpdateResponse', [('UpdateEdgeRequest', 'req', 'UpdateEdgeRequest')]),
    'chainAddEdges': Function('chainAddEdges', 'GraphStorageService', 'ExecResponse', [('AddEdgesRequest', 'req', 'AddEdgesRequest')]),
    'chainDeleteEdges': Function('chainDeleteEdges', 'GraphStorageService', 'ExecResponse', [('DeleteEdgesRequest', 'req', 'DeleteEdgesRequest')]),
    'get': Function('get', 'GraphStorageService', 'KVGetResponse', [('KVGetRequest', 'req', 'KVGetRequest')]),
    'put': Function('put', 'GraphStorageService', 'ExecResponse', [('KVPutRequest', 'req', 'KVPutRequest')]),
    'remove': Function('remove', 'GraphStorageService', 'ExecResponse', [('KVRemoveRequest', 'req', 'KVRemoveRequest')]),
}

SERVICE_NAMES = ['GraphStorageService', ]

if __name__ == '__main__':
    Remote.run(FUNCTIONS, SERVICE_NAMES, GraphStorageService, ttypes, sys.argv, default_port=9090)
