Class MergeRequestApi

  • All Implemented Interfaces:
    Constants

    public class MergeRequestApi
    extends AbstractApi
    This class implements the client side API for the GitLab merge request calls.
    • Constructor Detail

      • MergeRequestApi

        public MergeRequestApi​(GitLabApi gitLabApi)
    • Method Detail

      • getMergeRequests

        public List<MergeRequest> getMergeRequests​(MergeRequestFilter filter)
                                            throws GitLabApiException
        Get all merge requests matching the filter.
        GitLab Endpoint: GET /merge_requests
        Parameters:
        filter - a MergeRequestFilter instance with the filter settings
        Returns:
        all merge requests for the specified project matching the filter
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public List<MergeRequest> getMergeRequests​(MergeRequestFilter filter,
                                                   int page,
                                                   int perPage)
                                            throws GitLabApiException
        Get all merge requests matching the filter.
        GitLab Endpoint: GET /merge_requests
        Parameters:
        filter - a MergeRequestFilter instance with the filter settings
        page - the page to get
        perPage - the number of MergeRequest instances per page
        Returns:
        all merge requests for the specified project matching the filter
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public Pager<MergeRequest> getMergeRequests​(MergeRequestFilter filter,
                                                    int itemsPerPage)
                                             throws GitLabApiException
        Get all merge requests matching the filter.
        GitLab Endpoint: GET /merge_requests
        Parameters:
        filter - a MergeRequestFilter instance with the filter settings
        itemsPerPage - the number of MergeRequest instances that will be fetched per page
        Returns:
        all merge requests for the specified project matching the filter
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequestsStream

        public Stream<MergeRequest> getMergeRequestsStream​(MergeRequestFilter filter)
                                                    throws GitLabApiException
        Get all merge requests matching the filter as a Stream.
        GitLab Endpoint: GET /merge_requests
        Parameters:
        filter - a MergeRequestFilter instance with the filter settings
        Returns:
        a Stream containing all the merge requests for the specified project matching the filter
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public List<MergeRequest> getMergeRequests​(Object projectIdOrPath)
                                            throws GitLabApiException
        Get all merge requests for the specified project.
        GitLab Endpoint: GET /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        all merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public List<MergeRequest> getMergeRequests​(Object projectIdOrPath,
                                                   int page,
                                                   int perPage)
                                            throws GitLabApiException
        Get all merge requests for the specified project.
        GitLab Endpoint: GET /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of MergeRequest instances per page
        Returns:
        all merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public Pager<MergeRequest> getMergeRequests​(Object projectIdOrPath,
                                                    int itemsPerPage)
                                             throws GitLabApiException
        Get all merge requests for the specified project.
        GitLab Endpoint: GET /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of MergeRequest instances that will be fetched per page
        Returns:
        all merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequestsStream

        public Stream<MergeRequest> getMergeRequestsStream​(Object projectIdOrPath)
                                                    throws GitLabApiException
        Get all merge requests for the specified project as a Stream
        GitLab Endpoint: GET /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a Stream with all merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public List<MergeRequest> getMergeRequests​(Object projectIdOrPath,
                                                   Constants.MergeRequestState state)
                                            throws GitLabApiException
        Get all merge requests with a specific state for the specified project.
        GitLab Endpoint: GET /projects/:id/merge_requests?state=:state
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        state - the state parameter can be used to get only merge requests with a given state (opened, closed, or merged) or all of them (all).
        Returns:
        all merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public List<MergeRequest> getMergeRequests​(Object projectIdOrPath,
                                                   Constants.MergeRequestState state,
                                                   int page,
                                                   int perPage)
                                            throws GitLabApiException
        Get all merge requests for the specified project.
        GitLab Endpoint: GET /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        state - the state parameter can be used to get only merge requests with a given state (opened, closed, or merged) or all of them (all).
        page - the page to get
        perPage - the number of MergeRequest instances per page
        Returns:
        all merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequests

        public Pager<MergeRequest> getMergeRequests​(Object projectIdOrPath,
                                                    Constants.MergeRequestState state,
                                                    int itemsPerPage)
                                             throws GitLabApiException
        Get all merge requests for the specified project.
        GitLab Endpoint: GET /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        state - the state parameter can be used to get only merge requests with a given state (opened, closed, or merged) or all of them (all).
        itemsPerPage - the number of MergeRequest instances that will be fetched per page
        Returns:
        all merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequestsStream

        public Stream<MergeRequest> getMergeRequestsStream​(Object projectIdOrPath,
                                                           Constants.MergeRequestState state)
                                                    throws GitLabApiException
        Get all merge requests with a specific state for the specified project as a Stream.
        GitLab Endpoint: GET /projects/:id/merge_requests?state=:state
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        state - the state parameter can be used to get only merge requests with a given state (opened, closed, or merged) or all of them (all).
        Returns:
        a Stream with all the merge requests for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequest

        public MergeRequest getMergeRequest​(Object projectIdOrPath,
                                            Integer mergeRequestIid)
                                     throws GitLabApiException
        Get information about a single merge request.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        the specified MergeRequest instance
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalMergeRequest

        public Optional<MergeRequest> getOptionalMergeRequest​(Object projectIdOrPath,
                                                              Integer mergeRequestIid)
        Get information about a single merge request as an Optional instance.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        the specified MergeRequest as an Optional instance instance
      • getCommits

        public List<Commit> getCommits​(Object projectIdOrPath,
                                       int mergeRequestIid)
                                throws GitLabApiException
        Get a list of merge request commits.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/commits
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        a list containing the commits for the specified merge request
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public List<Commit> getCommits​(Object projectIdOrPath,
                                       int mergeRequestIid,
                                       int page,
                                       int perPage)
                                throws GitLabApiException
        Get a list of merge request commits.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/commits
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        page - the page to get
        perPage - the number of commits per page
        Returns:
        a list containing the commits for the specified merge request
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommits

        public Pager<Commit> getCommits​(Object projectIdOrPath,
                                        int mergeRequestIid,
                                        int itemsPerPage)
                                 throws GitLabApiException
        Get a Pager of merge request commits.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/commits
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        itemsPerPage - the number of Commit instances that will be fetched per page
        Returns:
        a Pager containing the commits for the specified merge request
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getCommitsStream

        public Stream<Commit> getCommitsStream​(Object projectIdOrPath,
                                               int mergeRequestIid)
                                        throws GitLabApiException
        Get a Stream of merge request commits.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/commits
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        a Stream containing the commits for the specified merge request
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • createMergeRequest

        public MergeRequest createMergeRequest​(Object projectIdOrPath,
                                               String sourceBranch,
                                               String targetBranch,
                                               String title,
                                               String description,
                                               Integer assigneeId,
                                               Integer targetProjectId,
                                               String[] labels,
                                               Integer milestoneId,
                                               Boolean removeSourceBranch,
                                               Boolean squash)
                                        throws GitLabApiException
        Creates a merge request and optionally assigns a reviewer to it.
        GitLab Endpoint: POST /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sourceBranch - the source branch, required
        targetBranch - the target branch, required
        title - the title for the merge request, required
        description - the description of the merge request
        assigneeId - the Assignee user ID, optional
        targetProjectId - the ID of a target project, optional
        labels - labels for MR, optional
        milestoneId - the ID of a milestone, optional
        removeSourceBranch - Flag indicating if a merge request should remove the source branch when merging, optional
        squash - Squash commits into a single commit when merging, optional
        Returns:
        the created MergeRequest instance
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab Starter 8.17, GitLab CE 11.0.
      • createMergeRequest

        public MergeRequest createMergeRequest​(Object projectIdOrPath,
                                               String sourceBranch,
                                               String targetBranch,
                                               String title,
                                               String description,
                                               Integer assigneeId,
                                               Integer targetProjectId,
                                               String[] labels,
                                               Integer milestoneId,
                                               Boolean removeSourceBranch)
                                        throws GitLabApiException
        Creates a merge request and optionally assigns a reviewer to it.
        GitLab Endpoint: POST /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sourceBranch - the source branch, required
        targetBranch - the target branch, required
        title - the title for the merge request, required
        description - the description of the merge request
        assigneeId - the Assignee user ID, optional
        targetProjectId - the ID of a target project, optional
        labels - labels for MR, optional
        milestoneId - the ID of a milestone, optional
        removeSourceBranch - Flag indicating if a merge request should remove the source branch when merging, optional
        Returns:
        the created MergeRequest instance
        Throws:
        GitLabApiException - if any exception occurs
      • createMergeRequest

        public MergeRequest createMergeRequest​(Object projectIdOrPath,
                                               String sourceBranch,
                                               String targetBranch,
                                               String title,
                                               String description,
                                               Integer assigneeId)
                                        throws GitLabApiException
        Creates a merge request and optionally assigns a reviewer to it.
        GitLab Endpoint: POST /projects/:id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        sourceBranch - the source branch, required
        targetBranch - the target branch, required
        title - the title for the merge request, required
        description - the description of the merge request
        assigneeId - the Assignee user ID, optional
        Returns:
        the created MergeRequest instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateMergeRequest

        public MergeRequest updateMergeRequest​(Object projectIdOrPath,
                                               Integer mergeRequestIid,
                                               String targetBranch,
                                               String title,
                                               Integer assigneeId,
                                               String description,
                                               Constants.StateEvent stateEvent,
                                               String labels,
                                               Integer milestoneId,
                                               Boolean removeSourceBranch,
                                               Boolean squash,
                                               Boolean discussionLocked,
                                               Boolean allowCollaboration)
                                        throws GitLabApiException
        Updates an existing merge request. You can change branches, title, or even close the MR.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request to update
        targetBranch - the target branch, optional
        title - the title for the merge request
        assigneeId - the Assignee user ID, optional
        description - the description of the merge request, optional
        stateEvent - new state for the merge request, optional
        labels - comma separated list of labels, optional
        milestoneId - the ID of a milestone, optional
        removeSourceBranch - Flag indicating if a merge request should remove the source branch when merging, optional
        squash - Squash commits into a single commit when merging, optional
        discussionLocked - Flag indicating if the merge request's discussion is locked, optional
        allowCollaboration - Allow commits from members who can merge to the target branch, optional
        Returns:
        the updated merge request
        Throws:
        GitLabApiException - if any exception occurs
      • updateMergeRequest

        @Deprecated
        public MergeRequest updateMergeRequest​(Object projectIdOrPath,
                                               Integer mergeRequestIid,
                                               String targetBranch,
                                               String title,
                                               Integer assigneeId,
                                               String description,
                                               Constants.StateEvent stateEvent,
                                               String labels,
                                               Integer milestoneId)
                                        throws GitLabApiException
        Deprecated.
        Updates an existing merge request. You can change branches, title, or even close the MR.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request to update
        targetBranch - the target branch, optional
        title - the title for the merge request
        assigneeId - the Assignee user ID, optional
        description - the description of the merge request, optional
        stateEvent - new state for the merge request, optional
        labels - comma separated list of labels, optional
        milestoneId - the ID of a milestone, optional
        Returns:
        the updated merge request
        Throws:
        GitLabApiException - if any exception occurs
      • updateMergeRequest

        @Deprecated
        public MergeRequest updateMergeRequest​(Object projectIdOrPath,
                                               Integer mergeRequestIid,
                                               String sourceBranch,
                                               String targetBranch,
                                               String title,
                                               String description,
                                               Integer assigneeId)
                                        throws GitLabApiException
        Deprecated.
        as of release 4.4.3
        Updates an existing merge request. You can change branches, title, or even close the MR.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request to update
        sourceBranch - the source branch
        targetBranch - the target branch
        title - the title for the merge request
        description - the description of the merge request
        assigneeId - the Assignee user ID, optional
        Returns:
        the updated merge request
        Throws:
        GitLabApiException - if any exception occurs
      • deleteMergeRequest

        public void deleteMergeRequest​(Object projectIdOrPath,
                                       Integer mergeRequestIid)
                                throws GitLabApiException
        Only for admins and project owners. Soft deletes the specified merge.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: DELETE /projects/:id/merge_requests/:merge_request_iid
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Throws:
        GitLabApiException - if any exception occurs
      • acceptMergeRequest

        public MergeRequest acceptMergeRequest​(Object projectIdOrPath,
                                               Integer mergeRequestIid)
                                        throws GitLabApiException
        Merge changes to the merge request. If the MR has any conflicts and can not be merged, you'll get a 405 and the error message 'Branch cannot be merged'. If merge request is already merged or closed, you'll get a 406 and the error message 'Method Not Allowed'. If the sha parameter is passed and does not match the HEAD of the source, you'll get a 409 and the error message 'SHA does not match HEAD of source branch'. If you don't have permissions to accept this merge request, you'll get a 401.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid/merge
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        the merged merge request
        Throws:
        GitLabApiException - if any exception occurs
      • acceptMergeRequest

        public MergeRequest acceptMergeRequest​(Object projectIdOrPath,
                                               Integer mergeRequestIid,
                                               String mergeCommitMessage,
                                               Boolean shouldRemoveSourceBranch,
                                               Boolean mergeWhenPipelineSucceeds)
                                        throws GitLabApiException
        Merge changes to the merge request. If the MR has any conflicts and can not be merged, you'll get a 405 and the error message 'Branch cannot be merged'. If merge request is already merged or closed, you'll get a 406 and the error message 'Method Not Allowed'. If the sha parameter is passed and does not match the HEAD of the source, you'll get a 409 and the error message 'SHA does not match HEAD of source branch'. If you don't have permissions to accept this merge request, you'll get a 401.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request. Additionally, mergeWhenPipelineSucceeds sets the merge_when_build_succeeds flag for GitLab API V3.

        GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid/merge
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        mergeCommitMessage - , custom merge commit message, optional
        shouldRemoveSourceBranch - , if true removes the source branch, optional
        mergeWhenPipelineSucceeds - , if true the MR is merged when the pipeline, optional
        Returns:
        the merged merge request
        Throws:
        GitLabApiException - if any exception occurs
      • acceptMergeRequest

        public MergeRequest acceptMergeRequest​(Object projectIdOrPath,
                                               Integer mergeRequestIid,
                                               String mergeCommitMessage,
                                               Boolean shouldRemoveSourceBranch,
                                               Boolean mergeWhenPipelineSucceeds,
                                               String sha)
                                        throws GitLabApiException
        Merge changes to the merge request. If the MR has any conflicts and can not be merged, you'll get a 405 and the error message 'Branch cannot be merged'. If merge request is already merged or closed, you'll get a 406 and the error message 'Method Not Allowed'. If the sha parameter is passed and does not match the HEAD of the source, you'll get a 409 and the error message 'SHA does not match HEAD of source branch'. If you don't have permissions to accept this merge request, you'll get a 401.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request. Additionally, mergeWhenPipelineSucceeds sets the merge_when_build_succeeds flag for GitLab API V3.

        GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid/merge
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        mergeCommitMessage - , custom merge commit message, optional
        shouldRemoveSourceBranch - , if true removes the source branch, optional
        mergeWhenPipelineSucceeds - , if true the MR is merged when the pipeline, optional
        sha - if present, then this SHA must match the HEAD of the source branch, otherwise the merge will fail, optional
        Returns:
        the merged merge request
        Throws:
        GitLabApiException - if any exception occurs
      • cancelMergeRequest

        public MergeRequest cancelMergeRequest​(Object projectIdOrPath,
                                               Integer mergeRequestIid)
                                        throws GitLabApiException
        Cancel merge when pipeline succeeds. If you don't have permissions to accept this merge request, you'll get a 401. If the merge request is already merged or closed, you get 405 and error message 'Method Not Allowed'. In case the merge request is not set to be merged when the pipeline succeeds, you'll also get a 406 error.

        NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.

        GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        the updated merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequestApprovals

        public MergeRequest getMergeRequestApprovals​(Object projectIdOrPath,
                                                     Integer mergeRequestIid)
                                              throws GitLabApiException
        Get the merge request with approval information. Note: This API endpoint is only available on 8.9 EE and above.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/approvals
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        a MergeRequest instance with approval information included
        Throws:
        GitLabApiException - if any exception occurs
      • approveMergeRequest

        public MergeRequest approveMergeRequest​(Object projectIdOrPath,
                                                Integer mergeRequestIid,
                                                String sha)
                                         throws GitLabApiException
        Approve a merge request. Note: This API endpoint is only available on 8.9 EE and above.
        GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/approve
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        sha - the HEAD of the merge request, optional
        Returns:
        a MergeRequest instance with approval information included
        Throws:
        GitLabApiException - if any exception occurs
      • unapproveMergeRequest

        public MergeRequest unapproveMergeRequest​(Object projectIdOrPath,
                                                  Integer mergeRequestIid)
                                           throws GitLabApiException
        Unapprove a merge request. Note: This API endpoint is only available on 8.9 EE and above.
        GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/unapprove
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        a MergeRequest instance with approval information included
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequestChanges

        public MergeRequest getMergeRequestChanges​(Object projectIdOrPath,
                                                   Integer mergeRequestIid)
                                            throws GitLabApiException
        Get merge request with changes information.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/changes
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the IID of the merge request to get
        Returns:
        a merge request including its changes
        Throws:
        GitLabApiException - if any exception occurs
      • getParticipants

        public List<Participant> getParticipants​(Object projectIdOrPath,
                                                 Integer mergeRequestIid)
                                          throws GitLabApiException
        Get list of participants of merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the IID of the merge request to get
        Returns:
        a List containing all participants for the specified merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getParticipants

        public List<Participant> getParticipants​(Object projectIdOrPath,
                                                 Integer mergeRequestIid,
                                                 int page,
                                                 int perPage)
                                          throws GitLabApiException
        Get list of participants of merge request and in the specified page range.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the IID of the merge request to get
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a List containing all participants for the specified merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getParticipants

        public Pager<Participant> getParticipants​(Object projectIdOrPath,
                                                  Integer mergeRequestIid,
                                                  int itemsPerPage)
                                           throws GitLabApiException
        Get a Pager of the participants of merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the IID of the merge request to get
        itemsPerPage - the number of Participant instances that will be fetched per page
        Returns:
        a Pager containing all participants for the specified merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getParticipantsStream

        public Stream<Participant> getParticipantsStream​(Object projectIdOrPath,
                                                         Integer mergeRequestIid)
                                                  throws GitLabApiException
        Get Stream of participants of merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the IID of the merge request to get
        Returns:
        a Stream containing all participants for the specified merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getClosesIssues

        public List<Issue> getClosesIssues​(Object projectIdOrPath,
                                           Integer mergeRequestIid)
                                    throws GitLabApiException
        Get list containing all the issues that would be closed by merging the provided merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the IID of the merge request to get the closes issues for
        Returns:
        a List containing all the issues that would be closed by merging the provided merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getClosesIssues

        public List<Issue> getClosesIssues​(Object projectIdOrPath,
                                           Integer mergeRequestIid,
                                           int page,
                                           int perPage)
                                    throws GitLabApiException
        Get list containing all the issues that would be closed by merging the provided merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the IID of the merge request to get the closes issues for
        page - the page to get
        perPage - the number of issues per page
        Returns:
        a List containing all the issues that would be closed by merging the provided merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getClosesIssues

        public Pager<Issue> getClosesIssues​(Object projectIdOrPath,
                                            Integer mergeRequestIid,
                                            int itemsPerPage)
                                     throws GitLabApiException
        Get a Pager containing all the issues that would be closed by merging the provided merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the IID of the merge request to get the closes issues for
        itemsPerPage - the number of Issue instances that will be fetched per page
        Returns:
        a Pager containing all the issues that would be closed by merging the provided merge request
        Throws:
        GitLabApiException - if any exception occurs
      • getClosesIssuesStream

        public Stream<Issue> getClosesIssuesStream​(Object projectIdOrPath,
                                                   Integer mergeRequestIid)
                                            throws GitLabApiException
        Get Stream containing all the issues that would be closed by merging the provided merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the IID of the merge request to get the closes issues for
        Returns:
        a Stream containing all the issues that would be closed by merging the provided merge request
        Throws:
        GitLabApiException - if any exception occurs