From 1e73249247756b126a175aa8dc45dd39829f650c Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Thu, 25 Jul 2024 17:25:14 -0400 Subject: [PATCH] Add to_dict method --- src/aiochris/link/linked.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aiochris/link/linked.py b/src/aiochris/link/linked.py index 17316de..9ff4bbb 100644 --- a/src/aiochris/link/linked.py +++ b/src/aiochris/link/linked.py @@ -131,6 +131,10 @@ class LinkedModel(Linked, abc.ABC): A class where its fields may be API links. """ + def to_dict(self) -> dict: + """Serialize this object.""" + return serde.to_dict(self) + @classmethod def _has_link(cls, name: str) -> bool: return any(name == field for field in cls._field_names())