from sqlalchemy import orm
from couchers.context import CouchersContext
"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""

import abc
import collections.abc
import discussions_pb2
import google.protobuf.empty_pb2
import grpc
import grpc.aio
import typing


GRPC_GENERATED_VERSION: str
GRPC_VERSION: str

class DiscussionsStub:
    def __init__(self, channel: grpc.Channel) -> None: ...
    CreateDiscussion: grpc.UnaryUnaryMultiCallable[discussions_pb2.CreateDiscussionReq, discussions_pb2.Discussion]
    """Create a new discussion"""
    GetDiscussion: grpc.UnaryUnaryMultiCallable[discussions_pb2.GetDiscussionReq, discussions_pb2.Discussion]
    """Retrieve a discussion"""
    ListMyCommunitiesDiscussions: grpc.UnaryUnaryMultiCallable[discussions_pb2.ListMyCommunitiesDiscussionsReq, discussions_pb2.ListMyCommunitiesDiscussionsRes]
    """List recent discussions from all communities the user belongs to, newest first"""
    UpdateDiscussion: grpc.UnaryUnaryMultiCallable[discussions_pb2.UpdateDiscussionReq, discussions_pb2.Discussion]
    """Update a discussion; only the creator can edit"""
    DeleteDiscussion: grpc.UnaryUnaryMultiCallable[discussions_pb2.DeleteDiscussionReq, google.protobuf.empty_pb2.Empty]
    """Delete a discussion; creator or community moderator can delete"""

class DiscussionsServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def CreateDiscussion(
        self,
        request: discussions_pb2.CreateDiscussionReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> discussions_pb2.Discussion:
        """Create a new discussion"""

    @abc.abstractmethod
    def GetDiscussion(
        self,
        request: discussions_pb2.GetDiscussionReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> discussions_pb2.Discussion:
        """Retrieve a discussion"""

    @abc.abstractmethod
    def ListMyCommunitiesDiscussions(
        self,
        request: discussions_pb2.ListMyCommunitiesDiscussionsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> discussions_pb2.ListMyCommunitiesDiscussionsRes:
        """List recent discussions from all communities the user belongs to, newest first"""

    @abc.abstractmethod
    def UpdateDiscussion(
        self,
        request: discussions_pb2.UpdateDiscussionReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> discussions_pb2.Discussion:
        """Update a discussion; only the creator can edit"""

    @abc.abstractmethod
    def DeleteDiscussion(
        self,
        request: discussions_pb2.DeleteDiscussionReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> google.protobuf.empty_pb2.Empty:
        """Delete a discussion; creator or community moderator can delete"""

def add_DiscussionsServicer_to_server(servicer: DiscussionsServicer, server: grpc.Server) -> None: ...
