# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

import nucleai_pb2 as nucleai__pb2


class LearningStub(object):
  """Service and requests and responses below...
  I want to keep everything here request-response, no streaming!
  This limitation makes implementation safer now and scale infrastructure easier down the road.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.Download = channel.unary_unary(
        '/nucleai.Learning/Download',
        request_serializer=nucleai__pb2.DownloadRequest.SerializeToString,
        response_deserializer=nucleai__pb2.DownloadResponse.FromString,
        )
    self.Upload = channel.unary_unary(
        '/nucleai.Learning/Upload',
        request_serializer=nucleai__pb2.UploadRequest.SerializeToString,
        response_deserializer=nucleai__pb2.UploadResponse.FromString,
        )


class LearningServicer(object):
  """Service and requests and responses below...
  I want to keep everything here request-response, no streaming!
  This limitation makes implementation safer now and scale infrastructure easier down the road.
  """

  def Download(self, request, context):
    """One cycle = one iteration of clients downloading parameters then uploading deltas
    The server enforces that each cycle takes a predetermined duration of time.
    The client must download parameters then upload deltas before the cycle completes, else it's ignored.

    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Upload(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_LearningServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Download': grpc.unary_unary_rpc_method_handler(
          servicer.Download,
          request_deserializer=nucleai__pb2.DownloadRequest.FromString,
          response_serializer=nucleai__pb2.DownloadResponse.SerializeToString,
      ),
      'Upload': grpc.unary_unary_rpc_method_handler(
          servicer.Upload,
          request_deserializer=nucleai__pb2.UploadRequest.FromString,
          response_serializer=nucleai__pb2.UploadResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'nucleai.Learning', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
