summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/hooks.py
diff options
context:
space:
mode:
authorIvan Sugonyak <sugonyak.ivan@gmail.com>2021-06-25 20:49:04 +0300
committerIvan Sugonyak <sugonyak.ivan@gmail.com>2021-06-26 02:01:08 +0300
commit4a7e9b86aa348b72925bce3af1e5d988b8ce3439 (patch)
tree2ca75418bb4e5670f30ec5a3d2fe30447b83dc29 /gitlab/v4/objects/hooks.py
parentaf7aae73e90b54cab7bbf38a8575157416693423 (diff)
downloadgitlab-4a7e9b86aa348b72925bce3af1e5d988b8ce3439.tar.gz
feat(api): add group hooks
Diffstat (limited to 'gitlab/v4/objects/hooks.py')
-rw-r--r--gitlab/v4/objects/hooks.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/gitlab/v4/objects/hooks.py b/gitlab/v4/objects/hooks.py
index 69b324e..428fd76 100644
--- a/gitlab/v4/objects/hooks.py
+++ b/gitlab/v4/objects/hooks.py
@@ -6,6 +6,8 @@ __all__ = [
"HookManager",
"ProjectHook",
"ProjectHookManager",
+ "GroupHook",
+ "GroupHookManager",
]
@@ -60,3 +62,53 @@ class ProjectHookManager(CRUDMixin, RESTManager):
"token",
),
)
+
+
+class GroupHook(SaveMixin, ObjectDeleteMixin, RESTObject):
+ _short_print_attr = "url"
+
+
+class GroupHookManager(CRUDMixin, RESTManager):
+ _path = "/groups/%(group_id)s/hooks"
+ _obj_cls = GroupHook
+ _from_parent_attrs = {"group_id": "id"}
+ _create_attrs = RequiredOptional(
+ required=("url",),
+ optional=(
+ "push_events",
+ "issues_events",
+ "confidential_issues_events",
+ "merge_requests_events",
+ "tag_push_events",
+ "note_events",
+ "confidential_note_events",
+ "job_events",
+ "pipeline_events",
+ "wiki_page_events",
+ "deployment_events",
+ "releases_events",
+ "subgroup_events",
+ "enable_ssl_verification",
+ "token",
+ ),
+ )
+ _update_attrs = RequiredOptional(
+ required=("url",),
+ optional=(
+ "push_events",
+ "issues_events",
+ "confidential_issues_events",
+ "merge_requests_events",
+ "tag_push_events",
+ "note_events",
+ "confidential_note_events",
+ "job_events",
+ "pipeline_events",
+ "wiki_page_events",
+ "deployment_events",
+ "releases_events",
+ "subgroup_events",
+ "enable_ssl_verification",
+ "token",
+ ),
+ )