Package org.gitlab4j.api.models
Class MergeRequestParams
java.lang.Object
org.gitlab4j.api.models.MergeRequestParams
This class provides the form parameters for creating and updating merge requests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetForm
(boolean isCreate) Get the form params specified by this instance.withAllowCollaboration
(Boolean allowCollaboration) Allow commits from members who can merge to the target branch.withApprovalsBeforeMerge
(Integer approvalsBeforeMerge) Set the approvals_before_merge field value.withAssigneeId
(Long assigneeId) Set the assignee user ID.withAssigneeIds
(List<Long> assigneeIds) The ID of the user(s) to assign the merge request to.withDescription
(String description) Set the description of the merge request.withDiscussionLocked
(Boolean discussionLocked) Flag indicating if the merge request’s discussion is locked.withLabels
(String[] labels) Set the labels for the merge request.withLabels
(List<String> labels) Set the labels for the merge request.withMilestoneId
(Long milestoneId) Set the milestone ID field value.withRemoveSourceBranch
(Boolean removeSourceBranch) Flag indicating if a merge request should remove the source branch when merging.withReviewerIds
(List<Long> reviewerIds) The ID of the user(s) to assign to the review of the merge request.withSourceBranch
(String sourceBranch) Set the source branch.withSquash
(Boolean squash) Squash commits into a single commit when merging.withStateEvent
(Constants.StateEvent stateEvent) New state (close/reopen).withTargetBranch
(String targetBranch) Set the target branch.withTargetProjectId
(Long targetProjectId) Set the target project ID.Set the title of the merge request.
-
Constructor Details
-
MergeRequestParams
public MergeRequestParams()
-
-
Method Details
-
withSourceBranch
Set the source branch. This is for merge request creation only.- Parameters:
sourceBranch
- the sourceBranch to set- Returns:
- the reference to this MergeRequestParams instance
-
withTargetBranch
Set the target branch.- Parameters:
targetBranch
- the targetBranch to set- Returns:
- the reference to this MergeRequestParams instance
-
withTitle
Set the title of the merge request.- Parameters:
title
- the title to set- Returns:
- the reference to this MergeRequestParams instance
-
withAssigneeId
Set the assignee user ID.- Parameters:
assigneeId
- the assigneeId to set- Returns:
- the reference to this MergeRequestParams instance
-
withAssigneeIds
The ID of the user(s) to assign the merge request to. Set to 0 or provide an empty value to unassign all assignees.- Parameters:
assigneeIds
- the assigneeIds to set- Returns:
- the reference to this MergeRequestParams instance
-
withReviewerIds
The ID of the user(s) to assign to the review of the merge request. Set to 0 or provide an empty value to unassign all reviewers.- Parameters:
reviewerIds
- the reviewerIds to set- Returns:
- the reference to this MergeRequestParams instance
-
withMilestoneId
Set the milestone ID field value.- Parameters:
milestoneId
- the milestoneId to set- Returns:
- the reference to this MergeRequestParams instance
-
withLabels
Set the labels for the merge request.- Parameters:
labels
- the List of labels to set- Returns:
- the reference to this MergeRequestParams instance
-
withLabels
Set the labels for the merge request.- Parameters:
labels
- the array of labels to set- Returns:
- the reference to this MergeRequestParams instance
-
withDescription
Set the description of the merge request. Limited to 1,048,576 characters.- Parameters:
description
- the description to set- Returns:
- the reference to this MergeRequestParams instance
-
withTargetProjectId
Set the target project ID. This is for merge request creation only.- Parameters:
targetProjectId
- the targetProjectId to set- Returns:
- the reference to this MergeRequestParams instance
-
withStateEvent
New state (close/reopen). This is for merge request updates only.- Parameters:
stateEvent
- the stateEvent to set- Returns:
- the reference to this MergeRequestParams instance
-
withRemoveSourceBranch
Flag indicating if a merge request should remove the source branch when merging.- Parameters:
removeSourceBranch
- the removeSourceBranch to set- Returns:
- the reference to this MergeRequestParams instance
-
withSquash
Squash commits into a single commit when merging.- Parameters:
squash
- the squash to set- Returns:
- the reference to this MergeRequestParams instance
-
withDiscussionLocked
Flag indicating if the merge request’s discussion is locked. If the discussion is locked only project members can add, edit or resolve comments. This is for merge request updates only.- Parameters:
discussionLocked
- the discussionLocked to set- Returns:
- the reference to this MergeRequestParams instance
-
withAllowCollaboration
Allow commits from members who can merge to the target branch.- Parameters:
allowCollaboration
- the allowCollaboration to set- Returns:
- the reference to this MergeRequestParams instance
-
withApprovalsBeforeMerge
Set the approvals_before_merge field value. This is for merge request creation only.- Parameters:
approvalsBeforeMerge
- the approvalsBeforeMerge to set- Returns:
- the reference to this MergeRequestParams instance
-
getForm
Get the form params specified by this instance.- Parameters:
isCreate
- set to true if this is for a create merge request API call, set to false if this is for an update merge request- Returns:
- a GitLabApiForm instance holding the form parameters for this MergeRequestParams instance
-