summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 0a0cebd..106b102 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -461,6 +461,17 @@ class GroupAccessRequestManager(GetFromListMixin, CreateMixin, DeleteMixin,
_from_parent_attrs = {'group_id': 'id'}
+class GroupCustomAttribute(ObjectDeleteMixin, RESTObject):
+ _id_attr = 'key'
+
+
+class GroupCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin,
+ RESTManager):
+ _path = '/groups/%(group_id)s/custom_attributes'
+ _obj_cls = GroupCustomAttribute
+ _from_parent_attrs = {'group_id': 'id'}
+
+
class GroupIssue(RESTObject):
pass
@@ -614,6 +625,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = 'name'
_managers = (
('accessrequests', 'GroupAccessRequestManager'),
+ ('customattributes', 'GroupCustomAttributeManager'),
('issues', 'GroupIssueManager'),
('members', 'GroupMemberManager'),
('milestones', 'GroupMilestoneManager'),
@@ -839,6 +851,17 @@ class ProjectBranchManager(NoUpdateMixin, RESTManager):
_create_attrs = (('branch', 'ref'), tuple())
+class ProjectCustomAttribute(ObjectDeleteMixin, RESTObject):
+ _id_attr = 'key'
+
+
+class ProjectCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin,
+ RESTManager):
+ _path = '/projects/%(project_id)s/custom_attributes'
+ _obj_cls = ProjectCustomAttribute
+ _from_parent_attrs = {'project_id': 'id'}
+
+
class ProjectJob(RESTObject):
@cli.register_custom_action('ProjectJob')
@exc.on_http_error(exc.GitlabJobCancelError)
@@ -2200,6 +2223,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
('branches', 'ProjectBranchManager'),
('jobs', 'ProjectJobManager'),
('commits', 'ProjectCommitManager'),
+ ('customattributes', 'ProjectCustomAttributeManager'),
('deployments', 'ProjectDeploymentManager'),
('environments', 'ProjectEnvironmentManager'),
('events', 'ProjectEventManager'),