summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/hooks.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/v4/objects/hooks.py')
-rw-r--r--gitlab/v4/objects/hooks.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gitlab/v4/objects/hooks.py b/gitlab/v4/objects/hooks.py
index 00dcfee..0b0092e 100644
--- a/gitlab/v4/objects/hooks.py
+++ b/gitlab/v4/objects/hooks.py
@@ -1,3 +1,5 @@
+from typing import Any, cast, Union
+
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import CRUDMixin, NoUpdateMixin, ObjectDeleteMixin, SaveMixin
@@ -21,6 +23,9 @@ class HookManager(NoUpdateMixin, RESTManager):
_obj_cls = Hook
_create_attrs = RequiredOptional(required=("url",))
+ def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Hook:
+ return cast(Hook, super().get(id=id, lazy=lazy, **kwargs))
+
class ProjectHook(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = "url"
@@ -63,6 +68,11 @@ class ProjectHookManager(CRUDMixin, RESTManager):
),
)
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> ProjectHook:
+ return cast(ProjectHook, super().get(id=id, lazy=lazy, **kwargs))
+
class GroupHook(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = "url"
@@ -112,3 +122,6 @@ class GroupHookManager(CRUDMixin, RESTManager):
"token",
),
)
+
+ def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> GroupHook:
+ return cast(GroupHook, super().get(id=id, lazy=lazy, **kwargs))