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 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 CommunitiesServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def GetCommunity(
        self,
        request: communities_pb2.GetCommunityReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[communities_pb2.Community, collections.abc.Awaitable[communities_pb2.Community]]:
        """Get info about a Community"""

    @abc.abstractmethod
    def ListCommunities(
        self,
        request: communities_pb2.ListCommunitiesReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[communities_pb2.ListCommunitiesRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListGroupsRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListAdminsRes, collections.abc.Awaitable[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,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[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,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListMembersRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListNearbyUsersRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListPlacesRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListGuidesRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListEventsRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListDiscussionsRes, collections.abc.Awaitable[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,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[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,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListUserCommunitiesRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.SearchCommunitiesRes, collections.abc.Awaitable[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,
    ) -> typing.Union[communities_pb2.ListAllCommunitiesRes, collections.abc.Awaitable[communities_pb2.ListAllCommunitiesRes]]:
        """Gets a list of all communities, ordered hierarchically"""

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