:calls: `PATCH /repos/{owner}/{repo}/labels/{name} `_
(self, name: str, color: str, description: Opt[str] = NotSet)
| 127 | headers, data = self._requester.requestJsonAndCheck("DELETE", self.url) |
| 128 | |
| 129 | def edit(self, name: str, color: str, description: Opt[str] = NotSet) -> None: |
| 130 | """ |
| 131 | :calls: `PATCH /repos/{owner}/{repo}/labels/{name} <https://docs.github.com/en/rest/reference/issues#labels>`_ |
| 132 | """ |
| 133 | assert isinstance(name, str), name |
| 134 | assert isinstance(color, str), color |
| 135 | assert is_optional(description, str), description |
| 136 | post_parameters = NotSet.remove_unset_items({"new_name": name, "color": color, "description": description}) |
| 137 | headers, data = self._requester.requestJsonAndCheck( |
| 138 | "PATCH", |
| 139 | self.url, |
| 140 | input=post_parameters, |
| 141 | headers={"Accept": Consts.mediaTypeLabelDescriptionSearchPreview}, |
| 142 | ) |
| 143 | self._useAttributes(data) |
| 144 | self._set_complete() |
| 145 | |
| 146 | def _useAttributes(self, attributes: dict[str, Any]) -> None: |
| 147 | if "color" in attributes: # pragma no branch |
nothing calls this directly
no test coverage detected