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

from __future__ import annotations

from dataclasses import dataclass
from typing import Any

from workos._types import _raise_deserialize_error


@dataclass(slots=True)
class SendRadarSmsChallengeResponse:
    """Send Radar Sms Challenge Response model."""

    verification_id: str
    """The ID of the SMS verification. Pass this to the authenticate endpoint to verify the code."""
    phone_number: str
    """The phone number the verification code was sent to."""

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

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