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

import Commands_pb2 as Commands__pb2


class CommandsStub(object):
    """
    The Commands service handles generic ResInsight RicfCommandObject-commands
    The CommandParams is used to deduce command name from the chosen oneof-message
    .. and the parameters are in the oneof-message itself.
    Note that we several times duplicate nearly the same message. This is because
    it is not recommended to reuse existing messages for different purposes.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Execute = channel.unary_unary(
                '/rips.Commands/Execute',
                request_serializer=Commands__pb2.CommandParams.SerializeToString,
                response_deserializer=Commands__pb2.CommandReply.FromString,
                )


class CommandsServicer(object):
    """
    The Commands service handles generic ResInsight RicfCommandObject-commands
    The CommandParams is used to deduce command name from the chosen oneof-message
    .. and the parameters are in the oneof-message itself.
    Note that we several times duplicate nearly the same message. This is because
    it is not recommended to reuse existing messages for different purposes.
    """

    def Execute(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_CommandsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Execute': grpc.unary_unary_rpc_method_handler(
                    servicer.Execute,
                    request_deserializer=Commands__pb2.CommandParams.FromString,
                    response_serializer=Commands__pb2.CommandReply.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'rips.Commands', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Commands(object):
    """
    The Commands service handles generic ResInsight RicfCommandObject-commands
    The CommandParams is used to deduce command name from the chosen oneof-message
    .. and the parameters are in the oneof-message itself.
    Note that we several times duplicate nearly the same message. This is because
    it is not recommended to reuse existing messages for different purposes.
    """

    @staticmethod
    def Execute(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, '/rips.Commands/Execute',
            Commands__pb2.CommandParams.SerializeToString,
            Commands__pb2.CommandReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
