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

from . import callback_pb2 as pulumi_dot_callback__pb2


class CallbacksStub(object):
    """Callbacks is a service for invoking functions in one runtime from other processes.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Invoke = channel.unary_unary(
                '/pulumirpc.Callbacks/Invoke',
                request_serializer=pulumi_dot_callback__pb2.CallbackInvokeRequest.SerializeToString,
                response_deserializer=pulumi_dot_callback__pb2.CallbackInvokeResponse.FromString,
                )


class CallbacksServicer(object):
    """Callbacks is a service for invoking functions in one runtime from other processes.
    """

    def Invoke(self, request, context):
        """Invoke invokes a given callback, identified by its token.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_CallbacksServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Invoke': grpc.unary_unary_rpc_method_handler(
                    servicer.Invoke,
                    request_deserializer=pulumi_dot_callback__pb2.CallbackInvokeRequest.FromString,
                    response_serializer=pulumi_dot_callback__pb2.CallbackInvokeResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'pulumirpc.Callbacks', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Callbacks(object):
    """Callbacks is a service for invoking functions in one runtime from other processes.
    """

    @staticmethod
    def Invoke(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, '/pulumirpc.Callbacks/Invoke',
            pulumi_dot_callback__pb2.CallbackInvokeRequest.SerializeToString,
            pulumi_dot_callback__pb2.CallbackInvokeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
