8000 feat(api): Add instance level service accounts (EE) · python-gitlab/python-gitlab@80bc508 · GitHub
[go: up one dir, main page]

Skip to content

Commit 80bc508

Browse files
Rolf OffermannsJohnVillalovos
authored andcommitted
feat(api): Add instance level service accounts (EE)
Fixes #2812.
1 parent 8dbdd7e commit 80bc508

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

gitlab/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def __init__(
214214
"""See :class:`~gitlab.v4.objects.TopicManager`"""
215215
self.statistics = objects.ApplicationStatisticsManager(self)
216216
"""See :class:`~gitlab.v4.objects.ApplicationStatisticsManager`"""
217+
self.service_accounts = objects.ServiceAccountManager(self)
218+
"""See :class:`~gitlab.v4.objects.ServiceAccountManager`"""
217219

218220
def __enter__(self) -> Gitlab:
219221
return self

gitlab/v4/objects/service_accounts.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@
22
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
33
from gitlab.types import RequiredOptional
44

5-
__all__ = ["GroupServiceAccount", "GroupServiceAccountManager"]
5+
__all__ = [
6+
"ServiceAccount",
7+
"ServiceAccountManager",
8+
"GroupServiceAccount",
9+
"GroupServiceAccountManager",
10+
]
11+
12+
13+
class ServiceAccount(RESTObject):
14+
pass
15+
16+
17+
class ServiceAccountManager(CreateMixin, ListMixin, RESTManager):
18+
_path = "/service_accounts"
19+
_obj_cls = ServiceAccount
20+
_create_attrs = RequiredOptional(
21+
optional=("name", "username", "email"),
22+
)
623

724

825
class GroupServiceAccount(ObjectDeleteMixin, RESTObject):

0 commit comments

Comments
 (0)
0