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

Method _useAttributes

github/Invitation.py:137–170  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

135 return self._url.value
136
137 def _useAttributes(self, attributes: dict[str, Any]) -> None:
138 if "created_at" in attributes: # pragma no branch
139 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
140 if "expired" in attributes: # pragma no branch
141 self._expired = self._makeBoolAttribute(attributes["expired"])
142 if "html_url" in attributes: # pragma no branch
143 self._html_url = self._makeStringAttribute(attributes["html_url"])
144 if "id" in attributes: # pragma no branch
145 self._id = self._makeIntAttribute(attributes["id"])
146 if "invitee" in attributes: # pragma no branch
147 self._invitee = self._makeUnionClassAttributeFromTypeKey(
148 "type",
149 "User",
150 attributes["invitee"],
151 (github.NamedUser.NamedUser, "User"),
152 (github.Organization.Organization, "Organization"),
153 )
154 if "inviter" in attributes: # pragma no branch
155 self._inviter = self._makeUnionClassAttributeFromTypeKey(
156 "type",
157 "User",
158 attributes["inviter"],
159 (github.NamedUser.NamedUser, "User"),
160 (github.Organization.Organization, "Organization"),
161 )
162 if "node_id" in attributes: # pragma no branch
163 self._node_id = self._makeStringAttribute(attributes["node_id"])
164
165 if "permissions" in attributes: # pragma no branch
166 self._permissions = self._makeStringAttribute(attributes["permissions"])
167 if "repository" in attributes: # pragma no branch
168 self._repository = self._makeClassAttribute(github.Repository.Repository, attributes["repository"])
169 if "url" in attributes: # pragma no branch
170 self._url = self._makeStringAttribute(attributes["url"])

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected