# 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 service.service_spec import glurpc_pb2 as service_dot_service__spec_dot_glurpc__pb2

GRPC_GENERATED_VERSION = '1.76.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 service/service_spec/glurpc_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 GlucosePredictionStub(object):
    """GluRPC Service Definition
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ConvertToUnified = channel.unary_unary(
                '/glurpc.GlucosePrediction/ConvertToUnified',
                request_serializer=service_dot_service__spec_dot_glurpc__pb2.ConvertToUnifiedRequest.SerializeToString,
                response_deserializer=service_dot_service__spec_dot_glurpc__pb2.ConvertToUnifiedResponse.FromString,
                _registered_method=True)
        self.ProcessUnified = channel.unary_unary(
                '/glurpc.GlucosePrediction/ProcessUnified',
                request_serializer=service_dot_service__spec_dot_glurpc__pb2.ProcessUnifiedRequest.SerializeToString,
                response_deserializer=service_dot_service__spec_dot_glurpc__pb2.ProcessUnifiedResponse.FromString,
                _registered_method=True)
        self.DrawPlot = channel.unary_unary(
                '/glurpc.GlucosePrediction/DrawPlot',
                request_serializer=service_dot_service__spec_dot_glurpc__pb2.PlotRequest.SerializeToString,
                response_deserializer=service_dot_service__spec_dot_glurpc__pb2.PlotResponse.FromString,
                _registered_method=True)
        self.QuickPlot = channel.unary_unary(
                '/glurpc.GlucosePrediction/QuickPlot',
                request_serializer=service_dot_service__spec_dot_glurpc__pb2.QuickPlotRequest.SerializeToString,
                response_deserializer=service_dot_service__spec_dot_glurpc__pb2.QuickPlotResponse.FromString,
                _registered_method=True)
        self.ManageCache = channel.unary_unary(
                '/glurpc.GlucosePrediction/ManageCache',
                request_serializer=service_dot_service__spec_dot_glurpc__pb2.CacheManagementRequest.SerializeToString,
                response_deserializer=service_dot_service__spec_dot_glurpc__pb2.CacheManagementResponse.FromString,
                _registered_method=True)
        self.CheckHealth = channel.unary_unary(
                '/glurpc.GlucosePrediction/CheckHealth',
                request_serializer=service_dot_service__spec_dot_glurpc__pb2.HealthRequest.SerializeToString,
                response_deserializer=service_dot_service__spec_dot_glurpc__pb2.HealthResponse.FromString,
                _registered_method=True)


class GlucosePredictionServicer(object):
    """GluRPC Service Definition
    """

    def ConvertToUnified(self, request, context):
        """Convert CGM data to unified format (public, no auth)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ProcessUnified(self, request, context):
        """Process unified CSV and cache for plotting (requires auth)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DrawPlot(self, request, context):
        """Generate plot from cached dataset (requires auth)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def QuickPlot(self, request, context):
        """Quick plot: process + plot in one call (requires auth)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ManageCache(self, request, context):
        """Manage cache (requires auth)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CheckHealth(self, request, context):
        """Health check (public)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GlucosePredictionServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ConvertToUnified': grpc.unary_unary_rpc_method_handler(
                    servicer.ConvertToUnified,
                    request_deserializer=service_dot_service__spec_dot_glurpc__pb2.ConvertToUnifiedRequest.FromString,
                    response_serializer=service_dot_service__spec_dot_glurpc__pb2.ConvertToUnifiedResponse.SerializeToString,
            ),
            'ProcessUnified': grpc.unary_unary_rpc_method_handler(
                    servicer.ProcessUnified,
                    request_deserializer=service_dot_service__spec_dot_glurpc__pb2.ProcessUnifiedRequest.FromString,
                    response_serializer=service_dot_service__spec_dot_glurpc__pb2.ProcessUnifiedResponse.SerializeToString,
            ),
            'DrawPlot': grpc.unary_unary_rpc_method_handler(
                    servicer.DrawPlot,
                    request_deserializer=service_dot_service__spec_dot_glurpc__pb2.PlotRequest.FromString,
                    response_serializer=service_dot_service__spec_dot_glurpc__pb2.PlotResponse.SerializeToString,
            ),
            'QuickPlot': grpc.unary_unary_rpc_method_handler(
                    servicer.QuickPlot,
                    request_deserializer=service_dot_service__spec_dot_glurpc__pb2.QuickPlotRequest.FromString,
                    response_serializer=service_dot_service__spec_dot_glurpc__pb2.QuickPlotResponse.SerializeToString,
            ),
            'ManageCache': grpc.unary_unary_rpc_method_handler(
                    servicer.ManageCache,
                    request_deserializer=service_dot_service__spec_dot_glurpc__pb2.CacheManagementRequest.FromString,
                    response_serializer=service_dot_service__spec_dot_glurpc__pb2.CacheManagementResponse.SerializeToString,
            ),
            'CheckHealth': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckHealth,
                    request_deserializer=service_dot_service__spec_dot_glurpc__pb2.HealthRequest.FromString,
                    response_serializer=service_dot_service__spec_dot_glurpc__pb2.HealthResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'glurpc.GlucosePrediction', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('glurpc.GlucosePrediction', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class GlucosePrediction(object):
    """GluRPC Service Definition
    """

    @staticmethod
    def ConvertToUnified(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,
            '/glurpc.GlucosePrediction/ConvertToUnified',
            service_dot_service__spec_dot_glurpc__pb2.ConvertToUnifiedRequest.SerializeToString,
            service_dot_service__spec_dot_glurpc__pb2.ConvertToUnifiedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ProcessUnified(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,
            '/glurpc.GlucosePrediction/ProcessUnified',
            service_dot_service__spec_dot_glurpc__pb2.ProcessUnifiedRequest.SerializeToString,
            service_dot_service__spec_dot_glurpc__pb2.ProcessUnifiedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DrawPlot(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,
            '/glurpc.GlucosePrediction/DrawPlot',
            service_dot_service__spec_dot_glurpc__pb2.PlotRequest.SerializeToString,
            service_dot_service__spec_dot_glurpc__pb2.PlotResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def QuickPlot(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,
            '/glurpc.GlucosePrediction/QuickPlot',
            service_dot_service__spec_dot_glurpc__pb2.QuickPlotRequest.SerializeToString,
            service_dot_service__spec_dot_glurpc__pb2.QuickPlotResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ManageCache(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,
            '/glurpc.GlucosePrediction/ManageCache',
            service_dot_service__spec_dot_glurpc__pb2.CacheManagementRequest.SerializeToString,
            service_dot_service__spec_dot_glurpc__pb2.CacheManagementResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CheckHealth(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,
            '/glurpc.GlucosePrediction/CheckHealth',
            service_dot_service__spec_dot_glurpc__pb2.HealthRequest.SerializeToString,
            service_dot_service__spec_dot_glurpc__pb2.HealthResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
