public class ApprovalRuleParams
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
ApprovalRuleParams() |
Modifier and Type | Method and Description |
---|---|
GitLabApiForm |
getForm()
Get the form params specified by this instance.
|
ApprovalRuleParams |
withAppliesToAllProtectedBranches(java.lang.Boolean appliesToAllProtectedBranches) |
ApprovalRuleParams |
withApprovalsRequired(java.lang.Integer approvalsRequired) |
ApprovalRuleParams |
withGroupIds(java.util.List<java.lang.Long> groupIds) |
ApprovalRuleParams |
withName(java.lang.String name) |
ApprovalRuleParams |
withProtectedBranchIds(java.util.List<java.lang.Long> protectedBranchIds) |
ApprovalRuleParams |
withReportType(java.lang.String reportType) |
ApprovalRuleParams |
withRuleType(java.lang.String ruleType) |
ApprovalRuleParams |
withUserIds(java.util.List<java.lang.Long> userIds) |
ApprovalRuleParams |
withUsernames(java.util.List<java.lang.String> usernames) |
public ApprovalRuleParams withApprovalsRequired(java.lang.Integer approvalsRequired)
approvalsRequired
- The number of required approvals for this rule.public ApprovalRuleParams withName(java.lang.String name)
name
- The name of the approval rule.public ApprovalRuleParams withAppliesToAllProtectedBranches(java.lang.Boolean appliesToAllProtectedBranches)
appliesToAllProtectedBranches
- Whether the rule is applied to all protected branches. If set to true, the value of protected_branch_ids is ignored. Default is false. Introduced in GitLab 15.3.public ApprovalRuleParams withGroupIds(java.util.List<java.lang.Long> groupIds)
groupIds
- The IDs of groups as approvers.public ApprovalRuleParams withProtectedBranchIds(java.util.List<java.lang.Long> protectedBranchIds)
protectedBranchIds
- The IDs of protected branches to scope the rule by. To identify the ID, use the API.public ApprovalRuleParams withReportType(java.lang.String reportType)
reportType
- The report type required when the rule type is report_approver. The supported report types are license_scanning (Deprecated in GitLab 15.9) and code_coverage.public ApprovalRuleParams withRuleType(java.lang.String ruleType)
ruleType
- The type of rule. any_approver is a pre-configured default rule with approvals_required at 0. Other rules are regular and report_approver.public ApprovalRuleParams withUserIds(java.util.List<java.lang.Long> userIds)
userIds
- The IDs of users as approvers. If you provide both user_ids and usernames, both lists of users are added.public ApprovalRuleParams withUsernames(java.util.List<java.lang.String> usernames)
usernames
- The usernames of approvers for this rule (same as user_ids but requires a list of usernames). If you provide both user_ids and usernames, both lists of users are added.public GitLabApiForm getForm()