summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/custom_attributes.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/v4/objects/custom_attributes.py')
-rw-r--r--gitlab/v4/objects/custom_attributes.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/gitlab/v4/objects/custom_attributes.py b/gitlab/v4/objects/custom_attributes.py
index aed1965..d061614 100644
--- a/gitlab/v4/objects/custom_attributes.py
+++ b/gitlab/v4/objects/custom_attributes.py
@@ -1,3 +1,5 @@
+from typing import Any, cast, Union
+
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import DeleteMixin, ObjectDeleteMixin, RetrieveMixin, SetMixin
@@ -20,6 +22,11 @@ class GroupCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin, RESTMana
_obj_cls = GroupCustomAttribute
_from_parent_attrs = {"group_id": "id"}
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> GroupCustomAttribute:
+ return cast(GroupCustomAttribute, super().get(id=id, lazy=lazy, **kwargs))
+
class ProjectCustomAttribute(ObjectDeleteMixin, RESTObject):
_id_attr = "key"
@@ -30,6 +37,11 @@ class ProjectCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin, RESTMa
_obj_cls = ProjectCustomAttribute
_from_parent_attrs = {"project_id": "id"}
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> ProjectCustomAttribute:
+ return cast(ProjectCustomAttribute, super().get(id=id, lazy=lazy, **kwargs))
+
class UserCustomAttribute(ObjectDeleteMixin, RESTObject):
_id_attr = "key"
@@ -39,3 +51,8 @@ class UserCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin, RESTManag
_path = "/users/{user_id}/custom_attributes"
_obj_cls = UserCustomAttribute
_from_parent_attrs = {"user_id": "id"}
+
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> UserCustomAttribute:
+ return cast(UserCustomAttribute, super().get(id=id, lazy=lazy, **kwargs))