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

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import postal_verification_pb2 as postal__verification__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.InitiatePostalVerification = channel.unary_unary(
                '/org.couchers.api.postal_verification.PostalVerification/InitiatePostalVerification',
                request_serializer=postal__verification__pb2.InitiatePostalVerificationReq.SerializeToString,
                response_deserializer=postal__verification__pb2.InitiatePostalVerificationRes.FromString,
                )
        self.ConfirmPostalAddress = channel.unary_unary(
                '/org.couchers.api.postal_verification.PostalVerification/ConfirmPostalAddress',
                request_serializer=postal__verification__pb2.ConfirmPostalAddressReq.SerializeToString,
                response_deserializer=postal__verification__pb2.ConfirmPostalAddressRes.FromString,
                )
        self.GetPostalVerificationStatus = channel.unary_unary(
                '/org.couchers.api.postal_verification.PostalVerification/GetPostalVerificationStatus',
                request_serializer=postal__verification__pb2.GetPostalVerificationStatusReq.SerializeToString,
                response_deserializer=postal__verification__pb2.GetPostalVerificationStatusRes.FromString,
                )
        self.VerifyPostalCode = channel.unary_unary(
                '/org.couchers.api.postal_verification.PostalVerification/VerifyPostalCode',
                request_serializer=postal__verification__pb2.VerifyPostalCodeReq.SerializeToString,
                response_deserializer=postal__verification__pb2.VerifyPostalCodeRes.FromString,
                )
        self.CancelPostalVerification = channel.unary_unary(
                '/org.couchers.api.postal_verification.PostalVerification/CancelPostalVerification',
                request_serializer=postal__verification__pb2.CancelPostalVerificationReq.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.ListPostalVerificationAttempts = channel.unary_unary(
                '/org.couchers.api.postal_verification.PostalVerification/ListPostalVerificationAttempts',
                request_serializer=postal__verification__pb2.ListPostalVerificationAttemptsReq.SerializeToString,
                response_deserializer=postal__verification__pb2.ListPostalVerificationAttemptsRes.FromString,
                )


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

    def InitiatePostalVerification(self, request, context):
        """Step 1: Submit address for validation
        Validates and normalizes the address. Returns a corrected address for user confirmation.
        Returns FAILED_PRECONDITION if there's already an active attempt.
        Returns RESOURCE_EXHAUSTED if rate limited (one attempt per 30 days).
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ConfirmPostalAddress(self, request, context):
        """Step 2: Confirm the (possibly corrected) address and send postcard
        Confirms the address and queues postcard for sending.
        Returns NOT_FOUND if attempt doesn't exist.
        Returns FAILED_PRECONDITION if attempt is not in pending_address_confirmation state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetPostalVerificationStatus(self, request, context):
        """Get current postal verification status
        Returns the user's postal verification status and current/latest attempt details.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def VerifyPostalCode(self, request, context):
        """Submit verification code (from postcard or QR code)
        Verifies the code from the postcard.
        Returns NOT_FOUND if attempt doesn't exist.
        Returns FAILED_PRECONDITION if attempt is not in awaiting_verification state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelPostalVerification(self, request, context):
        """Cancel an in-progress attempt
        Cancels an active postal verification attempt.
        Returns NOT_FOUND if attempt doesn't exist.
        Returns FAILED_PRECONDITION if attempt is not cancellable.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListPostalVerificationAttempts(self, request, context):
        """List all postal verification attempts (history)
        Returns all postal verification attempts for the user.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PostalVerificationServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'InitiatePostalVerification': grpc.unary_unary_rpc_method_handler(
                    servicer.InitiatePostalVerification,
                    request_deserializer=postal__verification__pb2.InitiatePostalVerificationReq.FromString,
                    response_serializer=postal__verification__pb2.InitiatePostalVerificationRes.SerializeToString,
            ),
            'ConfirmPostalAddress': grpc.unary_unary_rpc_method_handler(
                    servicer.ConfirmPostalAddress,
                    request_deserializer=postal__verification__pb2.ConfirmPostalAddressReq.FromString,
                    response_serializer=postal__verification__pb2.ConfirmPostalAddressRes.SerializeToString,
            ),
            'GetPostalVerificationStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPostalVerificationStatus,
                    request_deserializer=postal__verification__pb2.GetPostalVerificationStatusReq.FromString,
                    response_serializer=postal__verification__pb2.GetPostalVerificationStatusRes.SerializeToString,
            ),
            'VerifyPostalCode': grpc.unary_unary_rpc_method_handler(
                    servicer.VerifyPostalCode,
                    request_deserializer=postal__verification__pb2.VerifyPostalCodeReq.FromString,
                    response_serializer=postal__verification__pb2.VerifyPostalCodeRes.SerializeToString,
            ),
            'CancelPostalVerification': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelPostalVerification,
                    request_deserializer=postal__verification__pb2.CancelPostalVerificationReq.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ListPostalVerificationAttempts': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPostalVerificationAttempts,
                    request_deserializer=postal__verification__pb2.ListPostalVerificationAttemptsReq.FromString,
                    response_serializer=postal__verification__pb2.ListPostalVerificationAttemptsRes.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'org.couchers.api.postal_verification.PostalVerification', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def InitiatePostalVerification(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.postal_verification.PostalVerification/InitiatePostalVerification',
            postal__verification__pb2.InitiatePostalVerificationReq.SerializeToString,
            postal__verification__pb2.InitiatePostalVerificationRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ConfirmPostalAddress(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.postal_verification.PostalVerification/ConfirmPostalAddress',
            postal__verification__pb2.ConfirmPostalAddressReq.SerializeToString,
            postal__verification__pb2.ConfirmPostalAddressRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetPostalVerificationStatus(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.postal_verification.PostalVerification/GetPostalVerificationStatus',
            postal__verification__pb2.GetPostalVerificationStatusReq.SerializeToString,
            postal__verification__pb2.GetPostalVerificationStatusRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def VerifyPostalCode(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.postal_verification.PostalVerification/VerifyPostalCode',
            postal__verification__pb2.VerifyPostalCodeReq.SerializeToString,
            postal__verification__pb2.VerifyPostalCodeRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CancelPostalVerification(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.postal_verification.PostalVerification/CancelPostalVerification',
            postal__verification__pb2.CancelPostalVerificationReq.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListPostalVerificationAttempts(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.postal_verification.PostalVerification/ListPostalVerificationAttempts',
            postal__verification__pb2.ListPostalVerificationAttemptsReq.SerializeToString,
            postal__verification__pb2.ListPostalVerificationAttemptsRes.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
