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 sys
import typing

if sys.version_info >= (3, 13):
    import typing as typing_extensions
else:
    import typing_extensions

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext):  # type: ignore[misc, type-arg]
    ...

GRPC_GENERATED_VERSION: str
GRPC_VERSION: str
class PostalVerificationServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def InitiatePostalVerification(
        self,
        request: postal_verification_pb2.InitiatePostalVerificationReq,
        context: CouchersContext,
        session: orm.Session,
    ) -> typing.Union[postal_verification_pb2.InitiatePostalVerificationRes, collections.abc.Awaitable[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,
    ) -> typing.Union[postal_verification_pb2.ConfirmPostalAddressRes, collections.abc.Awaitable[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,
    ) -> typing.Union[postal_verification_pb2.GetPostalVerificationStatusRes, collections.abc.Awaitable[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,
    ) -> typing.Union[postal_verification_pb2.VerifyPostalCodeRes, collections.abc.Awaitable[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,
    ) -> typing.Union[google.protobuf.empty_pb2.Empty, collections.abc.Awaitable[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,
    ) -> typing.Union[postal_verification_pb2.ListPostalVerificationAttemptsRes, collections.abc.Awaitable[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: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
