# 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 DecryptResponse:
    """Decrypt Response model."""

    data_key: str
    """Base64-encoded decrypted data key."""
    id: str
    """Unique identifier of the decrypted data key."""

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

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