# This file is auto-generated by oagen. Do not edit.

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Dict, List
from workos._types import _raise_deserialize_error


@dataclass(slots=True)
class SetRolePermissions:
    """Set Role Permissions model."""

    permissions: List[str]
    """The permission slugs to assign to the role."""

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

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