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

from . import discount_pb2 as discount_dot_grpc_dot_discount__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.CalculateByBasket = channel.unary_unary(
                '/darsman.discount.DiscountController/CalculateByBasket',
                request_serializer=discount_dot_grpc_dot_discount__pb2.BasketRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.Response.FromString,
                )
        self.CalculateByCoupon = channel.unary_unary(
                '/darsman.discount.DiscountController/CalculateByCoupon',
                request_serializer=discount_dot_grpc_dot_discount__pb2.CouponRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.Response.FromString,
                )
        self.CalculateByItem = channel.unary_unary(
                '/darsman.discount.DiscountController/CalculateByItem',
                request_serializer=discount_dot_grpc_dot_discount__pb2.DiscountCalculateByItemRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.DiscountCalculateByItemResponse.FromString,
                )
        self.Retrieve = channel.unary_unary(
                '/darsman.discount.DiscountController/Retrieve',
                request_serializer=discount_dot_grpc_dot_discount__pb2.DiscountRetrieveRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.DiscountResponse.FromString,
                )
        self.Validate = channel.unary_unary(
                '/darsman.discount.DiscountController/Validate',
                request_serializer=discount_dot_grpc_dot_discount__pb2.DiscountValidateRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.DiscountValidateResponse.FromString,
                )


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

    def CalculateByBasket(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 CalculateByCoupon(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 CalculateByItem(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 Retrieve(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 Validate(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_DiscountControllerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CalculateByBasket': grpc.unary_unary_rpc_method_handler(
                    servicer.CalculateByBasket,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.BasketRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.Response.SerializeToString,
            ),
            'CalculateByCoupon': grpc.unary_unary_rpc_method_handler(
                    servicer.CalculateByCoupon,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.CouponRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.Response.SerializeToString,
            ),
            'CalculateByItem': grpc.unary_unary_rpc_method_handler(
                    servicer.CalculateByItem,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.DiscountCalculateByItemRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.DiscountCalculateByItemResponse.SerializeToString,
            ),
            'Retrieve': grpc.unary_unary_rpc_method_handler(
                    servicer.Retrieve,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.DiscountRetrieveRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.DiscountResponse.SerializeToString,
            ),
            'Validate': grpc.unary_unary_rpc_method_handler(
                    servicer.Validate,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.DiscountValidateRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.DiscountValidateResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'darsman.discount.DiscountController', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def CalculateByBasket(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, '/darsman.discount.DiscountController/CalculateByBasket',
            discount_dot_grpc_dot_discount__pb2.BasketRequest.SerializeToString,
            discount_dot_grpc_dot_discount__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CalculateByCoupon(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, '/darsman.discount.DiscountController/CalculateByCoupon',
            discount_dot_grpc_dot_discount__pb2.CouponRequest.SerializeToString,
            discount_dot_grpc_dot_discount__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CalculateByItem(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, '/darsman.discount.DiscountController/CalculateByItem',
            discount_dot_grpc_dot_discount__pb2.DiscountCalculateByItemRequest.SerializeToString,
            discount_dot_grpc_dot_discount__pb2.DiscountCalculateByItemResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Retrieve(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, '/darsman.discount.DiscountController/Retrieve',
            discount_dot_grpc_dot_discount__pb2.DiscountRetrieveRequest.SerializeToString,
            discount_dot_grpc_dot_discount__pb2.DiscountResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Validate(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, '/darsman.discount.DiscountController/Validate',
            discount_dot_grpc_dot_discount__pb2.DiscountValidateRequest.SerializeToString,
            discount_dot_grpc_dot_discount__pb2.DiscountValidateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
