# 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.iam.apikey.v1 import api_pb2 as ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_api__pb2
from ai.stigmer.iam.apikey.v1 import io_pb2 as ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class ApiKeyQueryControllerStub(object):
    """api-key query controller
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.get = channel.unary_unary(
                '/ai.stigmer.iam.apikey.v1.ApiKeyQueryController/get',
                request_serializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeyId.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_api__pb2.ApiKey.FromString,
                _registered_method=True)
        self.getByKeyHash = channel.unary_unary(
                '/ai.stigmer.iam.apikey.v1.ApiKeyQueryController/getByKeyHash',
                request_serializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeyHash.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_api__pb2.ApiKey.FromString,
                _registered_method=True)
        self.findAll = channel.unary_unary(
                '/ai.stigmer.iam.apikey.v1.ApiKeyQueryController/findAll',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeys.FromString,
                _registered_method=True)


class ApiKeyQueryControllerServicer(object):
    """api-key query controller
    """

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

    def getByKeyHash(self, request, context):
        """lookup api-key by hashed key
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def findAll(self, request, context):
        """lookup all api-keys for the identity-account in the auth header.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ApiKeyQueryControllerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeyId.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_api__pb2.ApiKey.SerializeToString,
            ),
            'getByKeyHash': grpc.unary_unary_rpc_method_handler(
                    servicer.getByKeyHash,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeyHash.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_api__pb2.ApiKey.SerializeToString,
            ),
            'findAll': grpc.unary_unary_rpc_method_handler(
                    servicer.findAll,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeys.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ai.stigmer.iam.apikey.v1.ApiKeyQueryController', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('ai.stigmer.iam.apikey.v1.ApiKeyQueryController', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ApiKeyQueryController(object):
    """api-key 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.apikey.v1.ApiKeyQueryController/get',
            ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeyId.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_api__pb2.ApiKey.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getByKeyHash(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.apikey.v1.ApiKeyQueryController/getByKeyHash',
            ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeyHash.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_api__pb2.ApiKey.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def findAll(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.apikey.v1.ApiKeyQueryController/findAll',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_apikey_dot_v1_dot_io__pb2.ApiKeys.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
