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

Method edit_hook

github/Organization.py:1140–1161  ·  view source on GitHub ↗

:calls: `PATCH /orgs/{org}/hooks/{hook_id} `_

(
        self,
        id: int,
        name: str,
        config: dict[str, str],
        events: Opt[list[str]] = NotSet,
        active: Opt[bool] = NotSet,
    )

Source from the content-addressed store, hash-verified

1138
1139 @deprecated("Use Organization.get_hook(id).edit(…) instead")
1140 def edit_hook(
1141 self,
1142 id: int,
1143 name: str,
1144 config: dict[str, str],
1145 events: Opt[list[str]] = NotSet,
1146 active: Opt[bool] = NotSet,
1147 ) -> Hook:
1148 """
1149 :calls: `PATCH /orgs/{org}/hooks/{hook_id} <https://docs.github.com/en/rest/reference/orgs#webhooks>`_
1150 """
1151 assert isinstance(id, int), id
1152 assert isinstance(name, str), name
1153 assert isinstance(config, dict), config
1154 assert is_optional_list(events, str), events
1155 assert is_optional(active, bool), active
1156 post_parameters: dict[str, Any] = NotSet.remove_unset_items(
1157 {"name": name, "config": config, "events": events, "active": active}
1158 )
1159
1160 headers, data = self._requester.requestJsonAndCheck("PATCH", f"{self.url}/hooks/{id}", input=post_parameters)
1161 return github.Hook.Hook(self._requester, headers, data, completed=True)
1162
1163 def get_events(self) -> PaginatedList[Event]:
1164 """

Calls 4

is_optional_listFunction · 0.90
is_optionalFunction · 0.90
remove_unset_itemsMethod · 0.80
requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected