from sqlalchemy import orm
from couchers.context import CouchersContext
"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""

import abc
import collections.abc
import google.protobuf.empty_pb2
import grpc
import grpc.aio
import postal_verification_pb2
import typing


GRPC_GENERATED_VERSION: str
GRPC_VERSION: str

class PostalVerificationStub:
    def __init__(self, channel: grpc.Channel) -> None: ...
    InitiatePostalVerification: grpc.UnaryUnaryMultiCallable[postal_verification_pb2.InitiatePostalVerificationReq, postal_verification_pb2.InitiatePostalVerificationRes]
    """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).
    """
    ConfirmPostalAddress: grpc.UnaryUnaryMultiCallable[postal_verification_pb2.ConfirmPostalAddressReq, postal_verification_pb2.ConfirmPostalAddressRes]
    """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.
    """
    GetPostalVerificationStatus: grpc.UnaryUnaryMultiCallable[postal_verification_pb2.GetPostalVerificationStatusReq, postal_verification_pb2.GetPostalVerificationStatusRes]
    """Get current postal verification status
    Returns the user's postal verification status and current/latest attempt details.
    """
    VerifyPostalCode: grpc.UnaryUnaryMultiCallable[postal_verification_pb2.VerifyPostalCodeReq, postal_verification_pb2.VerifyPostalCodeRes]
    """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.
    """
    CancelPostalVerification: grpc.UnaryUnaryMultiCallable[postal_verification_pb2.CancelPostalVerificationReq, google.protobuf.empty_pb2.Empty]
    """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.
    """
    ListPostalVerificationAttempts: grpc.UnaryUnaryMultiCallable[postal_verification_pb2.ListPostalVerificationAttemptsReq, postal_verification_pb2.ListPostalVerificationAttemptsRes]
    """List all postal verification attempts (history)
    Returns all postal verification attempts for the user.
    """

class PostalVerificationServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def InitiatePostalVerification(
        self,
        request: postal_verification_pb2.InitiatePostalVerificationReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> postal_verification_pb2.InitiatePostalVerificationRes:
        """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).
        """

    @abc.abstractmethod
    def ConfirmPostalAddress(
        self,
        request: postal_verification_pb2.ConfirmPostalAddressReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> postal_verification_pb2.ConfirmPostalAddressRes:
        """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.
        """

    @abc.abstractmethod
    def GetPostalVerificationStatus(
        self,
        request: postal_verification_pb2.GetPostalVerificationStatusReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> postal_verification_pb2.GetPostalVerificationStatusRes:
        """Get current postal verification status
        Returns the user's postal verification status and current/latest attempt details.
        """

    @abc.abstractmethod
    def VerifyPostalCode(
        self,
        request: postal_verification_pb2.VerifyPostalCodeReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> postal_verification_pb2.VerifyPostalCodeRes:
        """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.
        """

    @abc.abstractmethod
    def CancelPostalVerification(
        self,
        request: postal_verification_pb2.CancelPostalVerificationReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> google.protobuf.empty_pb2.Empty:
        """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.
        """

    @abc.abstractmethod
    def ListPostalVerificationAttempts(
        self,
        request: postal_verification_pb2.ListPostalVerificationAttemptsReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> postal_verification_pb2.ListPostalVerificationAttemptsRes:
        """List all postal verification attempts (history)
        Returns all postal verification attempts for the user.
        """

def add_PostalVerificationServicer_to_server(servicer: PostalVerificationServicer, server: grpc.Server) -> None: ...
