working
This commit is contained in:
@@ -20,6 +20,11 @@ class MetricsStub(object):
|
||||
request_serializer=rowing__workout__metrics__pb2.WorkoutMetricsRequest.SerializeToString,
|
||||
response_deserializer=rowing__workout__metrics__pb2.WorkoutMetricsResponse.FromString,
|
||||
)
|
||||
self.GetCP = channel.unary_unary(
|
||||
'/rowing_workout_metrics.Metrics/GetCP',
|
||||
request_serializer=rowing__workout__metrics__pb2.CPRequest.SerializeToString,
|
||||
response_deserializer=rowing__workout__metrics__pb2.CPResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class MetricsServicer(object):
|
||||
@@ -32,6 +37,12 @@ class MetricsServicer(object):
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetCP(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_MetricsServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
@@ -40,6 +51,11 @@ def add_MetricsServicer_to_server(servicer, server):
|
||||
request_deserializer=rowing__workout__metrics__pb2.WorkoutMetricsRequest.FromString,
|
||||
response_serializer=rowing__workout__metrics__pb2.WorkoutMetricsResponse.SerializeToString,
|
||||
),
|
||||
'GetCP': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetCP,
|
||||
request_deserializer=rowing__workout__metrics__pb2.CPRequest.FromString,
|
||||
response_serializer=rowing__workout__metrics__pb2.CPResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'rowing_workout_metrics.Metrics', rpc_method_handlers)
|
||||
@@ -68,53 +84,6 @@ class Metrics(object):
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
|
||||
class CPStub(object):
|
||||
"""GetCP service definition
|
||||
"""
|
||||
|
||||
def __init__(self, channel):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.GetCP = channel.unary_unary(
|
||||
'/rowing_workout_metrics.CP/GetCP',
|
||||
request_serializer=rowing__workout__metrics__pb2.CPRequest.SerializeToString,
|
||||
response_deserializer=rowing__workout__metrics__pb2.CPResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class CPServicer(object):
|
||||
"""GetCP service definition
|
||||
"""
|
||||
|
||||
def GetCP(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_CPServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'GetCP': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetCP,
|
||||
request_deserializer=rowing__workout__metrics__pb2.CPRequest.FromString,
|
||||
response_serializer=rowing__workout__metrics__pb2.CPResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'rowing_workout_metrics.CP', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API.
|
||||
class CP(object):
|
||||
"""GetCP service definition
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def GetCP(request,
|
||||
target,
|
||||
@@ -126,7 +95,7 @@ class CP(object):
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/rowing_workout_metrics.CP/GetCP',
|
||||
return grpc.experimental.unary_unary(request, target, '/rowing_workout_metrics.Metrics/GetCP',
|
||||
rowing__workout__metrics__pb2.CPRequest.SerializeToString,
|
||||
rowing__workout__metrics__pb2.CPResponse.FromString,
|
||||
options, channel_credentials,
|
||||
|
||||
Reference in New Issue
Block a user