# This file is auto-generated by oagen. Do not edit.

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Dict
from workos._types import _raise_deserialize_error


@dataclass(slots=True)
class AuthenticationFactorEnrolledSms:
    """SMS-based authentication factor details."""

    phone_number: str
    """The user's phone number for SMS-based authentication."""

    @classmethod
    def from_dict(cls, data: Dict[str, Any]) -> "AuthenticationFactorEnrolledSms":
        """Deserialize from a dictionary."""
        try:
            return cls(
                phone_number=data["phone_number"],
            )
        except (KeyError, ValueError) as e:
            _raise_deserialize_error("AuthenticationFactorEnrolledSms", e)

    def to_dict(self) -> Dict[str, Any]:
        """Serialize to a dictionary."""
        result: Dict[str, Any] = {}
        result["phone_number"] = self.phone_number
        return result
