summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorMahadevan Karthi <mahadevan.karthi@engineering.digital.dwp.gov.uk>2023-01-18 15:58:36 +0000
committerJohn Villalovos <john@sodarock.com>2023-01-18 11:37:49 -0800
commit9322db663ecdaecf399e3192810d973c6a9a4020 (patch)
treef48d39f80d7fe23f6fcfb3afbd1a45967c461f36 /gitlab
parentaa44f2aed8150f8c891837e06296c7bbef17c292 (diff)
downloadgitlab-9322db663ecdaecf399e3192810d973c6a9a4020.tar.gz
feat(group): add support for group restore API
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/v4/objects/groups.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index d03eb38..0eb516f 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -287,6 +287,21 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
path = f"/groups/{self.encoded_id}/share/{group_id}"
self.manager.gitlab.http_delete(path, **kwargs)
+ @cli.register_custom_action("Group")
+ @exc.on_http_error(exc.GitlabRestoreError)
+ def restore(self, **kwargs: Any) -> None:
+ """Restore a group marked for deletion..
+
+ Args:
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabRestoreError: If the server failed to perform the request
+ """
+ path = f"/groups/{self.encoded_id}/restore"
+ self.manager.gitlab.http_post(path, **kwargs)
+
class GroupManager(CRUDMixin, RESTManager):
_path = "/groups"