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

from servicelayer.rpc import common_pb2 as servicelayer_dot_rpc_dot_common__pb2
from servicelayer.rpc import ocr_pb2 as servicelayer_dot_rpc_dot_ocr__pb2


class RecognizeTextStub(object):
  """Request OCR to be performed on the given image of a
  piece of text.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.Recognize = channel.unary_unary(
        '/RecognizeText/Recognize',
        request_serializer=servicelayer_dot_rpc_dot_ocr__pb2.Image.SerializeToString,
        response_deserializer=servicelayer_dot_rpc_dot_common__pb2.Text.FromString,
        )


class RecognizeTextServicer(object):
  """Request OCR to be performed on the given image of a
  piece of text.
  """

  def Recognize(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_RecognizeTextServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Recognize': grpc.unary_unary_rpc_method_handler(
          servicer.Recognize,
          request_deserializer=servicelayer_dot_rpc_dot_ocr__pb2.Image.FromString,
          response_serializer=servicelayer_dot_rpc_dot_common__pb2.Text.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'RecognizeText', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
