MCPcopy
hub / github.com/PyGithub/PyGithub / _useAttributes

Method _useAttributes

github/WorkflowRun.py:379–466  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

377 )
378
379 def _useAttributes(self, attributes: dict[str, Any]) -> None:
380 if "actor" in attributes: # pragma no branch
381 self._actor = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["actor"])
382 if "artifacts_url" in attributes: # pragma no branch
383 self._artifacts_url = self._makeStringAttribute(attributes["artifacts_url"])
384 if "cancel_url" in attributes: # pragma no branch
385 self._cancel_url = self._makeStringAttribute(attributes["cancel_url"])
386 if "check_suite_id" in attributes: # pragma no branch
387 self._check_suite_id = self._makeIntAttribute(attributes["check_suite_id"])
388 if "check_suite_node_id" in attributes: # pragma no branch
389 self._check_suite_node_id = self._makeStringAttribute(attributes["check_suite_node_id"])
390 if "check_suite_url" in attributes: # pragma no branch
391 self._check_suite_url = self._makeStringAttribute(attributes["check_suite_url"])
392 if "conclusion" in attributes: # pragma no branch
393 self._conclusion = self._makeStringAttribute(attributes["conclusion"])
394 if "created_at" in attributes: # pragma no branch
395 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
396 if "display_title" in attributes: # pragma no branch
397 self._display_title = self._makeStringAttribute(attributes["display_title"])
398 if "event" in attributes: # pragma no branch
399 self._event = self._makeStringAttribute(attributes["event"])
400 if "head_branch" in attributes: # pragma no branch
401 self._head_branch = self._makeStringAttribute(attributes["head_branch"])
402 if "head_commit" in attributes: # pragma no branch
403 self._head_commit = self._makeClassAttribute(github.GitCommit.GitCommit, attributes["head_commit"])
404 if "head_repository" in attributes: # pragma no branch
405 self._head_repository = self._makeClassAttribute(
406 github.Repository.Repository, attributes["head_repository"]
407 )
408 if "head_repository_id" in attributes: # pragma no branch
409 self._head_repository_id = self._makeIntAttribute(attributes["head_repository_id"])
410 if "head_sha" in attributes: # pragma no branch
411 self._head_sha = self._makeStringAttribute(attributes["head_sha"])
412 if "html_url" in attributes: # pragma no branch
413 self._html_url = self._makeStringAttribute(attributes["html_url"])
414 if "id" in attributes: # pragma no branch
415 self._id = self._makeIntAttribute(attributes["id"])
416 elif "url" in attributes and attributes["url"]:
417 id = attributes["url"].split("/")[-1]
418 if id.isnumeric():
419 self._id = self._makeIntAttribute(int(id))
420 if "jobs_url" in attributes: # pragma no branch
421 self._jobs_url = self._makeStringAttribute(attributes["jobs_url"])
422 if "logs_url" in attributes: # pragma no branch
423 self._logs_url = self._makeStringAttribute(attributes["logs_url"])
424 if "name" in attributes: # pragma no branch
425 self._name = self._makeStringAttribute(attributes["name"])
426 if "node_id" in attributes: # pragma no branch
427 self._node_id = self._makeStringAttribute(attributes["node_id"])
428 if "path" in attributes: # pragma no branch
429 self._path = self._makeStringAttribute(attributes["path"])
430 if "previous_attempt_url" in attributes: # pragma no branch
431 self._previous_attempt_url = self._makeStringAttribute(attributes["previous_attempt_url"])
432 if "pull_requests" in attributes: # pragma no branch
433 self._pull_requests = self._makeListOfClassesAttribute(
434 github.PullRequest.PullRequest, attributes["pull_requests"]
435 )
436 if "referenced_workflows" in attributes: # pragma no branch

Callers

nothing calls this directly

Calls 6

_makeClassAttributeMethod · 0.80
_makeStringAttributeMethod · 0.80
_makeIntAttributeMethod · 0.80

Tested by

no test coverage detected