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

from . import donations_pb2 as donations__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.InitiateDonation = channel.unary_unary(
                '/org.couchers.api.donations.Donations/InitiateDonation',
                request_serializer=donations__pb2.InitiateDonationReq.SerializeToString,
                response_deserializer=donations__pb2.InitiateDonationRes.FromString,
                )
        self.GetDonationPortalLink = channel.unary_unary(
                '/org.couchers.api.donations.Donations/GetDonationPortalLink',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=donations__pb2.GetDonationPortalLinkRes.FromString,
                )


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

    def InitiateDonation(self, request, context):
        """Initiate a donation
        This will return a stripe checkout_session_id, that the frontend then needs to use with the Stripe SDK to launch
        the checkout session (basically directing the user to a Stripe operated page to enter in their card details to
        donate)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDonationPortalLink(self, request, context):
        """Gets a link to the Stripe subscription management portal
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DonationsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'InitiateDonation': grpc.unary_unary_rpc_method_handler(
                    servicer.InitiateDonation,
                    request_deserializer=donations__pb2.InitiateDonationReq.FromString,
                    response_serializer=donations__pb2.InitiateDonationRes.SerializeToString,
            ),
            'GetDonationPortalLink': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDonationPortalLink,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=donations__pb2.GetDonationPortalLinkRes.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'org.couchers.api.donations.Donations', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def InitiateDonation(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, '/org.couchers.api.donations.Donations/InitiateDonation',
            donations__pb2.InitiateDonationReq.SerializeToString,
            donations__pb2.InitiateDonationRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetDonationPortalLink(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, '/org.couchers.api.donations.Donations/GetDonationPortalLink',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            donations__pb2.GetDonationPortalLinkRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
