Class MergeRequestParams

  • All Implemented Interfaces:
    java.io.Serializable

    public class MergeRequestParams
    extends java.lang.Object
    implements java.io.Serializable
    This class provides the form parameters for creating and updating merge requests.
    See Also:
    Serialized Form
    • Constructor Detail

      • MergeRequestParams

        public MergeRequestParams()
    • Method Detail

      • withSourceBranch

        public MergeRequestParams withSourceBranch​(java.lang.String sourceBranch)
        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

        public MergeRequestParams withTargetBranch​(java.lang.String targetBranch)
        Set the target branch.
        Parameters:
        targetBranch - the targetBranch to set
        Returns:
        the reference to this MergeRequestParams instance
      • withTitle

        public MergeRequestParams withTitle​(java.lang.String title)
        Set the title of the merge request.
        Parameters:
        title - the title to set
        Returns:
        the reference to this MergeRequestParams instance
      • withAssigneeId

        public MergeRequestParams withAssigneeId​(java.lang.Long assigneeId)
        Set the assignee user ID.
        Parameters:
        assigneeId - the assigneeId to set
        Returns:
        the reference to this MergeRequestParams instance
      • withAssigneeIds

        public MergeRequestParams withAssigneeIds​(java.util.List<java.lang.Long> assigneeIds)
        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

        public MergeRequestParams withReviewerIds​(java.util.List<java.lang.Long> reviewerIds)
        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

        public MergeRequestParams withMilestoneId​(java.lang.Long milestoneId)
        Set the milestone ID field value.
        Parameters:
        milestoneId - the milestoneId to set
        Returns:
        the reference to this MergeRequestParams instance
      • withLabels

        public MergeRequestParams withLabels​(java.util.List<java.lang.String> labels)
        Set the labels for the merge request.
        Parameters:
        labels - the List of labels to set
        Returns:
        the reference to this MergeRequestParams instance
      • withLabels

        public MergeRequestParams withLabels​(java.lang.String[] labels)
        Set the labels for the merge request.
        Parameters:
        labels - the array of labels to set
        Returns:
        the reference to this MergeRequestParams instance
      • withDescription

        public MergeRequestParams withDescription​(java.lang.String description)
        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

        public MergeRequestParams withTargetProjectId​(java.lang.Long targetProjectId)
        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

        public MergeRequestParams withStateEvent​(Constants.StateEvent stateEvent)
        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

        public MergeRequestParams withRemoveSourceBranch​(java.lang.Boolean removeSourceBranch)
        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

        public MergeRequestParams withSquash​(java.lang.Boolean squash)
        Squash commits into a single commit when merging.
        Parameters:
        squash - the squash to set
        Returns:
        the reference to this MergeRequestParams instance
      • withDiscussionLocked

        public MergeRequestParams withDiscussionLocked​(java.lang.Boolean discussionLocked)
        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

        public MergeRequestParams withAllowCollaboration​(java.lang.Boolean allowCollaboration)
        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

        public MergeRequestParams withApprovalsBeforeMerge​(java.lang.Integer approvalsBeforeMerge)
        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

        public GitLabApiForm getForm​(boolean isCreate)
        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