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

from __future__ import annotations

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


@dataclass(slots=True)
class EventListListMetadata:
    """Pagination cursor for navigating to the next page of results."""

    after: Optional[str]
    """An object ID that defines your place in the list. When the ID is not present, you are at the end of the list."""

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

    def to_dict(self) -> Dict[str, Any]:
        """Serialize to a dictionary."""
        result: Dict[str, Any] = {}
        if self.after is not None:
            result["after"] = self.after
        else:
            result["after"] = None
        return result
