# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from ni.panels.v1 import panel_service_pb2 as ni_dot_panels_dot_v1_dot_panel__service__pb2
[docs]
class PanelServiceStub(object):
"""Service interface for interacting with NI panels
"""
[docs]
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.StartPanel = channel.unary_unary(
'/ni.panels.v1.PanelService/StartPanel',
request_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StartPanelRequest.SerializeToString,
response_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StartPanelResponse.FromString,
)
self.StopPanel = channel.unary_unary(
'/ni.panels.v1.PanelService/StopPanel',
request_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StopPanelRequest.SerializeToString,
response_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StopPanelResponse.FromString,
)
self.EnumeratePanels = channel.unary_unary(
'/ni.panels.v1.PanelService/EnumeratePanels',
request_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.EnumeratePanelsRequest.SerializeToString,
response_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.EnumeratePanelsResponse.FromString,
)
self.GetValue = channel.unary_unary(
'/ni.panels.v1.PanelService/GetValue',
request_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.GetValueRequest.SerializeToString,
response_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.GetValueResponse.FromString,
)
self.TryGetValue = channel.unary_unary(
'/ni.panels.v1.PanelService/TryGetValue',
request_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.TryGetValueRequest.SerializeToString,
response_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.TryGetValueResponse.FromString,
)
self.SetValue = channel.unary_unary(
'/ni.panels.v1.PanelService/SetValue',
request_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.SetValueRequest.SerializeToString,
response_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.SetValueResponse.FromString,
)
[docs]
class PanelServiceServicer(object):
"""Service interface for interacting with NI panels
"""
[docs]
def StartPanel(self, request, context):
"""Start a panel using the provided configuration (or connect to if it has already been started)
Status Codes for errors:
- INVALID_ARGUMENT:
- The panel identifier contains invalid characters.
- The panel configuration has an invalid argument.
- NOT_FOUND:
- The panel configuration includes a file that was not found.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]
def StopPanel(self, request, context):
"""Stop a panel
Status Codes for errors:
- INVALID_ARGUMENT:
- The panel identifier contains invalid characters.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]
def EnumeratePanels(self, request, context):
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
Status Codes for errors:
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]
def GetValue(self, request, context):
"""Get a value for a control on the panel
Status Codes for errors:
- INVALID_ARGUMENT:
- The panel identifier contains invalid characters.
- The value identifier contains invalid characters.
- NOT_FOUND:
- The value with the specified identifier was not found.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]
def TryGetValue(self, request, context):
"""Try to get a value for a control on the panel
Status Codes for errors:
- INVALID_ARGUMENT:
- The panel identifier contains invalid characters.
- The value identifier contains invalid characters.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]
def SetValue(self, request, context):
"""Set a value for a control on the panel
Status Codes for errors:
- INVALID_ARGUMENT:
- The panel identifier contains invalid characters.
- The value identifier contains invalid characters.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]
def add_PanelServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'StartPanel': grpc.unary_unary_rpc_method_handler(
servicer.StartPanel,
request_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StartPanelRequest.FromString,
response_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StartPanelResponse.SerializeToString,
),
'StopPanel': grpc.unary_unary_rpc_method_handler(
servicer.StopPanel,
request_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StopPanelRequest.FromString,
response_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.StopPanelResponse.SerializeToString,
),
'EnumeratePanels': grpc.unary_unary_rpc_method_handler(
servicer.EnumeratePanels,
request_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.EnumeratePanelsRequest.FromString,
response_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.EnumeratePanelsResponse.SerializeToString,
),
'GetValue': grpc.unary_unary_rpc_method_handler(
servicer.GetValue,
request_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.GetValueRequest.FromString,
response_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.GetValueResponse.SerializeToString,
),
'TryGetValue': grpc.unary_unary_rpc_method_handler(
servicer.TryGetValue,
request_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.TryGetValueRequest.FromString,
response_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.TryGetValueResponse.SerializeToString,
),
'SetValue': grpc.unary_unary_rpc_method_handler(
servicer.SetValue,
request_deserializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.SetValueRequest.FromString,
response_serializer=ni_dot_panels_dot_v1_dot_panel__service__pb2.SetValueResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'ni.panels.v1.PanelService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class PanelService(object):
"""Service interface for interacting with NI panels
"""
@staticmethod
def StartPanel(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, '/ni.panels.v1.PanelService/StartPanel',
ni_dot_panels_dot_v1_dot_panel__service__pb2.StartPanelRequest.SerializeToString,
ni_dot_panels_dot_v1_dot_panel__service__pb2.StartPanelResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def StopPanel(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, '/ni.panels.v1.PanelService/StopPanel',
ni_dot_panels_dot_v1_dot_panel__service__pb2.StopPanelRequest.SerializeToString,
ni_dot_panels_dot_v1_dot_panel__service__pb2.StopPanelResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def EnumeratePanels(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, '/ni.panels.v1.PanelService/EnumeratePanels',
ni_dot_panels_dot_v1_dot_panel__service__pb2.EnumeratePanelsRequest.SerializeToString,
ni_dot_panels_dot_v1_dot_panel__service__pb2.EnumeratePanelsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValue(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, '/ni.panels.v1.PanelService/GetValue',
ni_dot_panels_dot_v1_dot_panel__service__pb2.GetValueRequest.SerializeToString,
ni_dot_panels_dot_v1_dot_panel__service__pb2.GetValueResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TryGetValue(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, '/ni.panels.v1.PanelService/TryGetValue',
ni_dot_panels_dot_v1_dot_panel__service__pb2.TryGetValueRequest.SerializeToString,
ni_dot_panels_dot_v1_dot_panel__service__pb2.TryGetValueResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def SetValue(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, '/ni.panels.v1.PanelService/SetValue',
ni_dot_panels_dot_v1_dot_panel__service__pb2.SetValueRequest.SerializeToString,
ni_dot_panels_dot_v1_dot_panel__service__pb2.SetValueResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)