All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gitlab4j.api.models.ApprovalRuleParams Maven / Gradle / Ivy

Go to download

GitLab4J-API (gitlab4j-api) provides a full featured Java client library for working with GitLab repositories and servers via the GitLab REST API.

There is a newer version: 6.0.0-rc.6
Show newest version
package org.gitlab4j.api.models;

import java.util.List;

import org.gitlab4j.api.GitLabApiForm;

public class ApprovalRuleParams {

    private String name;
    private Integer approvalsRequired;
    private List userIds;
    private List groupIds;

    public ApprovalRuleParams withName(String name) {
	this.name = name;
	return (this);
    }

    public ApprovalRuleParams withApprovalsRequired(Integer approvalsRequired) {
	this.approvalsRequired = approvalsRequired;
	return (this);
    }

    public ApprovalRuleParams withUserIds(List userIds) {
	this.userIds = userIds;
	return (this);
    }

    public ApprovalRuleParams withGroupIds(List groupIds) {
	this.groupIds = groupIds;
	return (this);
    }

    /**
     * Get the form params specified by this instance.
     *
     * @return a GitLabApiForm instance holding the form parameters for this ApprovalRuleParams instance
     */
    public GitLabApiForm getForm() {
	return new GitLabApiForm()
            .withParam("name", name)
            .withParam("approvals_required", approvalsRequired, true)
            .withParam("user_ids", userIds)
            .withParam("group_ids", groupIds);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy