# 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 RevokeSession:
    """Revoke Session model."""

    session_id: str
    """The ID of the session to revoke. This can be extracted from the `sid` claim of the access token."""

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

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