# 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 DeleteObjectResponse:
    """Delete Object Response model."""

    name: str
    """Name of the deleted object."""
    success: bool
    """Whether the deletion succeeded."""

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

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