Commit 8ee5beca authored by Jeremie Bresson's avatar Jeremie Bresson
Browse files

Merge remote-tracking branch 'origin/main' into 6.x

parents 4ac5e9c5 c3a03414
......@@ -496,11 +496,37 @@ public class MilestonesApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
*/
public List<MergeRequest> getMergeRequest(Object projectIdOrPath, Long milestoneId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "milestones", milestoneId, "merge_requests");
return (response.readEntity(new GenericType<List<MergeRequest>>() {}));
return (getMergeRequest(projectIdOrPath, milestoneId, getDefaultPerPage()).all());
}
/**
* Get a Pager of merge requests associated with the specified milestone.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/merge_requests</code></pre>
*
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
* @param milestoneId the milestone ID to get the merge requests for
* @return a Pager of merge requests associated with the specified milestone
* @throws GitLabApiException if any exception occurs
*/
public Pager<MergeRequest> getMergeRequest(Object projectIdOrPath, Long milestoneId, int itemsPerPage) throws GitLabApiException {
return (new Pager<MergeRequest>(this, MergeRequest.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "milestones", milestoneId, "merge_requests"));
}
/**
* Get a Stream of merge requests associated with the specified milestone.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/merge_requests</code></pre>
*
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
* @param milestoneId the milestone ID to get the merge requests for
* @return a Stream of merge requests associated with the specified milestone
* @throws GitLabApiException if any exception occurs
*/
public Stream<MergeRequest> getMergeRequestStream(Object projectIdOrPath, Long milestoneId) throws GitLabApiException {
return (getMergeRequest(projectIdOrPath, milestoneId, getDefaultPerPage()).stream());
}
/**
* Create a milestone.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment