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


GRPC_GENERATED_VERSION: str
GRPC_VERSION: str

class CommunitiesStub:
    def __init__(self, channel: grpc.Channel) -> None: ...
    GetCommunity: grpc.UnaryUnaryMultiCallable[communities_pb2.GetCommunityReq, communities_pb2.Community]
    """Get info about a Community"""
    ListCommunities: grpc.UnaryUnaryMultiCallable[communities_pb2.ListCommunitiesReq, communities_pb2.ListCommunitiesRes]
    """Gets a paginated list of sub-communities associated with a community"""
    ListGroups: grpc.UnaryUnaryMultiCallable[communities_pb2.ListGroupsReq, communities_pb2.ListGroupsRes]
    """Gets a paginated list of groups associated with a community"""
    ListAdmins: grpc.UnaryUnaryMultiCallable[communities_pb2.ListAdminsReq, communities_pb2.ListAdminsRes]
    """Gets a paginated list of community admins only"""
    AddAdmin: grpc.UnaryUnaryMultiCallable[communities_pb2.AddAdminReq, google.protobuf.empty_pb2.Empty]
    """Makes a user a community builder

    Raises: FAILED_PRECONDITION if
      1. the active user cannot moderate the community node
      2. the specified user is already an admin of the community
      3. the specified user is not a member of the community
    """
    RemoveAdmin: grpc.UnaryUnaryMultiCallable[communities_pb2.RemoveAdminReq, google.protobuf.empty_pb2.Empty]
    """Removes user as community builder

    Raises: FAILED_PRECONDITION if
      1. the active user cannot moderate the community node
      2. the specified user is not an admin of the community
    """
    ListMembers: grpc.UnaryUnaryMultiCallable[communities_pb2.ListMembersReq, communities_pb2.ListMembersRes]
    """Gets a paginated list of community members, including admins"""
    ListNearbyUsers: grpc.UnaryUnaryMultiCallable[communities_pb2.ListNearbyUsersReq, communities_pb2.ListNearbyUsersRes]
    """Gets a paginated list of users who live within the polygon of the community"""
    ListPlaces: grpc.UnaryUnaryMultiCallable[communities_pb2.ListPlacesReq, communities_pb2.ListPlacesRes]
    """Returns a paginated list of places associated with a community"""
    ListGuides: grpc.UnaryUnaryMultiCallable[communities_pb2.ListGuidesReq, communities_pb2.ListGuidesRes]
    """Returns a paginated list of guides associated with a community"""
    ListEvents: grpc.UnaryUnaryMultiCallable[communities_pb2.ListEventsReq, communities_pb2.ListEventsRes]
    """Returns a paginated list of events associated with a community"""
    ListDiscussions: grpc.UnaryUnaryMultiCallable[communities_pb2.ListDiscussionsReq, communities_pb2.ListDiscussionsRes]
    """Returns a paginated list of discussions associated with a community"""
    JoinCommunity: grpc.UnaryUnaryMultiCallable[communities_pb2.JoinCommunityReq, google.protobuf.empty_pb2.Empty]
    """Join a community you're not a part of

    Raises: FAILED_PRECONDITION if the user is already part of the community
    """
    LeaveCommunity: grpc.UnaryUnaryMultiCallable[communities_pb2.LeaveCommunityReq, google.protobuf.empty_pb2.Empty]
    """Leave a community that you're not inside.
    You cannot leave a community that you live inside.

    Raises: FAILED_PRECONDITION if the user is not part of the community or if their location is within the community
    """
    ListUserCommunities: grpc.UnaryUnaryMultiCallable[communities_pb2.ListUserCommunitiesReq, communities_pb2.ListUserCommunitiesRes]
    """Gets a list of communities a member belongs to"""
    SearchCommunities: grpc.UnaryUnaryMultiCallable[communities_pb2.SearchCommunitiesReq, communities_pb2.SearchCommunitiesRes]
    """Gets a list of communities in accordance to search request"""
    ListAllCommunities: grpc.UnaryUnaryMultiCallable[communities_pb2.ListAllCommunitiesReq, communities_pb2.ListAllCommunitiesRes]
    """Gets a list of all communities, ordered hierarchically"""
    ListRecentCommunities: grpc.UnaryUnaryMultiCallable[communities_pb2.ListRecentCommunitiesReq, communities_pb2.ListRecentCommunitiesRes]
    """Gets the most recently created communities across the whole tree, ordered newest-first"""

class CommunitiesServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def GetCommunity(
        self,
        request: communities_pb2.GetCommunityReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.Community:
        """Get info about a Community"""

    @abc.abstractmethod
    def ListCommunities(
        self,
        request: communities_pb2.ListCommunitiesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListCommunitiesRes:
        """Gets a paginated list of sub-communities associated with a community"""

    @abc.abstractmethod
    def ListGroups(
        self,
        request: communities_pb2.ListGroupsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListGroupsRes:
        """Gets a paginated list of groups associated with a community"""

    @abc.abstractmethod
    def ListAdmins(
        self,
        request: communities_pb2.ListAdminsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListAdminsRes:
        """Gets a paginated list of community admins only"""

    @abc.abstractmethod
    def AddAdmin(
        self,
        request: communities_pb2.AddAdminReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> google.protobuf.empty_pb2.Empty:
        """Makes a user a community builder

        Raises: FAILED_PRECONDITION if
          1. the active user cannot moderate the community node
          2. the specified user is already an admin of the community
          3. the specified user is not a member of the community
        """

    @abc.abstractmethod
    def RemoveAdmin(
        self,
        request: communities_pb2.RemoveAdminReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> google.protobuf.empty_pb2.Empty:
        """Removes user as community builder

        Raises: FAILED_PRECONDITION if
          1. the active user cannot moderate the community node
          2. the specified user is not an admin of the community
        """

    @abc.abstractmethod
    def ListMembers(
        self,
        request: communities_pb2.ListMembersReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListMembersRes:
        """Gets a paginated list of community members, including admins"""

    @abc.abstractmethod
    def ListNearbyUsers(
        self,
        request: communities_pb2.ListNearbyUsersReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListNearbyUsersRes:
        """Gets a paginated list of users who live within the polygon of the community"""

    @abc.abstractmethod
    def ListPlaces(
        self,
        request: communities_pb2.ListPlacesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListPlacesRes:
        """Returns a paginated list of places associated with a community"""

    @abc.abstractmethod
    def ListGuides(
        self,
        request: communities_pb2.ListGuidesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListGuidesRes:
        """Returns a paginated list of guides associated with a community"""

    @abc.abstractmethod
    def ListEvents(
        self,
        request: communities_pb2.ListEventsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListEventsRes:
        """Returns a paginated list of events associated with a community"""

    @abc.abstractmethod
    def ListDiscussions(
        self,
        request: communities_pb2.ListDiscussionsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListDiscussionsRes:
        """Returns a paginated list of discussions associated with a community"""

    @abc.abstractmethod
    def JoinCommunity(
        self,
        request: communities_pb2.JoinCommunityReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> google.protobuf.empty_pb2.Empty:
        """Join a community you're not a part of

        Raises: FAILED_PRECONDITION if the user is already part of the community
        """

    @abc.abstractmethod
    def LeaveCommunity(
        self,
        request: communities_pb2.LeaveCommunityReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> google.protobuf.empty_pb2.Empty:
        """Leave a community that you're not inside.
        You cannot leave a community that you live inside.

        Raises: FAILED_PRECONDITION if the user is not part of the community or if their location is within the community
        """

    @abc.abstractmethod
    def ListUserCommunities(
        self,
        request: communities_pb2.ListUserCommunitiesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListUserCommunitiesRes:
        """Gets a list of communities a member belongs to"""

    @abc.abstractmethod
    def SearchCommunities(
        self,
        request: communities_pb2.SearchCommunitiesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.SearchCommunitiesRes:
        """Gets a list of communities in accordance to search request"""

    @abc.abstractmethod
    def ListAllCommunities(
        self,
        request: communities_pb2.ListAllCommunitiesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListAllCommunitiesRes:
        """Gets a list of all communities, ordered hierarchically"""

    @abc.abstractmethod
    def ListRecentCommunities(
        self,
        request: communities_pb2.ListRecentCommunitiesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> communities_pb2.ListRecentCommunitiesRes:
        """Gets the most recently created communities across the whole tree, ordered newest-first"""

def add_CommunitiesServicer_to_server(servicer: CommunitiesServicer, server: grpc.Server) -> None: ...
