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

from . import control_pb2 as control__pb2


class ControlServiceStub(object):
    """The operators can use the ControlService to issue commands to the node,
    such as proposing a block or otherwise influence the proposal strategy.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Propose = channel.unary_unary(
                '/io.casperlabs.node.api.control.ControlService/Propose',
                request_serializer=control__pb2.ProposeRequest.SerializeToString,
                response_deserializer=control__pb2.ProposeResponse.FromString,
                )


class ControlServiceServicer(object):
    """The operators can use the ControlService to issue commands to the node,
    such as proposing a block or otherwise influence the proposal strategy.
    """

    def Propose(self, request, context):
        """Propose a block using the deploys in the pool.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ControlServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Propose': grpc.unary_unary_rpc_method_handler(
                    servicer.Propose,
                    request_deserializer=control__pb2.ProposeRequest.FromString,
                    response_serializer=control__pb2.ProposeResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'io.casperlabs.node.api.control.ControlService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ControlService(object):
    """The operators can use the ControlService to issue commands to the node,
    such as proposing a block or otherwise influence the proposal strategy.
    """

    @staticmethod
    def Propose(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/io.casperlabs.node.api.control.ControlService/Propose',
            control__pb2.ProposeRequest.SerializeToString,
            control__pb2.ProposeResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)
