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

from canvas_generated.messages import events_pb2 as canvas__generated_dot_messages_dot_events__pb2
from canvas_generated.messages import plugins_pb2 as canvas__generated_dot_messages_dot_plugins__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.HandleEvent = channel.unary_stream(
                '/canvas.PluginRunner/HandleEvent',
                request_serializer=canvas__generated_dot_messages_dot_events__pb2.Event.SerializeToString,
                response_deserializer=canvas__generated_dot_messages_dot_events__pb2.EventResponse.FromString,
                )
        self.ReloadPlugins = channel.unary_stream(
                '/canvas.PluginRunner/ReloadPlugins',
                request_serializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginsRequest.SerializeToString,
                response_deserializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginsResponse.FromString,
                )
        self.ReloadPlugin = channel.unary_stream(
                '/canvas.PluginRunner/ReloadPlugin',
                request_serializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginRequest.SerializeToString,
                response_deserializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginResponse.FromString,
                )
        self.UnloadPlugin = channel.unary_stream(
                '/canvas.PluginRunner/UnloadPlugin',
                request_serializer=canvas__generated_dot_messages_dot_plugins__pb2.UnloadPluginRequest.SerializeToString,
                response_deserializer=canvas__generated_dot_messages_dot_plugins__pb2.UnloadPluginResponse.FromString,
                )


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

    def HandleEvent(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 ReloadPlugins(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 ReloadPlugin(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 UnloadPlugin(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_PluginRunnerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'HandleEvent': grpc.unary_stream_rpc_method_handler(
                    servicer.HandleEvent,
                    request_deserializer=canvas__generated_dot_messages_dot_events__pb2.Event.FromString,
                    response_serializer=canvas__generated_dot_messages_dot_events__pb2.EventResponse.SerializeToString,
            ),
            'ReloadPlugins': grpc.unary_stream_rpc_method_handler(
                    servicer.ReloadPlugins,
                    request_deserializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginsRequest.FromString,
                    response_serializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginsResponse.SerializeToString,
            ),
            'ReloadPlugin': grpc.unary_stream_rpc_method_handler(
                    servicer.ReloadPlugin,
                    request_deserializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginRequest.FromString,
                    response_serializer=canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginResponse.SerializeToString,
            ),
            'UnloadPlugin': grpc.unary_stream_rpc_method_handler(
                    servicer.UnloadPlugin,
                    request_deserializer=canvas__generated_dot_messages_dot_plugins__pb2.UnloadPluginRequest.FromString,
                    response_serializer=canvas__generated_dot_messages_dot_plugins__pb2.UnloadPluginResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'canvas.PluginRunner', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def HandleEvent(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_stream(request, target, '/canvas.PluginRunner/HandleEvent',
            canvas__generated_dot_messages_dot_events__pb2.Event.SerializeToString,
            canvas__generated_dot_messages_dot_events__pb2.EventResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ReloadPlugins(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_stream(request, target, '/canvas.PluginRunner/ReloadPlugins',
            canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginsRequest.SerializeToString,
            canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ReloadPlugin(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_stream(request, target, '/canvas.PluginRunner/ReloadPlugin',
            canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginRequest.SerializeToString,
            canvas__generated_dot_messages_dot_plugins__pb2.ReloadPluginResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UnloadPlugin(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_stream(request, target, '/canvas.PluginRunner/UnloadPlugin',
            canvas__generated_dot_messages_dot_plugins__pb2.UnloadPluginRequest.SerializeToString,
            canvas__generated_dot_messages_dot_plugins__pb2.UnloadPluginResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
