Unverified Commit 6207403c authored by Thomas van Putten's avatar Thomas van Putten Committed by GitHub
Browse files

Add default branch protection level to the groups api (#597)

parent 2214d7bd
......@@ -29,6 +29,22 @@ public class GroupParams {
}
}
public enum DefaultBranchProtectionLevel {
NOT_PROTECTED(0),
PARTIALLY_PROTECTED(1),
FULLY_PROTECTED(2);
private final int value;
private DefaultBranchProtectionLevel(int value) {
this.value = value;
}
public String toString() {
return Integer.toString(value);
}
}
private String name;
private String path;
private String description;
......@@ -45,6 +61,7 @@ public class GroupParams {
private Integer parentId;
private Integer sharedRunnersMinutesLimit;
private Integer extraSharedRunnersMinutesLimit;
private DefaultBranchProtectionLevel defaultBranchProtection;
private Boolean membershipLock;
private Integer fileTemplateProjectId;
......@@ -157,6 +174,11 @@ public class GroupParams {
return (this);
}
public GroupParams withDefaultBranchProtection(DefaultBranchProtectionLevel defaultBranchProtection) {
this.defaultBranchProtection = defaultBranchProtection;
return (this);
}
/**
* Get the form params for a group create oir update call.
*
......@@ -181,7 +203,8 @@ public class GroupParams {
.withParam("lfs_enabled", lfsEnabled)
.withParam("request_access_enabled", requestAccessEnabled)
.withParam("shared_runners_minutes_limit", sharedRunnersMinutesLimit)
.withParam("extra_shared_runners_minutes_limit", extraSharedRunnersMinutesLimit);
.withParam("extra_shared_runners_minutes_limit", extraSharedRunnersMinutesLimit)
.withParam("default_branch_protection", defaultBranchProtection);
if (isCreate) {
form.withParam("parent_id", parentId);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment