Files
ResInsight/docs/rips/generated/Commands_pb2_grpc.py
2020-03-20 19:01:04 +01:00

57 lines
2.0 KiB
Python

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import Commands_pb2 as Commands__pb2
class CommandsStub(object):
"""
The Commands service handles generic ResInsight RicfCommandObject-commands
The CommandParams is used to deduce command name from the chosen oneof-message
.. and the parameters are in the oneof-message itself.
Note that we several times duplicate nearly the same message. This is because
it is not recommended to reuse existing messages for different purposes.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Execute = channel.unary_unary(
'/rips.Commands/Execute',
request_serializer=Commands__pb2.CommandParams.SerializeToString,
response_deserializer=Commands__pb2.CommandReply.FromString,
)
class CommandsServicer(object):
"""
The Commands service handles generic ResInsight RicfCommandObject-commands
The CommandParams is used to deduce command name from the chosen oneof-message
.. and the parameters are in the oneof-message itself.
Note that we several times duplicate nearly the same message. This is because
it is not recommended to reuse existing messages for different purposes.
"""
def Execute(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CommandsServicer_to_server(servicer, server):
rpc_method_handlers = {
'Execute': grpc.unary_unary_rpc_method_handler(
servicer.Execute,
request_deserializer=Commands__pb2.CommandParams.FromString,
response_serializer=Commands__pb2.CommandReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'rips.Commands', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))