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

if sys.version_info >= (3, 13):
    import typing as typing_extensions
else:
    import typing_extensions

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext):  # type: ignore[misc, type-arg]
    ...

GRPC_GENERATED_VERSION: str
GRPC_VERSION: str
class ConversationsServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def ListGroupChats(
        self,
        request: conversations_pb2.ListGroupChatsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.ListGroupChatsRes, collections.abc.Awaitable[conversations_pb2.ListGroupChatsRes]]:
        """Retrieves list of group chats (ordered by last message), paginated"""

    @abc.abstractmethod
    def GetGroupChat(
        self,
        request: conversations_pb2.GetGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.GroupChat, collections.abc.Awaitable[conversations_pb2.GroupChat]]:
        """Retrieves group chat info by id"""

    @abc.abstractmethod
    def GetDirectMessage(
        self,
        request: conversations_pb2.GetDirectMessageReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.GroupChat, collections.abc.Awaitable[conversations_pb2.GroupChat]]:
        """Retrieves group chat info for the unique (if any) direct message with a
        given user

        Raises: NOT_FOUND if there is no such direct message thread
        """

    @abc.abstractmethod
    def GetUpdates(
        self,
        request: conversations_pb2.GetUpdatesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.GetUpdatesRes, collections.abc.Awaitable[conversations_pb2.GetUpdatesRes]]:
        """Returns all new messages (aka updates) since a given message id"""

    @abc.abstractmethod
    def GetGroupChatMessages(
        self,
        request: conversations_pb2.GetGroupChatMessagesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.GetGroupChatMessagesRes, collections.abc.Awaitable[conversations_pb2.GetGroupChatMessagesRes]]:
        """Retrieves messages in group chat, paginated"""

    @abc.abstractmethod
    def MarkLastSeenGroupChat(
        self,
        request: conversations_pb2.MarkLastSeenGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Marks the last message that has been seen in this group chat"""

    @abc.abstractmethod
    def MuteGroupChat(
        self,
        request: conversations_pb2.MuteGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Mutes or unmutes a group chat
        when muted, you don't get notifications from that group chat
        """

    @abc.abstractmethod
    def CreateGroupChat(
        self,
        request: conversations_pb2.CreateGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.GroupChat, collections.abc.Awaitable[conversations_pb2.GroupChat]]:
        """Creates a new group chat"""

    @abc.abstractmethod
    def EditGroupChat(
        self,
        request: conversations_pb2.EditGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Modifies group chat"""

    @abc.abstractmethod
    def InviteToGroupChat(
        self,
        request: conversations_pb2.InviteToGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Invite a person to a chat"""

    @abc.abstractmethod
    def MakeGroupChatAdmin(
        self,
        request: conversations_pb2.MakeGroupChatAdminReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Make a user an admin of a group chat"""

    @abc.abstractmethod
    def RemoveGroupChatUser(
        self,
        request: conversations_pb2.RemoveGroupChatUserReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Remove a user in a group chat."""

    @abc.abstractmethod
    def RemoveGroupChatAdmin(
        self,
        request: conversations_pb2.RemoveGroupChatAdminReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Remove a user from admin in group chat. TODO: Only original creator can do this"""

    @abc.abstractmethod
    def SendMessage(
        self,
        request: conversations_pb2.SendMessageReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Send a message to a group chat"""

    @abc.abstractmethod
    def SendDirectMessage(
        self,
        request: conversations_pb2.SendDirectMessageReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.SendDirectMessageRes, collections.abc.Awaitable[conversations_pb2.SendDirectMessageRes]]:
        """Sends a direct message by either creating or using an existing DM chat"""

    @abc.abstractmethod
    def LeaveGroupChat(
        self,
        request: conversations_pb2.LeaveGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[google.protobuf.empty_pb2.Empty]]:
        """Leave a group chat"""

    @abc.abstractmethod
    def SearchMessages(
        self,
        request: conversations_pb2.SearchMessagesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[conversations_pb2.SearchMessagesRes, collections.abc.Awaitable[conversations_pb2.SearchMessagesRes]]:
        """Search messages by string"""

def add_ConversationsServicer_to_server(servicer: ConversationsServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
