From c01b7c494192c5462ec673848287ef2a5c9bd737 Mon Sep 17 00:00:00 2001 From: Fabio Huser Date: Sun, 9 Jan 2022 14:43:45 +0100 Subject: feat: add support for Group Access Token API See https://docs.gitlab.com/ee/api/group_access_tokens.html --- gitlab/v4/objects/group_access_tokens.py | 17 +++++++++++++++++ gitlab/v4/objects/groups.py | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 gitlab/v4/objects/group_access_tokens.py (limited to 'gitlab') 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 -- cgit v1.2.1