diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-04-01 22:01:04 +0200 |
|---|---|---|
| committer | Nejc Habjan <nejc.habjan@siemens.com> | 2022-04-01 22:03:25 +0200 |
| commit | 6f93c0520f738950a7c67dbeca8d1ac8257e2661 (patch) | |
| tree | 4bc49a6161ca535542532d2f181dd849203fae23 /gitlab | |
| parent | d508b1809ff3962993a2279b41b7d20e42d6e329 (diff) | |
| download | gitlab-6f93c0520f738950a7c67dbeca8d1ac8257e2661.tar.gz | |
feat(user): support getting user SSH key by id
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/v4/objects/users.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gitlab/v4/objects/users.py b/gitlab/v4/objects/users.py index b2de337..ddcee70 100644 --- a/gitlab/v4/objects/users.py +++ b/gitlab/v4/objects/users.py @@ -429,12 +429,15 @@ class UserKey(ObjectDeleteMixin, RESTObject): pass -class UserKeyManager(ListMixin, CreateMixin, DeleteMixin, RESTManager): +class UserKeyManager(RetrieveMixin, CreateMixin, DeleteMixin, RESTManager): _path = "/users/{user_id}/keys" _obj_cls = UserKey _from_parent_attrs = {"user_id": "id"} _create_attrs = RequiredOptional(required=("title", "key")) + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> UserKey: + return cast(UserKey, super().get(id=id, lazy=lazy, **kwargs)) + class UserIdentityProviderManager(DeleteMixin, RESTManager): """Manager for user identities. |
