# 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 SSOLogoutAuthorizeResponse:
    """SSO Logout Authorize Response model."""

    logout_url: str
    """The URL to redirect the user to in order to log out ([Logout Redirect](https://workos.com/docs/reference/sso/logout) endpoint ready to use)."""
    logout_token: str
    """The logout token to be used in the [Logout Redirect](https://workos.com/docs/reference/sso/logout) endpoint."""

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

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