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

from avikom.vision import image_info_pb2 as avikom_dot_vision_dot_image__info__pb2
from avikom.vision import image_pb2 as avikom_dot_vision_dot_image__pb2


class ImageServiceStub(object):
    """*
    Streams images and videos. An `ImageStream` will send images until the stream is closed by the client.
    Images are streamed in data chunks where the first chunk of each image is marked by `Image.info`.
    Every following chunk will have the `Imaga.data` field set until the next image starts.
    @author: Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetImage = channel.unary_stream(
                '/avikom.vision.ImageService/GetImage',
                request_serializer=avikom_dot_vision_dot_image__info__pb2.ImageInfo.SerializeToString,
                response_deserializer=avikom_dot_vision_dot_image__pb2.Image.FromString,
                )
        self.GetVideo = channel.unary_stream(
                '/avikom.vision.ImageService/GetVideo',
                request_serializer=avikom_dot_vision_dot_image__info__pb2.ImageInfo.SerializeToString,
                response_deserializer=avikom_dot_vision_dot_image__pb2.Image.FromString,
                )


class ImageServiceServicer(object):
    """*
    Streams images and videos. An `ImageStream` will send images until the stream is closed by the client.
    Images are streamed in data chunks where the first chunk of each image is marked by `Image.info`.
    Every following chunk will have the `Imaga.data` field set until the next image starts.
    @author: Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    def GetImage(self, request, context):
        """/ returns an image and closes the connection aftewards
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetVideo(self, request, context):
        """/ returns a series of image where each new image will be prepend with an `ImageInfo`
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ImageServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetImage': grpc.unary_stream_rpc_method_handler(
                    servicer.GetImage,
                    request_deserializer=avikom_dot_vision_dot_image__info__pb2.ImageInfo.FromString,
                    response_serializer=avikom_dot_vision_dot_image__pb2.Image.SerializeToString,
            ),
            'GetVideo': grpc.unary_stream_rpc_method_handler(
                    servicer.GetVideo,
                    request_deserializer=avikom_dot_vision_dot_image__info__pb2.ImageInfo.FromString,
                    response_serializer=avikom_dot_vision_dot_image__pb2.Image.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'avikom.vision.ImageService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ImageService(object):
    """*
    Streams images and videos. An `ImageStream` will send images until the stream is closed by the client.
    Images are streamed in data chunks where the first chunk of each image is marked by `Image.info`.
    Every following chunk will have the `Imaga.data` field set until the next image starts.
    @author: Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    @staticmethod
    def GetImage(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_stream(request, target, '/avikom.vision.ImageService/GetImage',
            avikom_dot_vision_dot_image__info__pb2.ImageInfo.SerializeToString,
            avikom_dot_vision_dot_image__pb2.Image.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetVideo(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_stream(request, target, '/avikom.vision.ImageService/GetVideo',
            avikom_dot_vision_dot_image__info__pb2.ImageInfo.SerializeToString,
            avikom_dot_vision_dot_image__pb2.Image.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
