api-lisbon/app/route_service_pb2_grpc.py

103 lines
3.8 KiB
Python

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import route_service_pb2 as route__service__pb2
class RouteServiceStub(object):
"""Interface exported by the server.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ShortestPath = channel.unary_unary(
'/RouteService/ShortestPath',
request_serializer=route__service__pb2.RouteRequest.SerializeToString,
response_deserializer=route__service__pb2.RouteResponse.FromString,
)
self.ListNodes = channel.unary_stream(
'/RouteService/ListNodes',
request_serializer=route__service__pb2.Profile.SerializeToString,
response_deserializer=route__service__pb2.Node.FromString,
)
class RouteServiceServicer(object):
"""Interface exported by the server.
"""
def ShortestPath(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListNodes(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_RouteServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'ShortestPath': grpc.unary_unary_rpc_method_handler(
servicer.ShortestPath,
request_deserializer=route__service__pb2.RouteRequest.FromString,
response_serializer=route__service__pb2.RouteResponse.SerializeToString,
),
'ListNodes': grpc.unary_stream_rpc_method_handler(
servicer.ListNodes,
request_deserializer=route__service__pb2.Profile.FromString,
response_serializer=route__service__pb2.Node.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'RouteService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class RouteService(object):
"""Interface exported by the server.
"""
@staticmethod
def ShortestPath(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/RouteService/ShortestPath',
route__service__pb2.RouteRequest.SerializeToString,
route__service__pb2.RouteResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListNodes(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/RouteService/ListNodes',
route__service__pb2.Profile.SerializeToString,
route__service__pb2.Node.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)