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

from biopb.image import rpc_process_image_pb2 as biopb_dot_image_dot_rpc__process__image__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class ProcessImageStub(object):
    """A generic image process protocol that returns a new image. Examples include
    denoising, super-resolution, and semantic segmentation.

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Run = channel.unary_unary(
                '/biopb.image.ProcessImage/Run',
                request_serializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessRequest.SerializeToString,
                response_deserializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessResponse.FromString,
                _registered_method=True)
        self.RunStream = channel.stream_stream(
                '/biopb.image.ProcessImage/RunStream',
                request_serializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessRequest.SerializeToString,
                response_deserializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessResponse.FromString,
                _registered_method=True)
        self.GetOpNames = channel.unary_unary(
                '/biopb.image.ProcessImage/GetOpNames',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=biopb_dot_image_dot_rpc__process__image__pb2.OpNames.FromString,
                _registered_method=True)


class ProcessImageServicer(object):
    """A generic image process protocol that returns a new image. Examples include
    denoising, super-resolution, and semantic segmentation.

    """

    def Run(self, request, context):
        """Process the input image
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RunStream(self, request_iterator, context):
        """Streaming version 
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetOpNames(self, request, context):
        """Query operation names. Server with a single op may not implement this
        call.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ProcessImageServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Run': grpc.unary_unary_rpc_method_handler(
                    servicer.Run,
                    request_deserializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessRequest.FromString,
                    response_serializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessResponse.SerializeToString,
            ),
            'RunStream': grpc.stream_stream_rpc_method_handler(
                    servicer.RunStream,
                    request_deserializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessRequest.FromString,
                    response_serializer=biopb_dot_image_dot_rpc__process__image__pb2.ProcessResponse.SerializeToString,
            ),
            'GetOpNames': grpc.unary_unary_rpc_method_handler(
                    servicer.GetOpNames,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=biopb_dot_image_dot_rpc__process__image__pb2.OpNames.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'biopb.image.ProcessImage', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('biopb.image.ProcessImage', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ProcessImage(object):
    """A generic image process protocol that returns a new image. Examples include
    denoising, super-resolution, and semantic segmentation.

    """

    @staticmethod
    def Run(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,
            '/biopb.image.ProcessImage/Run',
            biopb_dot_image_dot_rpc__process__image__pb2.ProcessRequest.SerializeToString,
            biopb_dot_image_dot_rpc__process__image__pb2.ProcessResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RunStream(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(
            request_iterator,
            target,
            '/biopb.image.ProcessImage/RunStream',
            biopb_dot_image_dot_rpc__process__image__pb2.ProcessRequest.SerializeToString,
            biopb_dot_image_dot_rpc__process__image__pb2.ProcessResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetOpNames(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,
            '/biopb.image.ProcessImage/GetOpNames',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            biopb_dot_image_dot_rpc__process__image__pb2.OpNames.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
