From 3424333bc98fcfc4733f2c5f1bf9a93b9a02135b Mon Sep 17 00:00:00 2001 From: Pierre Tardy Date: Mon, 5 Feb 2018 15:55:11 +0100 Subject: introduce RefreshMixin RefreshMixin allows to update a REST object so that you can poll on it. This is mostly useful for pipelines and jobs, but could be set on most of other objects, with unknown usecases. --- gitlab/v4/objects.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 16564e4..80a6ca5 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -909,7 +909,7 @@ class ProjectCustomAttributeManager(RetrieveMixin, SetMixin, DeleteMixin, _from_parent_attrs = {'project_id': 'id'} -class ProjectJob(RESTObject): +class ProjectJob(RESTObject, RefreshMixin): @cli.register_custom_action('ProjectJob') @exc.on_http_error(exc.GitlabJobCancelError) def cancel(self, **kwargs): @@ -1045,7 +1045,7 @@ class ProjectJobManager(RetrieveMixin, RESTManager): _from_parent_attrs = {'project_id': 'id'} -class ProjectCommitStatus(RESTObject): +class ProjectCommitStatus(RESTObject, RefreshMixin): pass @@ -1964,7 +1964,7 @@ class ProjectPipelineJobsManager(ListMixin, RESTManager): _list_filters = ('scope',) -class ProjectPipeline(RESTObject): +class ProjectPipeline(RESTObject, RefreshMixin): _managers = (('jobs', 'ProjectPipelineJobManager'), ) @cli.register_custom_action('ProjectPipeline') -- cgit v1.2.1