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

from . import plugin_pb2 as plugin__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Register = channel.unary_unary(
            "/plugin.PluginService/Register",
            request_serializer=plugin__pb2.RegisterRequest.SerializeToString,
            response_deserializer=plugin__pb2.RegisterResponse.FromString,
        )
        self.Call = channel.unary_unary(
            "/plugin.PluginService/Call",
            request_serializer=plugin__pb2.EndpointRequestMessage.SerializeToString,
            response_deserializer=plugin__pb2.EndpointResponseMessage.FromString,
        )
        self.LoggingStream = channel.unary_stream(
            "/plugin.PluginService/LoggingStream",
            request_serializer=plugin__pb2.LoggingArgs.SerializeToString,
            response_deserializer=plugin__pb2.LogMessage.FromString,
        )


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

    def Register(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 Call(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 LoggingStream(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_PluginServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Register": grpc.unary_unary_rpc_method_handler(
            servicer.Register,
            request_deserializer=plugin__pb2.RegisterRequest.FromString,
            response_serializer=plugin__pb2.RegisterResponse.SerializeToString,
        ),
        "Call": grpc.unary_unary_rpc_method_handler(
            servicer.Call,
            request_deserializer=plugin__pb2.EndpointRequestMessage.FromString,
            response_serializer=plugin__pb2.EndpointResponseMessage.SerializeToString,
        ),
        "LoggingStream": grpc.unary_stream_rpc_method_handler(
            servicer.LoggingStream,
            request_deserializer=plugin__pb2.LoggingArgs.FromString,
            response_serializer=plugin__pb2.LogMessage.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "plugin.PluginService", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Register(
        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,
            "/plugin.PluginService/Register",
            plugin__pb2.RegisterRequest.SerializeToString,
            plugin__pb2.RegisterResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def Call(
        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,
            "/plugin.PluginService/Call",
            plugin__pb2.EndpointRequestMessage.SerializeToString,
            plugin__pb2.EndpointResponseMessage.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def LoggingStream(
        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,
            "/plugin.PluginService/LoggingStream",
            plugin__pb2.LoggingArgs.SerializeToString,
            plugin__pb2.LogMessage.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
