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

Method _useAttributes

github/RepositoryAdvisory.py:383–427  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

381 self._useAttributes(data)
382
383 def _useAttributes(self, attributes: dict[str, Any]) -> None:
384 if "author" in attributes: # pragma no branch
385 self._author = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["author"])
386 if "closed_at" in attributes: # pragma no branch
387 assert attributes["closed_at"] is None or isinstance(attributes["closed_at"], str), attributes["closed_at"]
388 self._closed_at = self._makeDatetimeAttribute(attributes["closed_at"])
389 if "collaborating_teams" in attributes: # pragma no branch
390 self._collaborating_teams = self._makeListOfClassesAttribute(
391 github.Team.Team, attributes["collaborating_teams"]
392 )
393 if "collaborating_users" in attributes: # pragma no branch
394 self._collaborating_users = self._makeListOfClassesAttribute(
395 github.NamedUser.NamedUser, attributes["collaborating_users"]
396 )
397 if "created_at" in attributes: # pragma no branch
398 assert attributes["created_at"] is None or isinstance(attributes["created_at"], str), attributes[
399 "created_at"
400 ]
401 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
402 if "credits" in attributes: # pragma no branch
403 self._credits = self._makeListOfClassesAttribute(
404 github.AdvisoryCredit.AdvisoryCredit,
405 attributes["credits"],
406 )
407 if "credits_detailed" in attributes: # pragma no branch
408 self._credits_detailed = self._makeListOfClassesAttribute(
409 github.AdvisoryCreditDetailed.AdvisoryCreditDetailed,
410 attributes["credits_detailed"],
411 )
412 if "cwe_ids" in attributes: # pragma no branch
413 self._cwe_ids = self._makeListOfStringsAttribute(attributes["cwe_ids"])
414 if "private_fork" in attributes: # pragma no branch
415 self._private_fork = self._makeClassAttribute(github.Repository.Repository, attributes["private_fork"])
416 if "publisher" in attributes: # pragma no branch
417 self._publisher = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["publisher"])
418 if "state" in attributes: # pragma no branch
419 self._state = self._makeStringAttribute(attributes["state"])
420 if "submission" in attributes: # pragma no branch
421 self._submission = self._makeDictAttribute(attributes["submission"])
422 if "vulnerabilities" in attributes:
423 self._vulnerabilities = self._makeListOfClassesAttribute(
424 github.AdvisoryVulnerability.AdvisoryVulnerability,
425 attributes["vulnerabilities"],
426 )
427 super()._useAttributes(attributes)

Callers 8

add_vulnerabilitiesMethod · 0.95
offer_creditsMethod · 0.95
revoke_creditMethod · 0.95
clear_creditsMethod · 0.95
editMethod · 0.95
accept_reportMethod · 0.95
publishMethod · 0.95
closeMethod · 0.95

Calls 6

_makeClassAttributeMethod · 0.80
_makeStringAttributeMethod · 0.80
_makeDictAttributeMethod · 0.80

Tested by

no test coverage detected