# 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 ErrorResponse:
    """Error response body."""

    error: str
    """A human-readable description of the error."""

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

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