summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2020-04-07 00:55:33 +0200
committerNejc Habjan <hab.nejc@gmail.com>2020-04-07 00:55:33 +0200
commit4cfaa2fd44b64459f6fc268a91d4469284c0e768 (patch)
treec89e1641af92580c6e7435dd3847b58e7b9ce19e /gitlab/v4/objects.py
parentc161852b5a976d11f682c5af00ff3f4e8daa26ef (diff)
downloadgitlab-feat/project-remote-mirrors.tar.gz
feat(api): add support for remote mirrors API (#1056)feat/project-remote-mirrors
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 9855196..25d890e 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -1745,6 +1745,18 @@ class ProjectRegistryTagManager(DeleteMixin, RetrieveMixin, RESTManager):
self.gitlab.http_delete(self.path, query_data=data, **kwargs)
+class ProjectRemoteMirror(SaveMixin, RESTObject):
+ pass
+
+
+class ProjectRemoteMirrorManager(ListMixin, CreateMixin, UpdateMixin, RESTManager):
+ _path = "/projects/%(project_id)s/remote_mirrors"
+ _obj_cls = ProjectRemoteMirror
+ _from_parent_attrs = {"project_id": "id"}
+ _create_attrs = (("url",), ("enabled", "only_protected_branches"))
+ _update_attrs = (tuple(), ("enabled", "only_protected_branches"))
+
+
class ProjectBoardList(SaveMixin, ObjectDeleteMixin, RESTObject):
pass
@@ -4246,6 +4258,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
("pipelineschedules", "ProjectPipelineScheduleManager"),
("pushrules", "ProjectPushRulesManager"),
("releases", "ProjectReleaseManager"),
+ ("remote_mirrors", "ProjectRemoteMirrorManager"),
("repositories", "ProjectRegistryRepositoryManager"),
("runners", "ProjectRunnerManager"),
("services", "ProjectServiceManager"),