Class ApprovalRuleParams

java.lang.Object
org.miaixz.bus.gitlab.models.ApprovalRuleParams
All Implemented Interfaces:
Serializable

public class ApprovalRuleParams extends Object implements Serializable
See Also:
  • Constructor Details

    • ApprovalRuleParams

      public ApprovalRuleParams()
  • Method Details

    • withApprovalsRequired

      public ApprovalRuleParams withApprovalsRequired(Integer approvalsRequired)
      Parameters:
      approvalsRequired - The number of required approvals for this rule.
      Returns:
      this ApprovalRuleParams instance
    • withName

      public ApprovalRuleParams withName(String name)
      Parameters:
      name - The name of the approval rule.
      Returns:
      this ApprovalRuleParams instance
    • withAppliesToAllProtectedBranches

      public ApprovalRuleParams withAppliesToAllProtectedBranches(Boolean appliesToAllProtectedBranches)
      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

      public ApprovalRuleParams withGroupIds(List<Long> groupIds)
      Parameters:
      groupIds - The IDs of groups as approvers.
      Returns:
      this ApprovalRuleParams instance
    • withProtectedBranchIds

      public ApprovalRuleParams withProtectedBranchIds(List<Long> protectedBranchIds)
      Parameters:
      protectedBranchIds - The IDs of protected branches to scope the rule by. To identify the ID, use the API.
      Returns:
      this ApprovalRuleParams instance
    • withReportType

      public ApprovalRuleParams withReportType(String reportType)
      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

      public ApprovalRuleParams withRuleType(String ruleType)
      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

      public ApprovalRuleParams withUserIds(List<Long> userIds)
      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

      public ApprovalRuleParams withUsernames(List<String> usernames)
      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

      public GitLabApiForm getForm()
      Get the form params specified by this instance.
      Returns:
      a GitLabApiForm instance holding the form parameters for this ApprovalRuleParams instance