Package org.miaixz.bus.gitlab.models
Class ApprovalRuleParams
java.lang.Object
org.miaixz.bus.gitlab.models.ApprovalRuleParams
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetForm()Get the form params specified by this instance.withAppliesToAllProtectedBranches(Boolean appliesToAllProtectedBranches) withApprovalsRequired(Integer approvalsRequired) withGroupIds(List<Long> groupIds) withProtectedBranchIds(List<Long> protectedBranchIds) withReportType(String reportType) withRuleType(String ruleType) withUserIds(List<Long> userIds) withUsernames(List<String> usernames)
-
Constructor Details
-
ApprovalRuleParams
public ApprovalRuleParams()
-
-
Method Details
-
withApprovalsRequired
- Parameters:
approvalsRequired- The number of required approvals for this rule.- Returns:
- this ApprovalRuleParams instance
-
withName
- Parameters:
name- The name of the approval rule.- Returns:
- this ApprovalRuleParams instance
-
withAppliesToAllProtectedBranches
- Parameters:
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.- Returns:
- this ApprovalRuleParams instance
-
withGroupIds
- Parameters:
groupIds- The IDs of groups as approvers.- Returns:
- this ApprovalRuleParams instance
-
withProtectedBranchIds
- Parameters:
protectedBranchIds- The IDs of protected branches to scope the rule by. To identify the ID, use the API.- Returns:
- this ApprovalRuleParams instance
-
withReportType
- Parameters:
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.- Returns:
- this ApprovalRuleParams instance
-
withRuleType
- Parameters:
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.- Returns:
- this ApprovalRuleParams instance
-
withUserIds
- Parameters:
userIds- The IDs of users as approvers. If you provide both user_ids and usernames, both lists of users are added.- Returns:
- this ApprovalRuleParams instance
-
withUsernames
- Parameters:
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.- Returns:
- this ApprovalRuleParams instance
-
getForm
Get the form params specified by this instance.- Returns:
- a GitLabApiForm instance holding the form parameters for this ApprovalRuleParams instance
-