:calls: `POST /repos/{owner}/{repo}/hooks `_ :param name: string :param config: dict :param events: list of string :param active: bool :rtype: :class:`github.Hook.Hook`
(
self,
name: str,
config: dict[str, str],
events: Opt[list[str]] = NotSet,
active: Opt[bool] = NotSet,
)
| 1655 | return github.GitTree.GitTree(self._requester, headers, data, completed=True) |
| 1656 | |
| 1657 | def create_hook( |
| 1658 | self, |
| 1659 | name: str, |
| 1660 | config: dict[str, str], |
| 1661 | events: Opt[list[str]] = NotSet, |
| 1662 | active: Opt[bool] = NotSet, |
| 1663 | ) -> Hook: |
| 1664 | """ |
| 1665 | :calls: `POST /repos/{owner}/{repo}/hooks <https://docs.github.com/en/rest/reference/repos#webhooks>`_ |
| 1666 | :param name: string |
| 1667 | :param config: dict |
| 1668 | :param events: list of string |
| 1669 | :param active: bool |
| 1670 | :rtype: :class:`github.Hook.Hook` |
| 1671 | """ |
| 1672 | assert isinstance(name, str), name |
| 1673 | assert isinstance(config, dict), config |
| 1674 | assert is_optional_list(events, str), events |
| 1675 | assert is_optional(active, bool), active |
| 1676 | post_parameters = NotSet.remove_unset_items( |
| 1677 | {"name": name, "config": config, "events": events, "active": active} |
| 1678 | ) |
| 1679 | headers, data = self._requester.requestJsonAndCheck("POST", f"{self.url}/hooks", input=post_parameters) |
| 1680 | return github.Hook.Hook(self._requester, headers, data, completed=True) |
| 1681 | |
| 1682 | def create_issue( |
| 1683 | self, |
no test coverage detected