# 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.CalcInstallmentByBasket = channel.unary_unary(
                '/darsman.discount.DiscountController/CalcInstallmentByBasket',
                request_serializer=discount_dot_grpc_dot_discount__pb2.InstallmentBasketRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.Response.FromString,
                )
        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.CalculateTieredDiscount = channel.unary_unary(
                '/darsman.discount.DiscountController/CalculateTieredDiscount',
                request_serializer=discount_dot_grpc_dot_discount__pb2.TieredDiscountRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.Response.FromString,
                )
        self.CreateUsage = channel.unary_unary(
                '/darsman.discount.DiscountController/CreateUsage',
                request_serializer=discount_dot_grpc_dot_discount__pb2.UsageRequest.SerializeToString,
                response_deserializer=discount_dot_grpc_dot_discount__pb2.Response.FromString,
                )


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

    def CalcInstallmentByBasket(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 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 CalculateTieredDiscount(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 CreateUsage(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 = {
            'CalcInstallmentByBasket': grpc.unary_unary_rpc_method_handler(
                    servicer.CalcInstallmentByBasket,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.InstallmentBasketRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.Response.SerializeToString,
            ),
            '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,
            ),
            'CalculateTieredDiscount': grpc.unary_unary_rpc_method_handler(
                    servicer.CalculateTieredDiscount,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.TieredDiscountRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.Response.SerializeToString,
            ),
            'CreateUsage': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateUsage,
                    request_deserializer=discount_dot_grpc_dot_discount__pb2.UsageRequest.FromString,
                    response_serializer=discount_dot_grpc_dot_discount__pb2.Response.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 CalcInstallmentByBasket(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/CalcInstallmentByBasket',
            discount_dot_grpc_dot_discount__pb2.InstallmentBasketRequest.SerializeToString,
            discount_dot_grpc_dot_discount__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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 CalculateTieredDiscount(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/CalculateTieredDiscount',
            discount_dot_grpc_dot_discount__pb2.TieredDiscountRequest.SerializeToString,
            discount_dot_grpc_dot_discount__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

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