diff options
-rw-r--r-- | docs/gl_objects/projects.py | 7 | ||||
-rw-r--r-- | docs/gl_objects/projects.rst | 6 | ||||
-rw-r--r-- | gitlab/v4/objects.py | 12 |
3 files changed, 25 insertions, 0 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py index 6ef6069..6cdd260 100644 --- a/docs/gl_objects/projects.py +++ b/docs/gl_objects/projects.py @@ -393,3 +393,10 @@ issue.notes.create({ "body": "See the [attached file]({})".format(uploaded_file["url"]) }) # end project file upload markdown custom + +# users list +users = p.users.list() + +# search for users +users = p.users.list(search='pattern') +# end users list diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index 7f3d479..8465eb9 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -160,6 +160,12 @@ Get a list of contributors for the repository: :start-after: # repository contributors :end-before: # end repository contributors +Get a list of users for the repository: + +.. literalinclude:: projects.py + :start-after: # users list + :end-before: # end users list + Project files ============= diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 0d8dffd..e43d65e 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1616,6 +1616,17 @@ class ProjectTriggerManager(CRUDMixin, RESTManager): _update_attrs = (('description', ), tuple()) +class ProjectUser(User): + pass + + +class ProjectUserManager(ListMixin, RESTManager): + _path = '/projects/%(project_id)s/users' + _obj_cls = ProjectUser + _from_parent_attrs = {'project_id': 'id'} + _list_filters = ('search',) + + class ProjectVariable(SaveMixin, ObjectDeleteMixin, RESTObject): _id_attr = 'key' @@ -1795,6 +1806,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): ('services', 'ProjectServiceManager'), ('snippets', 'ProjectSnippetManager'), ('tags', 'ProjectTagManager'), + ('users', 'ProjectUserManager'), ('triggers', 'ProjectTriggerManager'), ('variables', 'ProjectVariableManager'), ) |