Return an instance of :class:`.ModmailConversation` from ``data``. :param data: The structured data. :param reddit: An instance of :class:`.Reddit`.
(
cls,
data: dict[str, Any],
reddit: praw.Reddit,
)
| 85 | |
| 86 | @classmethod |
| 87 | def parse( |
| 88 | cls, |
| 89 | data: dict[str, Any], |
| 90 | reddit: praw.Reddit, |
| 91 | ) -> ModmailConversation: |
| 92 | """Return an instance of :class:`.ModmailConversation` from ``data``. |
| 93 | |
| 94 | :param data: The structured data. |
| 95 | :param reddit: An instance of :class:`.Reddit`. |
| 96 | |
| 97 | """ |
| 98 | data["authors"] = [reddit._objector.objectify(data=author) for author in data["authors"]] |
| 99 | for entity in "owner", "participant": |
| 100 | data[entity] = reddit._objector.objectify(data=data[entity]) |
| 101 | |
| 102 | if data.get("user"): |
| 103 | cls._convert_user_summary(data["user"], reddit) |
| 104 | data["user"] = reddit._objector.objectify(data=data["user"]) |
| 105 | |
| 106 | data = snake_case_keys(data) |
| 107 | |
| 108 | return cls(reddit, _data=data) |
| 109 | |
| 110 | def __init__( |
| 111 | self, |
nothing calls this directly
no test coverage detected