# 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 AuthenticationEmailVerificationFailedDataError:
    """Details about the authentication error."""

    code: str
    """The error code."""
    message: str
    """A human-readable error message."""

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

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