# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from pacsys._proto.controls.service.DevDB.v1 import DevDB_pb2 as proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2

GRPC_GENERATED_VERSION = '1.66.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in proto/controls/service/DevDB/v1/DevDB_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class DevDBStub(object):
    """Clients can ask for device information (obtained from the
    device database.) The function is passed an array of device
    names. The function returns an array of results. The order of
    the results is the same as the request.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.getDeviceInfo = channel.unary_unary(
                '/services.devdb.DevDB/getDeviceInfo',
                request_serializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceList.SerializeToString,
                response_deserializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceInfoReply.FromString,
                _registered_method=True)
        self.getAllAlarmInfo = channel.unary_unary(
                '/services.devdb.DevDB/getAllAlarmInfo',
                request_serializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceList.SerializeToString,
                response_deserializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.AlarmInfoReply.FromString,
                _registered_method=True)
        self.getAlarmText = channel.unary_unary(
                '/services.devdb.DevDB/getAlarmText',
                request_serializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.AlarmTextIdList.SerializeToString,
                response_deserializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceAlarmTextList.FromString,
                _registered_method=True)


class DevDBServicer(object):
    """Clients can ask for device information (obtained from the
    device database.) The function is passed an array of device
    names. The function returns an array of results. The order of
    the results is the same as the request.
    """

    def getDeviceInfo(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 getAllAlarmInfo(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 getAlarmText(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_DevDBServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'getDeviceInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.getDeviceInfo,
                    request_deserializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceList.FromString,
                    response_serializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceInfoReply.SerializeToString,
            ),
            'getAllAlarmInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.getAllAlarmInfo,
                    request_deserializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceList.FromString,
                    response_serializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.AlarmInfoReply.SerializeToString,
            ),
            'getAlarmText': grpc.unary_unary_rpc_method_handler(
                    servicer.getAlarmText,
                    request_deserializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.AlarmTextIdList.FromString,
                    response_serializer=proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceAlarmTextList.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'services.devdb.DevDB', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('services.devdb.DevDB', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class DevDB(object):
    """Clients can ask for device information (obtained from the
    device database.) The function is passed an array of device
    names. The function returns an array of results. The order of
    the results is the same as the request.
    """

    @staticmethod
    def getDeviceInfo(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,
            '/services.devdb.DevDB/getDeviceInfo',
            proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceList.SerializeToString,
            proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceInfoReply.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getAllAlarmInfo(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,
            '/services.devdb.DevDB/getAllAlarmInfo',
            proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceList.SerializeToString,
            proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.AlarmInfoReply.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getAlarmText(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,
            '/services.devdb.DevDB/getAlarmText',
            proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.AlarmTextIdList.SerializeToString,
            proto_dot_controls_dot_service_dot_DevDB_dot_v1_dot_DevDB__pb2.DeviceAlarmTextList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
