# 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.api_user.v1 import api_user_pb2 as meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2
from meshtrade.iam.api_user.v1 import service_pb2 as meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2


class APIUserServiceStub(object):
    """
    APIUserService manages API user lifecycle and authentication credentials.

    API users represent automated clients that can authenticate with API keys
    and perform operations within a specific group context. Each API user has:
    - A unique identifier and display name
    - Group ownership for resource isolation
    - Role-based permissions for authorization
    - Active/inactive state for access control

    All operations require IAM domain permissions and operate within
    the authenticated group context.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetAPIUser = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/GetAPIUser',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.GetAPIUserRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
                _registered_method=True)
        self.CreateAPIUser = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/CreateAPIUser',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.CreateAPIUserRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
                _registered_method=True)
        self.AssignRolesToAPIUser = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/AssignRolesToAPIUser',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRolesToAPIUserRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
                _registered_method=True)
        self.RevokeRolesFromAPIUser = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/RevokeRolesFromAPIUser',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRolesFromAPIUserRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
                _registered_method=True)
        self.ListAPIUsers = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/ListAPIUsers',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ListAPIUsersRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ListAPIUsersResponse.FromString,
                _registered_method=True)
        self.SearchAPIUsers = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/SearchAPIUsers',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.SearchAPIUsersRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.SearchAPIUsersResponse.FromString,
                _registered_method=True)
        self.ActivateAPIUser = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/ActivateAPIUser',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ActivateAPIUserRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
                _registered_method=True)
        self.DeactivateAPIUser = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/DeactivateAPIUser',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.DeactivateAPIUserRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
                _registered_method=True)
        self.GetAPIUserByKeyHash = channel.unary_unary(
                '/meshtrade.iam.api_user.v1.APIUserService/GetAPIUserByKeyHash',
                request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.GetAPIUserByKeyHashRequest.SerializeToString,
                response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
                _registered_method=True)


class APIUserServiceServicer(object):
    """
    APIUserService manages API user lifecycle and authentication credentials.

    API users represent automated clients that can authenticate with API keys
    and perform operations within a specific group context. Each API user has:
    - A unique identifier and display name
    - Group ownership for resource isolation
    - Role-based permissions for authorization
    - Active/inactive state for access control

    All operations require IAM domain permissions and operate within
    the authenticated group context.
    """

    def GetAPIUser(self, request, context):
        """
        Retrieves a single API user by its unique identifier.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateAPIUser(self, request, context):
        """
        Creates a new API user with the specified configuration.

        The API user will be created in the authenticated group context
        and assigned the provided roles. The system generates a unique
        identifier and API key for authentication.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AssignRolesToAPIUser(self, request, context):
        """
        Assign roles to an existing api user within the authenticated group context.

        The role assignment enables the api user to perform operations according
        to the permissions associated with that role within the group hierarchy.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RevokeRolesFromAPIUser(self, request, context):
        """
        Revoke roles from an existing API user within the authenticated group context.

        The role revocation removes the permissions associated with that role from
        the API user within the group hierarchy. The API user will no longer be able
        to perform operations that require the revoked role.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListAPIUsers(self, request, context):
        """
        Lists all API users in the authenticated group context.

        Returns all API users that belong to the current group,
        regardless of their active/inactive state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchAPIUsers(self, request, context):
        """
        Searches API users using display name filtering.

        Performs substring matching on API user display names
        within the authenticated group context.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ActivateAPIUser(self, request, context):
        """
        Activates an API user, enabling API key authentication.

        Changes the API user state to active, allowing the associated
        API key to be used for authentication and authorization.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeactivateAPIUser(self, request, context):
        """
        Deactivates an API user, disabling API key authentication.

        Changes the API user state to inactive, preventing the associated
        API key from being used for authentication.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAPIUserByKeyHash(self, request, context):
        """
        Retrieves an API user using its API key hash.

        This method is used for authentication flows to lookup
        an API user based on the hash of their API key.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_APIUserServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetAPIUser': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAPIUser,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.GetAPIUserRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
            ),
            'CreateAPIUser': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateAPIUser,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.CreateAPIUserRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
            ),
            'AssignRolesToAPIUser': grpc.unary_unary_rpc_method_handler(
                    servicer.AssignRolesToAPIUser,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRolesToAPIUserRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
            ),
            'RevokeRolesFromAPIUser': grpc.unary_unary_rpc_method_handler(
                    servicer.RevokeRolesFromAPIUser,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRolesFromAPIUserRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
            ),
            'ListAPIUsers': grpc.unary_unary_rpc_method_handler(
                    servicer.ListAPIUsers,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ListAPIUsersRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ListAPIUsersResponse.SerializeToString,
            ),
            'SearchAPIUsers': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchAPIUsers,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.SearchAPIUsersRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.SearchAPIUsersResponse.SerializeToString,
            ),
            'ActivateAPIUser': grpc.unary_unary_rpc_method_handler(
                    servicer.ActivateAPIUser,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ActivateAPIUserRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
            ),
            'DeactivateAPIUser': grpc.unary_unary_rpc_method_handler(
                    servicer.DeactivateAPIUser,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.DeactivateAPIUserRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
            ),
            'GetAPIUserByKeyHash': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAPIUserByKeyHash,
                    request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.GetAPIUserByKeyHashRequest.FromString,
                    response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'meshtrade.iam.api_user.v1.APIUserService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('meshtrade.iam.api_user.v1.APIUserService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class APIUserService(object):
    """
    APIUserService manages API user lifecycle and authentication credentials.

    API users represent automated clients that can authenticate with API keys
    and perform operations within a specific group context. Each API user has:
    - A unique identifier and display name
    - Group ownership for resource isolation
    - Role-based permissions for authorization
    - Active/inactive state for access control

    All operations require IAM domain permissions and operate within
    the authenticated group context.
    """

    @staticmethod
    def GetAPIUser(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.api_user.v1.APIUserService/GetAPIUser',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.GetAPIUserRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateAPIUser(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.api_user.v1.APIUserService/CreateAPIUser',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.CreateAPIUserRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AssignRolesToAPIUser(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.api_user.v1.APIUserService/AssignRolesToAPIUser',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRolesToAPIUserRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RevokeRolesFromAPIUser(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.api_user.v1.APIUserService/RevokeRolesFromAPIUser',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRolesFromAPIUserRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListAPIUsers(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.api_user.v1.APIUserService/ListAPIUsers',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ListAPIUsersRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ListAPIUsersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SearchAPIUsers(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.api_user.v1.APIUserService/SearchAPIUsers',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.SearchAPIUsersRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.SearchAPIUsersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ActivateAPIUser(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.api_user.v1.APIUserService/ActivateAPIUser',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.ActivateAPIUserRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeactivateAPIUser(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.api_user.v1.APIUserService/DeactivateAPIUser',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.DeactivateAPIUserRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAPIUserByKeyHash(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.api_user.v1.APIUserService/GetAPIUserByKeyHash',
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.GetAPIUserByKeyHashRequest.SerializeToString,
            meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
