summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects
diff options
context:
space:
mode:
authorFabio Huser <fabio.huser@siemens.com>2022-01-09 14:43:45 +0100
committerJohn Villalovos <john@sodarock.com>2022-01-09 08:44:09 -0800
commitc01b7c494192c5462ec673848287ef2a5c9bd737 (patch)
treec99ef98aed276746763ce941c767310162e85148 /gitlab/v4/objects
parent73ae9559dc7f4fba5c80862f0f253959e60f7a0c (diff)
downloadgitlab-c01b7c494192c5462ec673848287ef2a5c9bd737.tar.gz
feat: add support for Group Access Token API
See https://docs.gitlab.com/ee/api/group_access_tokens.html
Diffstat (limited to 'gitlab/v4/objects')
-rw-r--r--gitlab/v4/objects/group_access_tokens.py17
-rw-r--r--gitlab/v4/objects/groups.py2
2 files changed, 19 insertions, 0 deletions
diff --git a/gitlab/v4/objects/group_access_tokens.py b/gitlab/v4/objects/group_access_tokens.py
new file mode 100644
index 0000000..ca3cbcf
--- /dev/null
+++ b/gitlab/v4/objects/group_access_tokens.py
@@ -0,0 +1,17 @@
+from gitlab.base import RESTManager, RESTObject
+from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
+
+__all__ = [
+ "GroupAccessToken",
+ "GroupAccessTokenManager",
+]
+
+
+class GroupAccessToken(ObjectDeleteMixin, RESTObject):
+ pass
+
+
+class GroupAccessTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager):
+ _path = "/groups/{group_id}/access_tokens"
+ _obj_cls = GroupAccessToken
+ _from_parent_attrs = {"group_id": "id"}
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index 7479cfb..c2e252e 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -18,6 +18,7 @@ from .custom_attributes import GroupCustomAttributeManager # noqa: F401
from .deploy_tokens import GroupDeployTokenManager # noqa: F401
from .epics import GroupEpicManager # noqa: F401
from .export_import import GroupExportManager, GroupImportManager # noqa: F401
+from .group_access_tokens import GroupAccessTokenManager # noqa: F401
from .hooks import GroupHookManager # noqa: F401
from .issues import GroupIssueManager # noqa: F401
from .labels import GroupLabelManager # noqa: F401
@@ -49,6 +50,7 @@ __all__ = [
class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = "name"
+ access_tokens: GroupAccessTokenManager
accessrequests: GroupAccessRequestManager
audit_events: GroupAuditEventManager
badges: GroupBadgeManager