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

from __future__ import annotations

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


@dataclass(slots=True)
class AgentRegistrationClaimAttemptCreatedData:
    """The event payload."""

    object: Literal["agent_registration_claim_attempt"]
    """Distinguishes the agent registration claim attempt object."""
    id: str
    """Unique identifier of the agent registration claim attempt."""
    agent_registration_id: str
    """The ID of the agent registration."""
    agent_registration_claim_id: str
    """The ID of the agent registration claim."""
    login_hint: str
    """The login hint for the claim attempt."""
    expires_at: str
    """The timestamp when the claim attempt expires."""
    created_at: str
    """The timestamp when the claim attempt was created."""
    updated_at: str
    """The timestamp when the claim attempt was last updated."""

    @classmethod
    def from_dict(
        cls, data: Dict[str, Any]
    ) -> "AgentRegistrationClaimAttemptCreatedData":
        """Deserialize from a dictionary."""
        try:
            return cls(
                object=data.get("object", "agent_registration_claim_attempt"),
                id=data["id"],
                agent_registration_id=data["agent_registration_id"],
                agent_registration_claim_id=data["agent_registration_claim_id"],
                login_hint=data["login_hint"],
                expires_at=data["expires_at"],
                created_at=data["created_at"],
                updated_at=data["updated_at"],
            )
        except (KeyError, ValueError) as e:
            _raise_deserialize_error("AgentRegistrationClaimAttemptCreatedData", e)

    def to_dict(self) -> Dict[str, Any]:
        """Serialize to a dictionary."""
        result: Dict[str, Any] = {}
        result["object"] = self.object
        result["id"] = self.id
        result["agent_registration_id"] = self.agent_registration_id
        result["agent_registration_claim_id"] = self.agent_registration_claim_id
        result["login_hint"] = self.login_hint
        result["expires_at"] = self.expires_at
        result["created_at"] = self.created_at
        result["updated_at"] = self.updated_at
        return result
