public class MergeRequestApi extends AbstractApi
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.DeploymentStatus, Constants.Encoding, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.StateEvent, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
gitLabApi
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Constructor and Description |
---|
MergeRequestApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
MergeRequest |
acceptMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid)
Merge changes to the merge request.
|
MergeRequest |
acceptMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid,
String mergeCommitMessage,
Boolean shouldRemoveSourceBranch,
Boolean mergeWhenPipelineSucceeds)
Merge changes to the merge request.
|
MergeRequest |
acceptMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid,
String mergeCommitMessage,
Boolean shouldRemoveSourceBranch,
Boolean mergeWhenPipelineSucceeds,
String sha)
Merge changes to the merge request.
|
MergeRequest |
approveMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid,
String sha)
Approve a merge request.
|
MergeRequest |
cancelMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid)
Cancel merge when pipeline succeeds.
|
ApprovalRule |
createApprovalRule(Object projectIdOrPath,
Integer mergeRequestIid,
Integer projectRuleId,
ApprovalRuleParams params)
Create a merge request level approval rule.
|
MergeRequest |
createMergeRequest(Object projectIdOrPath,
MergeRequestParams params)
Creates a merge request.
|
MergeRequest |
createMergeRequest(Object projectIdOrPath,
String sourceBranch,
String targetBranch,
String title,
String description,
Integer assigneeId)
Creates a merge request and optionally assigns a reviewer to it.
|
MergeRequest |
createMergeRequest(Object projectIdOrPath,
String sourceBranch,
String targetBranch,
String title,
String description,
Integer assigneeId,
Integer targetProjectId,
String[] labels,
Integer milestoneId,
Boolean removeSourceBranch)
Creates a merge request.
|
MergeRequest |
createMergeRequest(Object projectIdOrPath,
String sourceBranch,
String targetBranch,
String title,
String description,
Integer assigneeId,
Integer targetProjectId,
String[] labels,
Integer milestoneId,
Boolean removeSourceBranch,
Boolean squash)
Creates a merge request.
|
void |
deleteApprovalRule(Object projectIdOrPath,
Integer mergeRequestIid,
Integer approvalRuleId)
Delete the specified the merge request level approval rule.
|
void |
deleteMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid)
Only for admins and project owners.
|
List<ApprovalRule> |
getApprovalRules(Object projectIdOrPath,
Integer mergeRequestIid)
Get a list of the merge request level approval rules.
|
Pager<ApprovalRule> |
getApprovalRules(Object projectIdOrPath,
Integer mergeRequestIid,
int itemsPerPage)
Get a Pager of the merge request level approval rules.
|
Stream<ApprovalRule> |
getApprovalRulesStream(Object projectIdOrPath,
Integer mergeRequestIid)
Get a Stream of the merge request level approval rules.
|
MergeRequest |
getApprovals(Object projectIdOrPath,
Integer mergeRequestIid)
Get the merge request with approval information.
|
ApprovalState |
getApprovalState(Object projectIdOrPath,
Integer mergeRequestIid)
Get the approval state of a merge request.
|
List<Issue> |
getApprovalStatus(Object projectIdOrPath,
Integer mergeRequestIid)
Get list containing all the issues that would be closed by merging the provided merge request.
|
List<Issue> |
getClosesIssues(Object projectIdOrPath,
Integer mergeRequestIid)
Get list containing all the issues that would be closed by merging the provided merge request.
|
Pager<Issue> |
getClosesIssues(Object projectIdOrPath,
Integer mergeRequestIid,
int itemsPerPage)
Get a Pager containing all the issues that would be closed by merging the provided merge request.
|
List<Issue> |
getClosesIssues(Object projectIdOrPath,
Integer mergeRequestIid,
int page,
int perPage)
Get list containing all the issues that would be closed by merging the provided merge request.
|
Stream<Issue> |
getClosesIssuesStream(Object projectIdOrPath,
Integer mergeRequestIid)
Get Stream containing all the issues that would be closed by merging the provided merge request.
|
List<Commit> |
getCommits(Object projectIdOrPath,
int mergeRequestIid)
Get a list of merge request commits.
|
Pager<Commit> |
getCommits(Object projectIdOrPath,
int mergeRequestIid,
int itemsPerPage)
Get a Pager of merge request commits.
|
List<Commit> |
getCommits(Object projectIdOrPath,
int mergeRequestIid,
int page,
int perPage)
Get a list of merge request commits.
|
Stream<Commit> |
getCommitsStream(Object projectIdOrPath,
int mergeRequestIid)
Get a Stream of merge request commits.
|
MergeRequest |
getMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid)
Get information about a single merge request.
|
MergeRequest |
getMergeRequestApprovals(Object projectIdOrPath,
Integer mergeRequestIid)
Get the merge request with approval information.
|
MergeRequest |
getMergeRequestChanges(Object projectIdOrPath,
Integer mergeRequestIid)
Get merge request with changes information.
|
List<MergeRequest> |
getMergeRequests(MergeRequestFilter filter)
Get all merge requests matching the filter.
|
Pager<MergeRequest> |
getMergeRequests(MergeRequestFilter filter,
int itemsPerPage)
Get all merge requests matching the filter.
|
List<MergeRequest> |
getMergeRequests(MergeRequestFilter filter,
int page,
int perPage)
Get all merge requests matching the filter.
|
List<MergeRequest> |
getMergeRequests(Object projectIdOrPath)
Get all merge requests for the specified project.
|
List<MergeRequest> |
getMergeRequests(Object projectIdOrPath,
Constants.MergeRequestState state)
Get all merge requests with a specific state for the specified project.
|
Pager<MergeRequest> |
getMergeRequests(Object projectIdOrPath,
Constants.MergeRequestState state,
int itemsPerPage)
Get all merge requests for the specified project.
|
List<MergeRequest> |
getMergeRequests(Object projectIdOrPath,
Constants.MergeRequestState state,
int page,
int perPage)
Get all merge requests for the specified project.
|
Pager<MergeRequest> |
getMergeRequests(Object projectIdOrPath,
int itemsPerPage)
Get all merge requests for the specified project.
|
List<MergeRequest> |
getMergeRequests(Object projectIdOrPath,
int page,
int perPage)
Get all merge requests for the specified project.
|
Stream<MergeRequest> |
getMergeRequestsStream(MergeRequestFilter filter)
Get all merge requests matching the filter as a Stream.
|
Stream<MergeRequest> |
getMergeRequestsStream(Object projectIdOrPath)
Get all merge requests for the specified project as a Stream
|
Stream<MergeRequest> |
getMergeRequestsStream(Object projectIdOrPath,
Constants.MergeRequestState state)
Get all merge requests with a specific state for the specified project as a Stream.
|
Optional<MergeRequest> |
getOptionalMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid)
Get information about a single merge request as an Optional instance.
|
List<Participant> |
getParticipants(Object projectIdOrPath,
Integer mergeRequestIid)
Get list of participants of merge request.
|
Pager<Participant> |
getParticipants(Object projectIdOrPath,
Integer mergeRequestIid,
int itemsPerPage)
Get a Pager of the participants of merge request.
|
List<Participant> |
getParticipants(Object projectIdOrPath,
Integer mergeRequestIid,
int page,
int perPage)
Get list of participants of merge request and in the specified page range.
|
Stream<Participant> |
getParticipantsStream(Object projectIdOrPath,
Integer mergeRequestIid)
Get Stream of participants of merge request.
|
MergeRequest |
unapproveMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid)
Unapprove a merge request.
|
ApprovalRule |
updateApprovalRule(Object projectIdOrPath,
Integer mergeRequestIid,
Integer approvalRuleId,
ApprovalRuleParams params)
Update the specified the merge request level approval rule.
|
MergeRequest |
updateMergeRequest(Object projectIdOrPath,
Integer mergeRequestIid,
MergeRequestParams params)
Updates an existing merge request.
|
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)
Updates an existing merge request.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
public MergeRequestApi(GitLabApi gitLabApi)
public List<MergeRequest> getMergeRequests(MergeRequestFilter filter) throws GitLabApiException
GitLab Endpoint: GET /merge_requests
filter
- a MergeRequestFilter instance with the filter settingsGitLabApiException
- if any exception occurspublic List<MergeRequest> getMergeRequests(MergeRequestFilter filter, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /merge_requests
filter
- a MergeRequestFilter instance with the filter settingspage
- the page to getperPage
- the number of MergeRequest instances per pageGitLabApiException
- if any exception occurspublic Pager<MergeRequest> getMergeRequests(MergeRequestFilter filter, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /merge_requests
filter
- a MergeRequestFilter instance with the filter settingsitemsPerPage
- the number of MergeRequest instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<MergeRequest> getMergeRequestsStream(MergeRequestFilter filter) throws GitLabApiException
GitLab Endpoint: GET /merge_requests
filter
- a MergeRequestFilter instance with the filter settingsGitLabApiException
- if any exception occurspublic List<MergeRequest> getMergeRequests(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic List<MergeRequest> getMergeRequests(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of MergeRequest instances per pageGitLabApiException
- if any exception occurspublic Pager<MergeRequest> getMergeRequests(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of MergeRequest instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<MergeRequest> getMergeRequestsStream(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic List<MergeRequest> getMergeRequests(Object projectIdOrPath, Constants.MergeRequestState state) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests?state=:state
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancestate
- the state parameter can be used to get only merge requests with a given state (opened, closed, or merged) or all of them (all).GitLabApiException
- if any exception occurspublic List<MergeRequest> getMergeRequests(Object projectIdOrPath, Constants.MergeRequestState state, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancestate
- 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 getperPage
- the number of MergeRequest instances per pageGitLabApiException
- if any exception occurspublic Pager<MergeRequest> getMergeRequests(Object projectIdOrPath, Constants.MergeRequestState state, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancestate
- 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 pageGitLabApiException
- if any exception occurspublic Stream<MergeRequest> getMergeRequestsStream(Object projectIdOrPath, Constants.MergeRequestState state) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests?state=:state
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancestate
- the state parameter can be used to get only merge requests with a given state (opened, closed, or merged) or all of them (all).GitLabApiException
- if any exception occurspublic MergeRequest getMergeRequest(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic Optional<MergeRequest> getOptionalMergeRequest(Object projectIdOrPath, Integer mergeRequestIid)
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestpublic List<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid, int page, int perPage) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestpage
- the page to getperPage
- the number of commits per pageGitLabApiException
- GitLabApiException if any exception occurs during executionpublic Pager<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid, int itemsPerPage) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestitemsPerPage
- the number of Commit instances that will be fetched per pageGitLabApiException
- GitLabApiException if any exception occurs during executionpublic Stream<Commit> getCommitsStream(Object projectIdOrPath, int mergeRequestIid) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- GitLabApiException if any exception occurs during executionpublic MergeRequest createMergeRequest(Object projectIdOrPath, MergeRequestParams params) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceparams
- a MergeRequestParams instance holding the info to create the merge requestGitLabApiException
- if any exception occurspublic 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
GitLab Endpoint: POST /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesourceBranch
- the source branch, requiredtargetBranch
- the target branch, requiredtitle
- the title for the merge request, requireddescription
- the description of the merge requestassigneeId
- the Assignee user ID, optionaltargetProjectId
- the ID of a target project, optionallabels
- labels for MR, optionalmilestoneId
- the ID of a milestone, optionalremoveSourceBranch
- Flag indicating if a merge request should remove the source branch when merging, optionalsquash
- Squash commits into a single commit when merging, optionalGitLabApiException
- if any exception occurspublic MergeRequest createMergeRequest(Object projectIdOrPath, String sourceBranch, String targetBranch, String title, String description, Integer assigneeId, Integer targetProjectId, String[] labels, Integer milestoneId, Boolean removeSourceBranch) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesourceBranch
- the source branch, requiredtargetBranch
- the target branch, requiredtitle
- the title for the merge request, requireddescription
- the description of the merge requestassigneeId
- the Assignee user ID, optionaltargetProjectId
- the ID of a target project, optionallabels
- labels for MR, optionalmilestoneId
- the ID of a milestone, optionalremoveSourceBranch
- Flag indicating if a merge request should remove the source branch when merging, optionalGitLabApiException
- if any exception occurspublic MergeRequest createMergeRequest(Object projectIdOrPath, String sourceBranch, String targetBranch, String title, String description, Integer assigneeId) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/merge_requests
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesourceBranch
- the source branch, requiredtargetBranch
- the target branch, requiredtitle
- the title for the merge request, requireddescription
- the description of the merge requestassigneeId
- the Assignee user ID, optionalGitLabApiException
- if any exception occurspublic MergeRequest updateMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, MergeRequestParams params) throws GitLabApiException
GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge request to updateparams
- a MergeRequestParams instance holding the info to update the merge requestGitLabApiException
- if any exception occurspublic 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
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge request to updatetargetBranch
- the target branch, optionaltitle
- the title for the merge requestassigneeId
- the Assignee user ID, optionaldescription
- the description of the merge request, optionalstateEvent
- new state for the merge request, optionallabels
- comma separated list of labels, optionalmilestoneId
- the ID of a milestone, optionalremoveSourceBranch
- Flag indicating if a merge request should remove the source
branch when merging, optionalsquash
- Squash commits into a single commit when merging, optionaldiscussionLocked
- Flag indicating if the merge request's discussion is locked, optionalallowCollaboration
- Allow commits from members who can merge to the target branch,
optionalGitLabApiException
- if any exception occurspublic void deleteMergeRequest(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic MergeRequest acceptMergeRequest(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic MergeRequest acceptMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, String mergeCommitMessage, Boolean shouldRemoveSourceBranch, Boolean mergeWhenPipelineSucceeds) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestmergeCommitMessage,
- custom merge commit message, optionalshouldRemoveSourceBranch,
- if true removes the source branch, optionalmergeWhenPipelineSucceeds,
- if true the MR is merged when the pipeline, optionalGitLabApiException
- if any exception occurspublic MergeRequest acceptMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, String mergeCommitMessage, Boolean shouldRemoveSourceBranch, Boolean mergeWhenPipelineSucceeds, String sha) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestmergeCommitMessage,
- custom merge commit message, optionalshouldRemoveSourceBranch,
- if true removes the source branch, optionalmergeWhenPipelineSucceeds,
- if true the MR is merged when the pipeline, optionalsha
- if present, then this SHA must match the HEAD of the source branch, otherwise the merge will fail, optionalGitLabApiException
- if any exception occurspublic MergeRequest cancelMergeRequest(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
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
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic MergeRequest getMergeRequestApprovals(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/approvals
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic MergeRequest getApprovals(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/approvals
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic ApprovalState getApprovalState(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/approval_state
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic List<ApprovalRule> getApprovalRules(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/approval_rules
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic Pager<ApprovalRule> getApprovalRules(Object projectIdOrPath, Integer mergeRequestIid, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/approval_rules
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestitemsPerPage
- the number of ApprovalRule instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<ApprovalRule> getApprovalRulesStream(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/approval_rules
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic ApprovalRule createApprovalRule(Object projectIdOrPath, Integer mergeRequestIid, Integer projectRuleId, ApprovalRuleParams params) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/approval_rules
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestprojectRuleId
- the ID of a project-level approval ruleparams
- the ApprovalRuleParams instance holding the parameters for the approval ruleGitLabApiException
- if any exception occurspublic ApprovalRule updateApprovalRule(Object projectIdOrPath, Integer mergeRequestIid, Integer approvalRuleId, ApprovalRuleParams params) throws GitLabApiException
GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid/approval_rules/:approval_rule_id
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestapprovalRuleId
- the ID of the approval ruleparams
- the ApprovalRuleParams instance holding the parameters for the approval rule updateGitLabApiException
- if any exception occurspublic void deleteApprovalRule(Object projectIdOrPath, Integer mergeRequestIid, Integer approvalRuleId) throws GitLabApiException
GitLab Endpoint: DELETE /projects/:id/merge_requests/:merge_request_iid/approval_rules/:approval_rule_id
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestapprovalRuleId
- the ID of the approval ruleGitLabApiException
- if any exception occurspublic MergeRequest approveMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, String sha) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/approve
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestsha
- the HEAD of the merge request, optionalGitLabApiException
- if any exception occurspublic MergeRequest unapproveMergeRequest(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/unapprove
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the internal ID of the merge requestGitLabApiException
- if any exception occurspublic MergeRequest getMergeRequestChanges(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/changes
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the IID of the merge request to getGitLabApiException
- if any exception occurspublic List<Participant> getParticipants(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the IID of the merge request to getGitLabApiException
- if any exception occurspublic List<Participant> getParticipants(Object projectIdOrPath, Integer mergeRequestIid, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the IID of the merge request to getpage
- the page to getperPage
- the number of projects per pageGitLabApiException
- if any exception occurspublic Pager<Participant> getParticipants(Object projectIdOrPath, Integer mergeRequestIid, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the IID of the merge request to getitemsPerPage
- the number of Participant instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<Participant> getParticipantsStream(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/participants
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- the IID of the merge request to getGitLabApiException
- if any exception occurspublic List<Issue> getClosesIssues(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the IID of the merge request to get the closes issues forGitLabApiException
- if any exception occurspublic List<Issue> getClosesIssues(Object projectIdOrPath, Integer mergeRequestIid, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the IID of the merge request to get the closes issues forpage
- the page to getperPage
- the number of issues per pageGitLabApiException
- if any exception occurspublic Pager<Issue> getClosesIssues(Object projectIdOrPath, Integer mergeRequestIid, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the IID of the merge request to get the closes issues foritemsPerPage
- the number of Issue instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<Issue> getClosesIssuesStream(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the IID of the merge request to get the closes issues forGitLabApiException
- if any exception occurspublic List<Issue> getApprovalStatus(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or pathmergeRequestIid
- the IID of the merge request to get the closes issues forGitLabApiException
- if any exception occursCopyright © 2019. All rights reserved.