@@ -205,8 +205,27 @@ public List<Job> getJobsForPipeline(Object projectIdOrPath, long pipelineId, Job
205
205
* @throws GitLabApiException if any exception occurs during execution
206
206
*/
207
207
public Pager <Job > getJobsForPipeline (Object projectIdOrPath , long pipelineId , int itemsPerPage ) throws GitLabApiException {
208
- return (new Pager <Job >(this , Job .class , itemsPerPage , getDefaultPerPageParam (),
209
- "projects" , getProjectIdOrPath (projectIdOrPath ), "pipelines" , pipelineId , "jobs" ));
208
+ return getJobsForPipeline (projectIdOrPath , pipelineId , itemsPerPage , null );
209
+ }
210
+
211
+ /**
212
+ * Get a Pager of jobs in a pipeline.
213
+ *
214
+ * <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs</code></pre>
215
+ *
216
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
217
+ * @param pipelineId the pipeline ID to get the list of jobs for
218
+ * @param itemsPerPage the number of Job instances that will be fetched per page
219
+ * @param includeRetried Include retried jobs in the response
220
+ * @return a list containing the jobs for the specified project ID and pipeline ID
221
+ * @throws GitLabApiException if any exception occurs during execution
222
+ */
223
+ public Pager <Job > getJobsForPipeline (Object projectIdOrPath , long pipelineId , int itemsPerPage , Boolean includeRetried ) throws GitLabApiException {
224
+ GitLabApiForm formData = new GitLabApiForm ()
225
+ .withParam ("include_retried" , includeRetried )
226
+ .withParam (PER_PAGE_PARAM , getDefaultPerPage ());
227
+ return (new Pager <Job >(this , Job .class , itemsPerPage , formData .asMap (),
228
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "pipelines" , pipelineId , "jobs" ));
210
229
}
211
230
212
231
/**
@@ -222,6 +241,20 @@ public Stream<Job> getJobsStream(Object projectIdOrPath, long pipelineId) throws
222
241
return (getJobsForPipeline (projectIdOrPath , pipelineId , getDefaultPerPage ()).stream ());
223
242
}
224
243
244
+ /**
245
+ * Get a Stream of jobs in a pipeline.
246
+ * <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/jobs</code></pre>
247
+ *
248
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
249
+ * @param pipelineId the pipeline ID to get the list of jobs for
250
+ * @param includeRetried Include retried jobs in the response
251
+ * @return a Stream containing the jobs for the specified project ID
252
+ * @throws GitLabApiException if any exception occurs during execution
253
+ */
254
+ public Stream <Job > getJobsStream (Object projectIdOrPath , long pipelineId , Boolean includeRetried ) throws GitLabApiException {
255
+ return (getJobsForPipeline (projectIdOrPath , pipelineId , getDefaultPerPage (), includeRetried ).stream ());
256
+ }
257
+
225
258
/**
226
259
* Get single job in a project.
227
260
*
0 commit comments