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

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Literal

from workos._types import _raise_deserialize_error


@dataclass(slots=True)
class JWTTemplateResponse:
    """JWT Template Response model."""

    object: Literal["jwt_template"]
    """The object type."""
    content: str
    """The JWT template content as a Liquid template string."""
    created_at: str
    """The timestamp when the JWT template was created."""
    updated_at: str
    """The timestamp when the JWT template was last updated."""

    @classmethod
    def from_dict(cls, data: dict[str, Any]) -> JWTTemplateResponse:
        """Deserialize from a dictionary."""
        try:
            return cls(
                object=data.get("object", "jwt_template"),
                content=data["content"],
                created_at=data["created_at"],
                updated_at=data["updated_at"],
            )
        except (KeyError, ValueError) as e:
            _raise_deserialize_error("JWTTemplateResponse", e)

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