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

from . import consumer_service_pb2 as consumer__service__pb2


class ConsumerApiStub(object):
    """Manages consumers that ingest data from Kafka
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.create_consumer = channel.unary_unary(
                '/summa.proto.ConsumerApi/create_consumer',
                request_serializer=consumer__service__pb2.CreateConsumerRequest.SerializeToString,
                response_deserializer=consumer__service__pb2.CreateConsumerResponse.FromString,
                )
        self.get_consumer = channel.unary_unary(
                '/summa.proto.ConsumerApi/get_consumer',
                request_serializer=consumer__service__pb2.GetConsumerRequest.SerializeToString,
                response_deserializer=consumer__service__pb2.GetConsumerResponse.FromString,
                )
        self.get_consumers = channel.unary_unary(
                '/summa.proto.ConsumerApi/get_consumers',
                request_serializer=consumer__service__pb2.GetConsumersRequest.SerializeToString,
                response_deserializer=consumer__service__pb2.GetConsumersResponse.FromString,
                )
        self.delete_consumer = channel.unary_unary(
                '/summa.proto.ConsumerApi/delete_consumer',
                request_serializer=consumer__service__pb2.DeleteConsumerRequest.SerializeToString,
                response_deserializer=consumer__service__pb2.DeleteConsumerResponse.FromString,
                )


class ConsumerApiServicer(object):
    """Manages consumers that ingest data from Kafka
    """

    def create_consumer(self, request, context):
        """Create a new consumer
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get_consumer(self, request, context):
        """Get a single consumer
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get_consumers(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete_consumer(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ConsumerApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create_consumer': grpc.unary_unary_rpc_method_handler(
                    servicer.create_consumer,
                    request_deserializer=consumer__service__pb2.CreateConsumerRequest.FromString,
                    response_serializer=consumer__service__pb2.CreateConsumerResponse.SerializeToString,
            ),
            'get_consumer': grpc.unary_unary_rpc_method_handler(
                    servicer.get_consumer,
                    request_deserializer=consumer__service__pb2.GetConsumerRequest.FromString,
                    response_serializer=consumer__service__pb2.GetConsumerResponse.SerializeToString,
            ),
            'get_consumers': grpc.unary_unary_rpc_method_handler(
                    servicer.get_consumers,
                    request_deserializer=consumer__service__pb2.GetConsumersRequest.FromString,
                    response_serializer=consumer__service__pb2.GetConsumersResponse.SerializeToString,
            ),
            'delete_consumer': grpc.unary_unary_rpc_method_handler(
                    servicer.delete_consumer,
                    request_deserializer=consumer__service__pb2.DeleteConsumerRequest.FromString,
                    response_serializer=consumer__service__pb2.DeleteConsumerResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'summa.proto.ConsumerApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ConsumerApi(object):
    """Manages consumers that ingest data from Kafka
    """

    @staticmethod
    def create_consumer(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, '/summa.proto.ConsumerApi/create_consumer',
            consumer__service__pb2.CreateConsumerRequest.SerializeToString,
            consumer__service__pb2.CreateConsumerResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get_consumer(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, '/summa.proto.ConsumerApi/get_consumer',
            consumer__service__pb2.GetConsumerRequest.SerializeToString,
            consumer__service__pb2.GetConsumerResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get_consumers(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, '/summa.proto.ConsumerApi/get_consumers',
            consumer__service__pb2.GetConsumersRequest.SerializeToString,
            consumer__service__pb2.GetConsumersResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def delete_consumer(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, '/summa.proto.ConsumerApi/delete_consumer',
            consumer__service__pb2.DeleteConsumerRequest.SerializeToString,
            consumer__service__pb2.DeleteConsumerResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
