# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from meshtrade.iam.group.v1 import group_pb2 as meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2
from meshtrade.iam.group.v1 import service_pb2 as meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2


class GroupServiceStub(object):
    """
    GroupService manages organizational group hierarchy and lifecycle operations.

    Groups are the fundamental multi-tenancy units in Mesh that own resources,
    define permission boundaries, and enable hierarchical access control.
    Each group can own sub-groups, users, API users, and platform resources,
    forming tree structures for inherited permissions and resource isolation.

    All operations are scoped to the authenticated group's hierarchy and
    require appropriate IAM domain permissions.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.CreateGroup = channel.unary_unary(
                '/meshtrade.iam.group.v1.GroupService/CreateGroup',
                request_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.CreateGroupRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.FromString,
                _registered_method=True)
        self.UpdateGroup = channel.unary_unary(
                '/meshtrade.iam.group.v1.GroupService/UpdateGroup',
                request_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.UpdateGroupRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.FromString,
                _registered_method=True)
        self.ListGroups = channel.unary_unary(
                '/meshtrade.iam.group.v1.GroupService/ListGroups',
                request_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.ListGroupsRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.ListGroupsResponse.FromString,
                _registered_method=True)
        self.SearchGroups = channel.unary_unary(
                '/meshtrade.iam.group.v1.GroupService/SearchGroups',
                request_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.SearchGroupsRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.SearchGroupsResponse.FromString,
                _registered_method=True)
        self.GetGroup = channel.unary_unary(
                '/meshtrade.iam.group.v1.GroupService/GetGroup',
                request_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.GetGroupRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.FromString,
                _registered_method=True)


class GroupServiceServicer(object):
    """
    GroupService manages organizational group hierarchy and lifecycle operations.

    Groups are the fundamental multi-tenancy units in Mesh that own resources,
    define permission boundaries, and enable hierarchical access control.
    Each group can own sub-groups, users, API users, and platform resources,
    forming tree structures for inherited permissions and resource isolation.

    All operations are scoped to the authenticated group's hierarchy and
    require appropriate IAM domain permissions.
    """

    def CreateGroup(self, request, context):
        """
        Creates a new child group within the authenticated group's hierarchy.

        The new group inherits access from its parent and becomes part of the
        organizational structure. Group ownership must match the executing context.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateGroup(self, request, context):
        """
        Updates an existing group's display name and description metadata.

        Only mutable fields can be modified while preserving the group's
        identity and ownership within the hierarchy.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListGroups(self, request, context):
        """
        Retrieves all groups within the authenticated group's hierarchical scope.

        Returns the complete organizational structure accessible to the executing
        context, including the root group and all descendant groups.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchGroups(self, request, context):
        """
        Searches groups using flexible text criteria within the hierarchy.

        Performs case-insensitive substring matching on display names and
        descriptions using OR logic across search terms.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetGroup(self, request, context):
        """
        Retrieves a specific group by its resource identifier within the hierarchy.

        Provides access to a single group's complete metadata and organizational
        context if accessible within the executing group's scope.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GroupServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateGroup': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateGroup,
                    request_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.CreateGroupRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.SerializeToString,
            ),
            'UpdateGroup': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateGroup,
                    request_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.UpdateGroupRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.SerializeToString,
            ),
            'ListGroups': grpc.unary_unary_rpc_method_handler(
                    servicer.ListGroups,
                    request_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.ListGroupsRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.ListGroupsResponse.SerializeToString,
            ),
            'SearchGroups': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchGroups,
                    request_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.SearchGroupsRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.SearchGroupsResponse.SerializeToString,
            ),
            'GetGroup': grpc.unary_unary_rpc_method_handler(
                    servicer.GetGroup,
                    request_deserializer=meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.GetGroupRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'meshtrade.iam.group.v1.GroupService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('meshtrade.iam.group.v1.GroupService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class GroupService(object):
    """
    GroupService manages organizational group hierarchy and lifecycle operations.

    Groups are the fundamental multi-tenancy units in Mesh that own resources,
    define permission boundaries, and enable hierarchical access control.
    Each group can own sub-groups, users, API users, and platform resources,
    forming tree structures for inherited permissions and resource isolation.

    All operations are scoped to the authenticated group's hierarchy and
    require appropriate IAM domain permissions.
    """

    @staticmethod
    def CreateGroup(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.iam.group.v1.GroupService/CreateGroup',
            meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.CreateGroupRequest.SerializeToString,
            meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateGroup(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.iam.group.v1.GroupService/UpdateGroup',
            meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.UpdateGroupRequest.SerializeToString,
            meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListGroups(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.iam.group.v1.GroupService/ListGroups',
            meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.ListGroupsRequest.SerializeToString,
            meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.ListGroupsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SearchGroups(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.iam.group.v1.GroupService/SearchGroups',
            meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.SearchGroupsRequest.SerializeToString,
            meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.SearchGroupsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetGroup(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.iam.group.v1.GroupService/GetGroup',
            meshtrade_dot_iam_dot_group_dot_v1_dot_service__pb2.GetGroupRequest.SerializeToString,
            meshtrade_dot_iam_dot_group_dot_v1_dot_group__pb2.Group.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
