MCPcopy Index your code
hub / github.com/praw-dev/praw / parse

Method parse

praw/models/reddit/modmail.py:87–108  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

snake_case_keysFunction · 0.90
getMethod · 0.80
_convert_user_summaryMethod · 0.80
objectifyMethod · 0.45

Tested by

no test coverage detected