diff options
| author | Max Wittig <max.wittig@siemens.com> | 2022-04-13 09:26:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-13 09:26:49 +0200 |
| commit | 68bf5d82b4480c541281d7f5eaf46850b13916d4 (patch) | |
| tree | a810b8e32569162b95dbac8def479467f5017a3d /gitlab/v4 | |
| parent | 4d6f1259a1806314830853f8917d1f5128479bc3 (diff) | |
| parent | 6f93c0520f738950a7c67dbeca8d1ac8257e2661 (diff) | |
| download | gitlab-68bf5d82b4480c541281d7f5eaf46850b13916d4.tar.gz | |
Merge pull request #1962 from python-gitlab/feat/user-ssh-key
feat(user): support getting user SSH key by id
Diffstat (limited to 'gitlab/v4')
| -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. |
