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

from . import discussions_pb2 as discussions__pb2


class DiscussionsStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateDiscussion = channel.unary_unary(
                '/org.couchers.api.discussions.Discussions/CreateDiscussion',
                request_serializer=discussions__pb2.CreateDiscussionReq.SerializeToString,
                response_deserializer=discussions__pb2.Discussion.FromString,
                )
        self.GetDiscussion = channel.unary_unary(
                '/org.couchers.api.discussions.Discussions/GetDiscussion',
                request_serializer=discussions__pb2.GetDiscussionReq.SerializeToString,
                response_deserializer=discussions__pb2.Discussion.FromString,
                )


class DiscussionsServicer(object):
    """Missing associated documentation comment in .proto file."""

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

    def GetDiscussion(self, request, context):
        """Retrieve a discussion
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DiscussionsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateDiscussion': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateDiscussion,
                    request_deserializer=discussions__pb2.CreateDiscussionReq.FromString,
                    response_serializer=discussions__pb2.Discussion.SerializeToString,
            ),
            'GetDiscussion': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDiscussion,
                    request_deserializer=discussions__pb2.GetDiscussionReq.FromString,
                    response_serializer=discussions__pb2.Discussion.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'org.couchers.api.discussions.Discussions', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Discussions(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def CreateDiscussion(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, '/org.couchers.api.discussions.Discussions/CreateDiscussion',
            discussions__pb2.CreateDiscussionReq.SerializeToString,
            discussions__pb2.Discussion.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetDiscussion(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, '/org.couchers.api.discussions.Discussions/GetDiscussion',
            discussions__pb2.GetDiscussionReq.SerializeToString,
            discussions__pb2.Discussion.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
