# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: services/account/v1/account.proto
# plugin: python-betterproto
import warnings
from dataclasses import dataclass
from typing import Optional

import betterproto
from betterproto.grpc.grpclib_server import ServiceBase


class ConfirmationMethod(betterproto.Enum):
    """Confirmation method type for two-factor workflows"""

    None_ = 0
    """No confirmation required"""

    Email = 1
    """Email confirmation required"""

    Sms = 2
    """SMS confirmation required"""

    ConnectedDevice = 3
    """Confirmation from a connected device is required"""

    Other = 10
    """Third-party method of confirmation is required"""


@dataclass(eq=False, repr=False)
class AccountDetails(betterproto.Message):
    """Account registration details"""

    name: str = betterproto.string_field(1)
    """Account name"""

    email: str = betterproto.string_field(2)
    """Email address of account."""

    sms: str = betterproto.string_field(3)
    """SMS number including country code"""

    def __post_init__(self) -> None:
        super().__post_init__()
        if self.is_set("email"):
            warnings.warn("AccountDetails.email is deprecated", DeprecationWarning)
        if self.is_set("sms"):
            warnings.warn("AccountDetails.sms is deprecated", DeprecationWarning)


@dataclass(eq=False, repr=False)
class TokenProtection(betterproto.Message):
    """Token protection info"""

    enabled: bool = betterproto.bool_field(1)
    """
    Indicates if token is protected using a PIN, security code, HSM secret,
    etc.
    """

    method: "ConfirmationMethod" = betterproto.enum_field(2)
    """The method used to protect the token"""


@dataclass(eq=False, repr=False)
class AccountProfile(betterproto.Message):
    """
    Device profile containing sensitive authentication data. This information
    should be stored securely
    """

    profile_type: str = betterproto.string_field(1)
    """
    The type of profile, used to differentiate between protocol schemes or
    versions
    """

    auth_data: bytes = betterproto.bytes_field(2)
    """Auth data containg information about the current device access"""

    auth_token: bytes = betterproto.bytes_field(3)
    """Secure token issued by server used to generate zero-knowledge proofs"""

    protection: "TokenProtection" = betterproto.message_field(4)
    """
    Token security information about the token. If token protection is enabled,
    implementations must supply protection secret before using the token for
    authentication.
    """


@dataclass(eq=False, repr=False)
class WalletAuthToken(betterproto.Message):
    """Information about authentication tokens for a wallet"""

    id: str = betterproto.string_field(1)
    """
    Unique identifier for the token. This field will match the `DeviceId` in
    the WalletAuthData
    """

    description: Optional[str] = betterproto.string_field(
        2, optional=True, group="_description"
    )
    """Device name/description"""

    date_created: str = betterproto.string_field(3)
    """Date when the token was created in ISO 8601 format"""
