MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / _useAttributes

Method _useAttributes

github/CommitComment.py:230–268  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

228 return status == 204
229
230 def _useAttributes(self, attributes: dict[str, Any]) -> None:
231 if "author_association" in attributes: # pragma no branch
232 self._author_association = self._makeStringAttribute(attributes["author_association"])
233 if "body" in attributes: # pragma no branch
234 self._body = self._makeStringAttribute(attributes["body"])
235 if "commit_id" in attributes: # pragma no branch
236 self._commit_id = self._makeStringAttribute(attributes["commit_id"])
237 if "created_at" in attributes: # pragma no branch
238 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
239 if "html_url" in attributes: # pragma no branch
240 self._html_url = self._makeStringAttribute(attributes["html_url"])
241 if "id" in attributes: # pragma no branch
242 self._id = self._makeIntAttribute(attributes["id"])
243 elif "url" in attributes and attributes["url"]:
244 id = attributes["url"].split("/")[-1]
245 if id.isnumeric():
246 self._id = self._makeIntAttribute(int(id))
247 if "line" in attributes: # pragma no branch
248 self._line = self._makeIntAttribute(attributes["line"])
249 if "node_id" in attributes: # pragma no branch
250 self._node_id = self._makeStringAttribute(attributes["node_id"])
251 if "path" in attributes: # pragma no branch
252 self._path = self._makeStringAttribute(attributes["path"])
253 if "position" in attributes: # pragma no branch
254 self._position = self._makeIntAttribute(attributes["position"])
255 if "reactions" in attributes: # pragma no branch
256 self._reactions = self._makeDictAttribute(attributes["reactions"])
257 if "updated_at" in attributes: # pragma no branch
258 self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
259 if "url" in attributes: # pragma no branch
260 self._url = self._makeStringAttribute(attributes["url"])
261 if "user" in attributes: # pragma no branch
262 self._user = self._makeUnionClassAttributeFromTypeKey(
263 "type",
264 "User",
265 attributes["user"],
266 (github.NamedUser.NamedUser, "User"),
267 (github.Organization.Organization, "Organization"),
268 )

Callers 1

editMethod · 0.95

Calls 5

_makeStringAttributeMethod · 0.80
_makeIntAttributeMethod · 0.80
_makeDictAttributeMethod · 0.80

Tested by

no test coverage detected