:calls: `PATCH /repos/{owner}/{repo}/hooks/{hook_id} `_
(
self,
name: str,
config: dict,
events: Opt[list[str]] = NotSet,
add_events: Opt[list[str]] = NotSet,
remove_events: Opt[list[str]] = NotSet,
active: Opt[bool] = NotSet,
)
| 154 | headers, data = self._requester.requestJsonAndCheck("DELETE", self.url) |
| 155 | |
| 156 | def edit( |
| 157 | self, |
| 158 | name: str, |
| 159 | config: dict, |
| 160 | events: Opt[list[str]] = NotSet, |
| 161 | add_events: Opt[list[str]] = NotSet, |
| 162 | remove_events: Opt[list[str]] = NotSet, |
| 163 | active: Opt[bool] = NotSet, |
| 164 | ) -> None: |
| 165 | """ |
| 166 | :calls: `PATCH /repos/{owner}/{repo}/hooks/{hook_id} <https://docs.github.com/en/rest/reference/repos#webhooks>`_ |
| 167 | """ |
| 168 | assert isinstance(name, str), name |
| 169 | assert isinstance(config, dict), config |
| 170 | assert is_optional_list(events, str), events |
| 171 | assert is_optional_list(add_events, str), add_events |
| 172 | assert is_optional_list(remove_events, str), remove_events |
| 173 | assert is_optional(active, bool), active |
| 174 | post_parameters = NotSet.remove_unset_items( |
| 175 | { |
| 176 | "name": name, |
| 177 | "config": config, |
| 178 | "events": events, |
| 179 | "add_events": add_events, |
| 180 | "remove_events": remove_events, |
| 181 | "active": active, |
| 182 | } |
| 183 | ) |
| 184 | |
| 185 | headers, data = self._requester.requestJsonAndCheck("PATCH", self.url, input=post_parameters) |
| 186 | self._useAttributes(data) |
| 187 | self._set_complete() |
| 188 | |
| 189 | def test(self) -> None: |
| 190 | """ |
nothing calls this directly
no test coverage detected