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

Method _useAttributes

github/Artifact.py:145–180  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

143 return status == 204
144
145 def _useAttributes(self, attributes: dict[str, Any]) -> None:
146 if "archive_download_url" in attributes: # pragma no branch
147 self._archive_download_url = self._makeStringAttribute(attributes["archive_download_url"])
148 if "created_at" in attributes: # pragma no branch
149 assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str,)), attributes[
150 "created_at"
151 ]
152 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
153 if "digest" in attributes: # pragma no branch
154 self._digest = self._makeStringAttribute(attributes["digest"])
155 if "expired" in attributes: # pragma no branch
156 self._expired = self._makeBoolAttribute(attributes["expired"])
157 if "expires_at" in attributes: # pragma no branch
158 assert attributes["expires_at"] is None or isinstance(attributes["expires_at"], (str,)), attributes[
159 "expires_at"
160 ]
161 self._expires_at = self._makeDatetimeAttribute(attributes["expires_at"])
162 if "head_sha" in attributes: # pragma no branch
163 self._head_sha = self._makeStringAttribute(attributes["head_sha"])
164 if "id" in attributes: # pragma no branch
165 self._id = self._makeIntAttribute(attributes["id"])
166 if "name" in attributes: # pragma no branch
167 self._name = self._makeStringAttribute(attributes["name"])
168 if "node_id" in attributes: # pragma no branch
169 self._node_id = self._makeStringAttribute(attributes["node_id"])
170 if "size_in_bytes" in attributes: # pragma no branch
171 self._size_in_bytes = self._makeIntAttribute(attributes["size_in_bytes"])
172 if "updated_at" in attributes: # pragma no branch
173 assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str,)), attributes[
174 "updated_at"
175 ]
176 self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
177 if "url" in attributes: # pragma no branch
178 self._url = self._makeStringAttribute(attributes["url"])
179 if "workflow_run" in attributes: # pragma no branch
180 self._workflow_run = self._makeClassAttribute(github.WorkflowRun.WorkflowRun, attributes["workflow_run"])

Callers

nothing calls this directly

Calls 5

_makeStringAttributeMethod · 0.80
_makeBoolAttributeMethod · 0.80
_makeIntAttributeMethod · 0.80
_makeClassAttributeMethod · 0.80

Tested by

no test coverage detected