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

Method edit

github/Gist.py:246–263  ·  view source on GitHub ↗

:calls: `PATCH /gists/{gist_id} `_

(self, description: Opt[str] = NotSet, files: Opt[dict[str, InputFileContent | None]] = NotSet)

Source from the content-addressed store, hash-verified

244 headers, data = self._requester.requestJsonAndCheck("DELETE", self.url)
245
246 def edit(self, description: Opt[str] = NotSet, files: Opt[dict[str, InputFileContent | None]] = NotSet) -> None:
247 """
248 :calls: `PATCH /gists/{gist_id} <https://docs.github.com/en/rest/reference/gists>`_
249 """
250 assert is_optional(description, str), description
251 # limitation of `TypeGuard`
252 assert isinstance(files, _NotSetType) or all(
253 element is None or isinstance(element, github.InputFileContent) for element in files.values()
254 ), files
255 post_parameters: dict[str, Any] = {}
256 if is_defined(description):
257 post_parameters["description"] = description
258 if is_defined(files):
259 post_parameters["files"] = {key: None if value is None else value._identity for key, value in files.items()}
260 headers, data = self._requester.requestJsonAndCheck("PATCH", self.url, input=post_parameters)
261
262 self._useAttributes(data)
263 self._set_complete()
264
265 def get_comment(self, id: int) -> GistComment:
266 """

Callers

nothing calls this directly

Calls 5

_useAttributesMethod · 0.95
is_optionalFunction · 0.90
is_definedFunction · 0.90
requestJsonAndCheckMethod · 0.80
_set_completeMethod · 0.80

Tested by

no test coverage detected