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

from arithmetic import subtract_pb2 as arithmetic_dot_subtract__pb2


class SubtractionStub(object):
    """A service for subtracting integer numbers
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SubtractOne = channel.unary_unary(
                '/Arithmetic.Subtraction/SubtractOne',
                request_serializer=arithmetic_dot_subtract__pb2.Minuend.SerializeToString,
                response_deserializer=arithmetic_dot_subtract__pb2.Difference.FromString,
                )


class SubtractionServicer(object):
    """A service for subtracting integer numbers
    """

    def SubtractOne(self, request, context):
        """Subtract 1 from a number
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SubtractionServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SubtractOne': grpc.unary_unary_rpc_method_handler(
                    servicer.SubtractOne,
                    request_deserializer=arithmetic_dot_subtract__pb2.Minuend.FromString,
                    response_serializer=arithmetic_dot_subtract__pb2.Difference.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'Arithmetic.Subtraction', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Subtraction(object):
    """A service for subtracting integer numbers
    """

    @staticmethod
    def SubtractOne(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, '/Arithmetic.Subtraction/SubtractOne',
            arithmetic_dot_subtract__pb2.Minuend.SerializeToString,
            arithmetic_dot_subtract__pb2.Difference.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
