summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorSimon Pamies <s.pamies@appweeve.com>2021-06-03 00:38:09 +0200
committerGitHub <noreply@github.com>2021-06-03 00:38:09 +0200
commit74f5e62ef5bfffc7ba21494d05dbead60b59ecf0 (patch)
tree163463c6b4aedece5dc675348c0ce96ff66d79af /gitlab
parent85bbd1a5db5eff8a8cea63b2b192aae66030423d (diff)
downloadgitlab-74f5e62ef5bfffc7ba21494d05dbead60b59ecf0.tar.gz
feat(objects): add support for Group wikis (#1484)
feat(objects): add support for Group wikis
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/v4/objects/groups.py2
-rw-r--r--gitlab/v4/objects/wikis.py18
2 files changed, 20 insertions, 0 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index 2811c05..429d95d 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -28,6 +28,7 @@ from .projects import GroupProjectManager # noqa: F401
from .runners import GroupRunnerManager # noqa: F401
from .statistics import GroupIssuesStatisticsManager # noqa: F401
from .variables import GroupVariableManager # noqa: F401
+from .wikis import GroupWikiManager # noqa: F401
__all__ = [
"Group",
@@ -67,6 +68,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
("variables", "GroupVariableManager"),
("clusters", "GroupClusterManager"),
("deploytokens", "GroupDeployTokenManager"),
+ ("wikis", "GroupWikiManager"),
)
@cli.register_custom_action("Group", ("to_project_id",))
diff --git a/gitlab/v4/objects/wikis.py b/gitlab/v4/objects/wikis.py
index 52a230f..a86b442 100644
--- a/gitlab/v4/objects/wikis.py
+++ b/gitlab/v4/objects/wikis.py
@@ -4,6 +4,8 @@ from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
__all__ = [
"ProjectWiki",
"ProjectWikiManager",
+ "GroupWiki",
+ "GroupWikiManager",
]
@@ -21,3 +23,19 @@ class ProjectWikiManager(CRUDMixin, RESTManager):
)
_update_attrs = RequiredOptional(optional=("title", "content", "format"))
_list_filters = ("with_content",)
+
+
+class GroupWiki(SaveMixin, ObjectDeleteMixin, RESTObject):
+ _id_attr = "slug"
+ _short_print_attr = "slug"
+
+
+class GroupWikiManager(CRUDMixin, RESTManager):
+ _path = "/groups/%(group_id)s/wikis"
+ _obj_cls = GroupWiki
+ _from_parent_attrs = {"group_id": "id"}
+ _create_attrs = RequiredOptional(
+ required=("title", "content"), optional=("format",)
+ )
+ _update_attrs = RequiredOptional(optional=("title", "content", "format"))
+ _list_filters = ("with_content",)