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

from ai.stigmer.commons.apiresource import status_pb2 as ai_dot_stigmer_dot_commons_dot_apiresource_dot_status__pb2
from ai.stigmer.iam.identityaccount.v1 import api_pb2 as ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2
from ai.stigmer.iam.identityaccount.v1 import io_pb2 as ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class IdentityAccountQueryControllerStub(object):
    """identity-account query controller
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.get = channel.unary_unary(
                '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/get',
                request_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountId.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
                _registered_method=True)
        self.whoAmI = channel.unary_unary(
                '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/whoAmI',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
                _registered_method=True)
        self.getByEmail = channel.unary_unary(
                '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/getByEmail',
                request_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountEmail.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
                _registered_method=True)
        self.getByIdpId = channel.unary_unary(
                '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/getByIdpId',
                request_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdpId.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
                _registered_method=True)
        self.getActorInfo = channel.unary_unary(
                '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/getActorInfo',
                request_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountId.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_commons_dot_apiresource_dot_status__pb2.ApiResourceAuditActor.FromString,
                _registered_method=True)


class IdentityAccountQueryControllerServicer(object):
    """identity-account query controller
    """

    def get(self, request, context):
        """lookup identity-account.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def whoAmI(self, request, context):
        """look up identity-account by authentication token.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getByEmail(self, request, context):
        """lookup user-account by identity account email.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getByIdpId(self, request, context):
        """lookup user-account by idp id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getActorInfo(self, request, context):
        """lookup identity-account actor-info (lightweight actor data for audit trail caching)

        This RPC is specifically designed to break circular dependency loops in audit actor resolution.
        When converting IdentityAccount entities to proto responses, the audit info (created_by, updated_by)
        needs actor details. If we use the standard get() RPC, it triggers a full entity-to-proto conversion
        including audit actors, which can create infinite recursion if audit actors reference IdentityAccounts.

        This dedicated endpoint:
        - Returns ONLY the lightweight ApiResourceAuditActor (id + avatar)
        - Does NOT include full audit trail in the response
        - Accesses entity data directly without recursive proto conversion
        - Is used by ApiResourceAuditActorCacheProxy to safely populate Redis cache
        - Prevents StackOverflowError when Redis cache is empty or cleared

        Restricted to platform operators only as this is an internal cache-population mechanism.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_IdentityAccountQueryControllerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountId.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.SerializeToString,
            ),
            'whoAmI': grpc.unary_unary_rpc_method_handler(
                    servicer.whoAmI,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.SerializeToString,
            ),
            'getByEmail': grpc.unary_unary_rpc_method_handler(
                    servicer.getByEmail,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountEmail.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.SerializeToString,
            ),
            'getByIdpId': grpc.unary_unary_rpc_method_handler(
                    servicer.getByIdpId,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdpId.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.SerializeToString,
            ),
            'getActorInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.getActorInfo,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountId.FromString,
                    response_serializer=ai_dot_stigmer_dot_commons_dot_apiresource_dot_status__pb2.ApiResourceAuditActor.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class IdentityAccountQueryController(object):
    """identity-account query controller
    """

    @staticmethod
    def get(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,
            '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/get',
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountId.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def whoAmI(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,
            '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/whoAmI',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getByEmail(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,
            '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/getByEmail',
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountEmail.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getByIdpId(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,
            '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/getByIdpId',
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdpId.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_api__pb2.IdentityAccount.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getActorInfo(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,
            '/ai.stigmer.iam.identityaccount.v1.IdentityAccountQueryController/getActorInfo',
            ai_dot_stigmer_dot_iam_dot_identityaccount_dot_v1_dot_io__pb2.IdentityAccountId.SerializeToString,
            ai_dot_stigmer_dot_commons_dot_apiresource_dot_status__pb2.ApiResourceAuditActor.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
