summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-11-01 12:13:46 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-11-01 12:13:46 +0100
commit5082879dcfbe322bb16e4c2387c25ec4f4407cb1 (patch)
treebcb261cefc6b4c5708a07989e16bfe4275027da3 /gitlab/v4/objects.py
parent4744200d982f7fc556d1202330b218850bd232d6 (diff)
downloadgitlab-5082879dcfbe322bb16e4c2387c25ec4f4407cb1.tar.gz
Add support for wiki pages
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 992259d..a57adff 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -1947,6 +1947,20 @@ class ProjectRunnerManager(NoUpdateMixin, RESTManager):
_create_attrs = (('runner_id', ), tuple())
+class ProjectWiki(SaveMixin, ObjectDeleteMixin, RESTObject):
+ _id_attr = 'slug'
+ _short_print_attr = 'slug'
+
+
+class ProjectWikiManager(CRUDMixin, RESTManager):
+ _path = '/projects/%(project_id)s/wikis'
+ _obj_cls = ProjectWiki
+ _from_parent_attrs = {'project_id': 'id'}
+ _create_attrs = (('title', 'content'), ('format', ))
+ _update_attrs = (tuple(), ('title', 'content', 'format'))
+ _list_filters = ('with_content', )
+
+
class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = 'path'
_managers = (
@@ -1978,6 +1992,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
('users', 'ProjectUserManager'),
('triggers', 'ProjectTriggerManager'),
('variables', 'ProjectVariableManager'),
+ ('wikis', 'ProjectWikiManager'),
)
@cli.register_custom_action('Project', tuple(), ('path', 'ref'))