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

import simple_chat_pb2 as simple__chat__pb2


class SimpleChatStub(object):
    """Interface exported by the server
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetUsers = channel.unary_unary(
                '/SimpleChat/GetUsers',
                request_serializer=simple__chat__pb2.GetUsersRequest.SerializeToString,
                response_deserializer=simple__chat__pb2.GetUsersResponse.FromString,
                )
        self.SendMessage = channel.unary_unary(
                '/SimpleChat/SendMessage',
                request_serializer=simple__chat__pb2.SendMessageRequest.SerializeToString,
                response_deserializer=simple__chat__pb2.SendMessageResponse.FromString,
                )
        self.ReceiveMessages = channel.unary_stream(
                '/SimpleChat/ReceiveMessages',
                request_serializer=simple__chat__pb2.ReceiveMessagesRequest.SerializeToString,
                response_deserializer=simple__chat__pb2.Message.FromString,
                )


class SimpleChatServicer(object):
    """Interface exported by the server
    """

    def GetUsers(self, request, context):
        """Obtains list of user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendMessage(self, request, context):
        """Send retrieved message to user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReceiveMessages(self, request, context):
        """Subscribe user to receive messages. Results are
        streamed rather than returned at once
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SimpleChatServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetUsers': grpc.unary_unary_rpc_method_handler(
                    servicer.GetUsers,
                    request_deserializer=simple__chat__pb2.GetUsersRequest.FromString,
                    response_serializer=simple__chat__pb2.GetUsersResponse.SerializeToString,
            ),
            'SendMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.SendMessage,
                    request_deserializer=simple__chat__pb2.SendMessageRequest.FromString,
                    response_serializer=simple__chat__pb2.SendMessageResponse.SerializeToString,
            ),
            'ReceiveMessages': grpc.unary_stream_rpc_method_handler(
                    servicer.ReceiveMessages,
                    request_deserializer=simple__chat__pb2.ReceiveMessagesRequest.FromString,
                    response_serializer=simple__chat__pb2.Message.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'SimpleChat', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class SimpleChat(object):
    """Interface exported by the server
    """

    @staticmethod
    def GetUsers(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, '/SimpleChat/GetUsers',
            simple__chat__pb2.GetUsersRequest.SerializeToString,
            simple__chat__pb2.GetUsersResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendMessage(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, '/SimpleChat/SendMessage',
            simple__chat__pb2.SendMessageRequest.SerializeToString,
            simple__chat__pb2.SendMessageResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ReceiveMessages(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, '/SimpleChat/ReceiveMessages',
            simple__chat__pb2.ReceiveMessagesRequest.SerializeToString,
            simple__chat__pb2.Message.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
