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 typing


GRPC_GENERATED_VERSION: str
GRPC_VERSION: str

class ConversationsStub:
    def __init__(self, channel: grpc.Channel) -> None: ...
    ListGroupChats: grpc.UnaryUnaryMultiCallable[conversations_pb2.ListGroupChatsReq, conversations_pb2.ListGroupChatsRes]
    """Retrieves list of group chats (ordered by last message), paginated"""
    GetGroupChat: grpc.UnaryUnaryMultiCallable[conversations_pb2.GetGroupChatReq, conversations_pb2.GroupChat]
    """Retrieves group chat info by id"""
    GetDirectMessage: grpc.UnaryUnaryMultiCallable[conversations_pb2.GetDirectMessageReq, 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
    """
    GetUpdates: grpc.UnaryUnaryMultiCallable[conversations_pb2.GetUpdatesReq, conversations_pb2.GetUpdatesRes]
    """Returns all new messages (aka updates) since a given message id"""
    GetGroupChatMessages: grpc.UnaryUnaryMultiCallable[conversations_pb2.GetGroupChatMessagesReq, conversations_pb2.GetGroupChatMessagesRes]
    """Retrieves messages in group chat, paginated"""
    MarkLastSeenGroupChat: grpc.UnaryUnaryMultiCallable[conversations_pb2.MarkLastSeenGroupChatReq, google.protobuf.empty_pb2.Empty]
    """Marks the last message that has been seen in this group chat"""
    MuteGroupChat: grpc.UnaryUnaryMultiCallable[conversations_pb2.MuteGroupChatReq, google.protobuf.empty_pb2.Empty]
    """Mutes or unmutes a group chat
    when muted, you don't get notifications from that group chat
    """
    SetGroupChatArchiveStatus: grpc.UnaryUnaryMultiCallable[conversations_pb2.SetGroupChatArchiveStatusReq, conversations_pb2.SetGroupChatArchiveStatusRes]
    """Archives or unarchives a group chat"""
    CreateGroupChat: grpc.UnaryUnaryMultiCallable[conversations_pb2.CreateGroupChatReq, conversations_pb2.GroupChat]
    """Creates a new group chat"""
    EditGroupChat: grpc.UnaryUnaryMultiCallable[conversations_pb2.EditGroupChatReq, google.protobuf.empty_pb2.Empty]
    """Modifies group chat"""
    InviteToGroupChat: grpc.UnaryUnaryMultiCallable[conversations_pb2.InviteToGroupChatReq, google.protobuf.empty_pb2.Empty]
    """Invite a person to a chat"""
    MakeGroupChatAdmin: grpc.UnaryUnaryMultiCallable[conversations_pb2.MakeGroupChatAdminReq, google.protobuf.empty_pb2.Empty]
    """Make a user an admin of a group chat"""
    RemoveGroupChatUser: grpc.UnaryUnaryMultiCallable[conversations_pb2.RemoveGroupChatUserReq, google.protobuf.empty_pb2.Empty]
    """Remove a user in a group chat."""
    RemoveGroupChatAdmin: grpc.UnaryUnaryMultiCallable[conversations_pb2.RemoveGroupChatAdminReq, google.protobuf.empty_pb2.Empty]
    """Remove a user from admin in group chat. TODO: Only original creator can do this"""
    SendMessage: grpc.UnaryUnaryMultiCallable[conversations_pb2.SendMessageReq, google.protobuf.empty_pb2.Empty]
    """Send a message to a group chat"""
    SendDirectMessage: grpc.UnaryUnaryMultiCallable[conversations_pb2.SendDirectMessageReq, conversations_pb2.SendDirectMessageRes]
    """Sends a direct message by either creating or using an existing DM chat"""
    LeaveGroupChat: grpc.UnaryUnaryMultiCallable[conversations_pb2.LeaveGroupChatReq, google.protobuf.empty_pb2.Empty]
    """Leave a group chat"""
    SearchMessages: grpc.UnaryUnaryMultiCallable[conversations_pb2.SearchMessagesReq, conversations_pb2.SearchMessagesRes]
    """Search messages by string"""

class ConversationsServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def ListGroupChats(
        self,
        request: conversations_pb2.ListGroupChatsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> 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,
    ) -> conversations_pb2.GroupChat:
        """Retrieves group chat info by id"""

    @abc.abstractmethod
    def GetDirectMessage(
        self,
        request: conversations_pb2.GetDirectMessageReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> 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,
    ) -> 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,
    ) -> conversations_pb2.GetGroupChatMessagesRes:
        """Retrieves messages in group chat, paginated"""

    @abc.abstractmethod
    def MarkLastSeenGroupChat(
        self,
        request: conversations_pb2.MarkLastSeenGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> 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,
    ) -> 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 SetGroupChatArchiveStatus(
        self,
        request: conversations_pb2.SetGroupChatArchiveStatusReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> conversations_pb2.SetGroupChatArchiveStatusRes:
        """Archives or unarchives a group chat"""

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

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

    @abc.abstractmethod
    def InviteToGroupChat(
        self,
        request: conversations_pb2.InviteToGroupChatReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> 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,
    ) -> 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,
    ) -> 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,
    ) -> 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,
    ) -> 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,
    ) -> 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,
    ) -> google.protobuf.empty_pb2.Empty:
        """Leave a group chat"""

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

def add_ConversationsServicer_to_server(servicer: ConversationsServicer, server: grpc.Server) -> None: ...
