|
10 | 10 | import org.gitlab4j.api.GitLabApi.ApiVersion; |
11 | 11 | import org.gitlab4j.api.models.Commit; |
12 | 12 | import org.gitlab4j.api.models.MergeRequest; |
| 13 | +import org.gitlab4j.api.models.Participant; |
13 | 14 |
|
14 | 15 | /** |
15 | 16 | * This class implements the client side API for the GitLab merge request calls. |
@@ -577,4 +578,34 @@ public MergeRequest unapproveMergeRequest(Integer projectId, Integer mergeReques |
577 | 578 | Response response = post(Response.Status.OK, (Form)null, "projects", projectId, "merge_requests", mergeRequestIid, "unapprove"); |
578 | 579 | return (response.readEntity(MergeRequest.class)); |
579 | 580 | } |
| 581 | + |
| 582 | + /** |
| 583 | + * Get merge request with changes information. |
| 584 | + * |
| 585 | + * GET /projects/:id/merge_requests/:merge_request_iid/changes |
| 586 | + * |
| 587 | + * @param projectId the project ID to get the merge requests for |
| 588 | + * @param mergeRequestIid the IID of the merge request to get |
| 589 | + * @return a merge request including its changes |
| 590 | + * @throws GitLabApiException if any exception occurs |
| 591 | + */ |
| 592 | + public MergeRequest getMergeRequestChanges(Integer projectId, Integer mergeRequestIid) throws GitLabApiException { |
| 593 | + Response response = get(Response.Status.OK, null, "projects", projectId, "merge_requests", mergeRequestIid, "changes"); |
| 594 | + return (response.readEntity(MergeRequest.class)); |
| 595 | + } |
| 596 | + |
| 597 | + /** |
| 598 | + * Get participants of merge request. |
| 599 | + * |
| 600 | + * GET /projects/:id/merge_requests/:merge_request_iid/participants |
| 601 | + * |
| 602 | + * @param projectId the project ID to get the merge requests for |
| 603 | + * @param mergeRequestIid the IID of the merge request to get |
| 604 | + * @param itemsPerPage the number of Participant instances that will be fetched per page |
| 605 | + * @return all participants for the specified merge request |
| 606 | + * @throws GitLabApiException if any exception occurs |
| 607 | + */ |
| 608 | + public Pager<Participant> getParticipants(Integer projectId, Integer mergeRequestIid, int itemsPerPage) throws GitLabApiException { |
| 609 | + return new Pager<Participant>(this, Participant.class, itemsPerPage, null, "projects", projectId, "merge_requests", mergeRequestIid, "participants"); |
| 610 | + } |
580 | 611 | } |
0 commit comments