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 google.protobuf.empty_pb2
import grpc
import grpc.aio
import threads_pb2
import typing


GRPC_GENERATED_VERSION: str
GRPC_VERSION: str

class ThreadsStub:
    def __init__(self, channel: grpc.Channel) -> None: ...
    GetThread: grpc.UnaryUnaryMultiCallable[threads_pb2.GetThreadReq, threads_pb2.GetThreadRes]
    """The same API is used regardless of level. All posts are using the same id namespace.

    Get non-deleted posts belonging to a thread, sorted in reverse time order.
    """
    PostReply: grpc.UnaryUnaryMultiCallable[threads_pb2.PostReplyReq, threads_pb2.PostReplyRes]
    """Post a new comment on a thread. The post can not be changed or deleted after posting.
    Throws NOT_FOUND if thread_id corresponds to a nesting level 3 reply, since no futher nesting is allowed.
    """
    UpdateReply: grpc.UnaryUnaryMultiCallable[threads_pb2.UpdateReplyReq, threads_pb2.Reply]
    """Update a comment/reply; only the author can edit."""
    DeleteReply: grpc.UnaryUnaryMultiCallable[threads_pb2.DeleteReplyReq, google.protobuf.empty_pb2.Empty]
    """Delete a comment/reply; only the author can delete."""

class ThreadsServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def GetThread(
        self,
        request: threads_pb2.GetThreadReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> threads_pb2.GetThreadRes:
        """The same API is used regardless of level. All posts are using the same id namespace.

        Get non-deleted posts belonging to a thread, sorted in reverse time order.
        """

    @abc.abstractmethod
    def PostReply(
        self,
        request: threads_pb2.PostReplyReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> threads_pb2.PostReplyRes:
        """Post a new comment on a thread. The post can not be changed or deleted after posting.
        Throws NOT_FOUND if thread_id corresponds to a nesting level 3 reply, since no futher nesting is allowed.
        """

    @abc.abstractmethod
    def UpdateReply(
        self,
        request: threads_pb2.UpdateReplyReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> threads_pb2.Reply:
        """Update a comment/reply; only the author can edit."""

    @abc.abstractmethod
    def DeleteReply(
        self,
        request: threads_pb2.DeleteReplyReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> google.protobuf.empty_pb2.Empty:
        """Delete a comment/reply; only the author can delete."""

def add_ThreadsServicer_to_server(servicer: ThreadsServicer, server: grpc.Server) -> None: ...
