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

from cerbos.cloud.apikey.v1 import apikey_pb2 as cerbos_dot_cloud_dot_apikey_dot_v1_dot_apikey__pb2


class ApiKeyServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.IssueAccessToken = channel.unary_unary(
                '/cerbos.cloud.apikey.v1.ApiKeyService/IssueAccessToken',
                request_serializer=cerbos_dot_cloud_dot_apikey_dot_v1_dot_apikey__pb2.IssueAccessTokenRequest.SerializeToString,
                response_deserializer=cerbos_dot_cloud_dot_apikey_dot_v1_dot_apikey__pb2.IssueAccessTokenResponse.FromString,
                _registered_method=True)


class ApiKeyServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def IssueAccessToken(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ApiKeyServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'IssueAccessToken': grpc.unary_unary_rpc_method_handler(
                    servicer.IssueAccessToken,
                    request_deserializer=cerbos_dot_cloud_dot_apikey_dot_v1_dot_apikey__pb2.IssueAccessTokenRequest.FromString,
                    response_serializer=cerbos_dot_cloud_dot_apikey_dot_v1_dot_apikey__pb2.IssueAccessTokenResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cerbos.cloud.apikey.v1.ApiKeyService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('cerbos.cloud.apikey.v1.ApiKeyService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ApiKeyService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def IssueAccessToken(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,
            '/cerbos.cloud.apikey.v1.ApiKeyService/IssueAccessToken',
            cerbos_dot_cloud_dot_apikey_dot_v1_dot_apikey__pb2.IssueAccessTokenRequest.SerializeToString,
            cerbos_dot_cloud_dot_apikey_dot_v1_dot_apikey__pb2.IssueAccessTokenResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
