diff options
Diffstat (limited to 'gitlab.py')
| -rw-r--r-- | gitlab.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -545,6 +545,15 @@ class GitlabObject(object): return json.dumps(self.__dict__, cls=jsonEncoder) +class UserKey(GitlabObject): + _url = '/users/%(user_id)s/keys' + canGet = False + canList = False + canUpdate = False + canDelete = False + requiredCreateAttrs = ['user_id', 'title', 'key'] + + class User(GitlabObject): _url = '/users' shortPrintAttr = 'username' @@ -552,6 +561,11 @@ class User(GitlabObject): optionalCreateAttrs = ['skype', 'linkedin', 'twitter', 'projects_limit', 'extern_uid', 'provider', 'bio'] + def Key(self, id=None, **kwargs): + return self._getListOrObject(UserKey, id, + user_id=self.id, + **kwargs) + class CurrentUserKey(GitlabObject): _url = '/user/keys' |
