Commit ff10c91e authored by Jeremie Bresson's avatar Jeremie Bresson
Browse files

Merge remote-tracking branch 'origin/main' into 6.x

parents 59f726a5 6a89da05
...@@ -1029,5 +1029,73 @@ public interface Constants { ...@@ -1029,5 +1029,73 @@ public interface Constants {
return (enumHelper.toString(this)); return (enumHelper.toString(this));
} }
} }
/**
* Constant to specify the project_creation_level for the group.
*/
public enum ProjectCreationLevel {
NOONE, DEVELOPER, MAINTAINER;
private static JacksonJsonEnumHelper<ProjectCreationLevel> enumHelper = new JacksonJsonEnumHelper<>(ProjectCreationLevel.class);
@JsonCreator
public static ProjectCreationLevel forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
/**
* Constant to specify the subgroup_creation_level for the group.
*/
public enum SubgroupCreationLevel {
OWNER, MAINTAINER;
private static JacksonJsonEnumHelper<SubgroupCreationLevel> enumHelper = new JacksonJsonEnumHelper<>(SubgroupCreationLevel.class);
@JsonCreator
public static SubgroupCreationLevel forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
public enum DefaultBranchProtectionLevel {
NOT_PROTECTED(0),
PARTIALLY_PROTECTED(1),
FULLY_PROTECTED(2),
PROTECTED_AGAINST_PUSHES(3),
FULL_PROTECTION_AFTER_INITIAL_PUSH(4);
@JsonValue
private final int value;
private DefaultBranchProtectionLevel(int value) {
this.value = value;
}
@Override
public String toString() {
return Integer.toString(value);
}
}
} }
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
package org.gitlab4j.api.models; package org.gitlab4j.api.models;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.gitlab4j.api.Constants.DefaultBranchProtectionLevel;
import org.gitlab4j.api.Constants.ProjectCreationLevel;
import org.gitlab4j.api.Constants.SubgroupCreationLevel;
import org.gitlab4j.api.utils.JacksonJson; import org.gitlab4j.api.utils.JacksonJson;
import java.util.Date; import java.util.Date;
...@@ -63,6 +67,11 @@ public class Group extends AbstractGroup<Group> { ...@@ -63,6 +67,11 @@ public class Group extends AbstractGroup<Group> {
private Date createdAt; private Date createdAt;
private List<SharedGroup> sharedWithGroups; private List<SharedGroup> sharedWithGroups;
private String runnersToken; private String runnersToken;
private Boolean preventSharingGroupsOutsideHierarchy;
private Boolean preventForkingOutsideGroup;
private ProjectCreationLevel projectCreationLevel;
private SubgroupCreationLevel subgroupCreationLevel;
private DefaultBranchProtectionLevel defaultBranchProtection;
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class) @JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
private Date markedForDeletionOn; private Date markedForDeletionOn;
...@@ -179,6 +188,46 @@ public class Group extends AbstractGroup<Group> { ...@@ -179,6 +188,46 @@ public class Group extends AbstractGroup<Group> {
this.runnersToken = runnersToken; this.runnersToken = runnersToken;
} }
public Boolean getPreventSharingGroupsOutsideHierarchy() {
return preventSharingGroupsOutsideHierarchy;
}
public void setPreventSharingGroupsOutsideHierarchy(Boolean preventSharingGroupsOutsideHierarchy) {
this.preventSharingGroupsOutsideHierarchy = preventSharingGroupsOutsideHierarchy;
}
public Boolean getPreventForkingOutsideGroup() {
return preventForkingOutsideGroup;
}
public void setPreventForkingOutsideGroup(Boolean preventForkingOutsideGroup) {
this.preventForkingOutsideGroup = preventForkingOutsideGroup;
}
public ProjectCreationLevel getProjectCreationLevel() {
return this.projectCreationLevel;
}
public void setProjectCreationLevel(ProjectCreationLevel projectCreationLevel) {
this.projectCreationLevel = projectCreationLevel;
}
public SubgroupCreationLevel getSubgroupCreationLevel() {
return this.subgroupCreationLevel;
}
public void setSubgroupCreationLevel(SubgroupCreationLevel subgroupCreationLevel) {
this.subgroupCreationLevel = subgroupCreationLevel;
}
public DefaultBranchProtectionLevel getDefaultBranchProtection() {
return this.defaultBranchProtection;
}
public void setDefaultBranchProtection(DefaultBranchProtectionLevel defaultBranchProtection) {
this.defaultBranchProtection = defaultBranchProtection;
}
public Group withPath(String path) { public Group withPath(String path) {
this.path = path; this.path = path;
return this; return this;
...@@ -229,6 +278,31 @@ public class Group extends AbstractGroup<Group> { ...@@ -229,6 +278,31 @@ public class Group extends AbstractGroup<Group> {
return this; return this;
} }
public Group withPreventSharingGroupsOutsideHierarchy(Boolean preventSharingGroupsOutsideHierarchy) {
this.preventSharingGroupsOutsideHierarchy = preventSharingGroupsOutsideHierarchy;
return this;
}
public Group withPreventForkingOutsideGroup(Boolean preventForkingOutsideGroup) {
this.preventForkingOutsideGroup = preventForkingOutsideGroup;
return this;
}
public Group withProjectCreationLevel(ProjectCreationLevel projectCreationLevel) {
this.projectCreationLevel = projectCreationLevel;
return this;
}
public Group withSubgroupCreationLevel(SubgroupCreationLevel subgroupCreationLevel) {
this.subgroupCreationLevel = subgroupCreationLevel;
return this;
}
public Group withDefaultBranchProtection(DefaultBranchProtectionLevel defaultBranchProtection) {
this.defaultBranchProtection = defaultBranchProtection;
return this;
}
@Override @Override
public String toString() { public String toString() {
return (JacksonJson.toJsonString(this)); return (JacksonJson.toJsonString(this));
......
package org.gitlab4j.api.models; package org.gitlab4j.api.models;
import org.gitlab4j.api.GitLabApiForm; import org.gitlab4j.api.GitLabApiForm;
import org.gitlab4j.api.Constants.DefaultBranchProtectionLevel;
import org.gitlab4j.api.Constants.ProjectCreationLevel;
import org.gitlab4j.api.Constants.SubgroupCreationLevel;
import java.io.Serializable; import java.io.Serializable;
...@@ -12,42 +15,6 @@ import java.io.Serializable; ...@@ -12,42 +15,6 @@ import java.io.Serializable;
public class GroupParams implements Serializable { public class GroupParams implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* Constant to specify the project_creation_level for the group.
*/
public enum ProjectCreationLevel {
NOONE, DEVELOPER, MAINTAINER;
public String toString() {
return (name().toLowerCase());
}
}
/**
* Constant to specify the subgroup_creation_level for the group.
*/
public enum SubgroupCreationLevel {
OWNER, MAINTAINER;
public String toString() {
return (name().toLowerCase());
}
}
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 name;
private String path; private String path;
private String description; private String description;
...@@ -65,7 +32,8 @@ public class GroupParams implements Serializable { ...@@ -65,7 +32,8 @@ public class GroupParams implements Serializable {
private Integer sharedRunnersMinutesLimit; private Integer sharedRunnersMinutesLimit;
private Integer extraSharedRunnersMinutesLimit; private Integer extraSharedRunnersMinutesLimit;
private DefaultBranchProtectionLevel defaultBranchProtection; private DefaultBranchProtectionLevel defaultBranchProtection;
private Boolean preventSharingGroupsOutsideHierarchy;
private Boolean preventForkingOutsideGroup;
private Boolean membershipLock; private Boolean membershipLock;
private Long fileTemplateProjectId; private Long fileTemplateProjectId;
...@@ -76,8 +44,8 @@ public class GroupParams implements Serializable { ...@@ -76,8 +44,8 @@ public class GroupParams implements Serializable {
* @return this GroupParms instance * @return this GroupParms instance
*/ */
public GroupParams withParentId(Long parentId) { public GroupParams withParentId(Long parentId) {
this.parentId = parentId; this.parentId = parentId;
return (this); return (this);
} }
/** /**
...@@ -87,8 +55,8 @@ public class GroupParams implements Serializable { ...@@ -87,8 +55,8 @@ public class GroupParams implements Serializable {
* @return this GroupParms instance * @return this GroupParms instance
*/ */
public GroupParams withMembershipLock(Boolean membershipLock) { public GroupParams withMembershipLock(Boolean membershipLock) {
this.membershipLock = membershipLock; this.membershipLock = membershipLock;
return (this); return (this);
} }
/** /**
...@@ -98,88 +66,98 @@ public class GroupParams implements Serializable { ...@@ -98,88 +66,98 @@ public class GroupParams implements Serializable {
* @return this GroupParms instance * @return this GroupParms instance
*/ */
public GroupParams withFileTemplateProjectId(Long fileTemplateProjectId) { public GroupParams withFileTemplateProjectId(Long fileTemplateProjectId) {
this.fileTemplateProjectId = fileTemplateProjectId; this.fileTemplateProjectId = fileTemplateProjectId;
return (this); return (this);
} }
public GroupParams withName(String name) { public GroupParams withName(String name) {
this.name = name; this.name = name;
return (this); return (this);
} }
public GroupParams withPath(String path) { public GroupParams withPath(String path) {
this.path = path; this.path = path;
return (this); return (this);
} }
public GroupParams withDescription(String description) { public GroupParams withDescription(String description) {
this.description = description; this.description = description;
return (this); return (this);
} }
public GroupParams withVisibility(String visibility) { public GroupParams withVisibility(String visibility) {
this.visibility = visibility; this.visibility = visibility;
return (this); return (this);
} }
public GroupParams withShareWithGroupLock(Boolean shareWithGroupLock) { public GroupParams withShareWithGroupLock(Boolean shareWithGroupLock) {
this.shareWithGroupLock = shareWithGroupLock; this.shareWithGroupLock = shareWithGroupLock;
return (this); return (this);
} }
public GroupParams withRequireTwoFactorAuthentication(Boolean requireTwoFactorAuthentication) { public GroupParams withRequireTwoFactorAuthentication(Boolean requireTwoFactorAuthentication) {
this.requireTwoFactorAuthentication = requireTwoFactorAuthentication; this.requireTwoFactorAuthentication = requireTwoFactorAuthentication;
return (this); return (this);
} }
public GroupParams withTwoFactorGracePeriod(Integer twoFactorGracePeriod) { public GroupParams withTwoFactorGracePeriod(Integer twoFactorGracePeriod) {
this.twoFactorGracePeriod = twoFactorGracePeriod; this.twoFactorGracePeriod = twoFactorGracePeriod;
return (this); return (this);
} }
public GroupParams withProjectCreationLevel(ProjectCreationLevel projectCreationLevel) { public GroupParams withProjectCreationLevel(ProjectCreationLevel projectCreationLevel) {
this.projectCreationLevel = projectCreationLevel; this.projectCreationLevel = projectCreationLevel;
return (this); return (this);
} }
public GroupParams withAutoDevopsEnabled(Boolean autoDevopsEnabled) { public GroupParams withAutoDevopsEnabled(Boolean autoDevopsEnabled) {
this.autoDevopsEnabled = autoDevopsEnabled; this.autoDevopsEnabled = autoDevopsEnabled;
return (this); return (this);
} }
public GroupParams withSubgroupCreationLevel(SubgroupCreationLevel subgroupCreationLevel) { public GroupParams withSubgroupCreationLevel(SubgroupCreationLevel subgroupCreationLevel) {
this.subgroupCreationLevel = subgroupCreationLevel; this.subgroupCreationLevel = subgroupCreationLevel;
return (this); return (this);
} }
public GroupParams withEmailsDisabled(Boolean emailsDisabled) { public GroupParams withEmailsDisabled(Boolean emailsDisabled) {
this.emailsDisabled = emailsDisabled; this.emailsDisabled = emailsDisabled;
return (this); return (this);
} }
public GroupParams withLfsEnabled(Boolean lfsEnabled) { public GroupParams withLfsEnabled(Boolean lfsEnabled) {
this.lfsEnabled = lfsEnabled; this.lfsEnabled = lfsEnabled;
return (this); return (this);
} }
public GroupParams withRequestAccessEnabled(Boolean requestAccessEnabled) { public GroupParams withRequestAccessEnabled(Boolean requestAccessEnabled) {
this.requestAccessEnabled = requestAccessEnabled; this.requestAccessEnabled = requestAccessEnabled;
return (this); return (this);
} }
public GroupParams withSharedRunnersMinutesLimit(Integer sharedRunnersMinutesLimit) { public GroupParams withSharedRunnersMinutesLimit(Integer sharedRunnersMinutesLimit) {
this.sharedRunnersMinutesLimit = sharedRunnersMinutesLimit; this.sharedRunnersMinutesLimit = sharedRunnersMinutesLimit;
return (this); return (this);
} }
public GroupParams withExtraSharedRunnersMinutesLimit(Integer extraSharedRunnersMinutesLimit) { public GroupParams withExtraSharedRunnersMinutesLimit(Integer extraSharedRunnersMinutesLimit) {
this.extraSharedRunnersMinutesLimit = extraSharedRunnersMinutesLimit; this.extraSharedRunnersMinutesLimit = extraSharedRunnersMinutesLimit;
return (this); return (this);
} }
public GroupParams withDefaultBranchProtection(DefaultBranchProtectionLevel defaultBranchProtection) { public GroupParams withDefaultBranchProtection(DefaultBranchProtectionLevel defaultBranchProtection) {
this.defaultBranchProtection = defaultBranchProtection; this.defaultBranchProtection = defaultBranchProtection;
return (this); return (this);
}
public GroupParams withPreventSharingGroupsOutsideHierarchy(Boolean preventSharingGroupsOutsideHierarchy) {
this.preventSharingGroupsOutsideHierarchy = preventSharingGroupsOutsideHierarchy;
return (this);
}
public GroupParams withPreventForkingOutsideGroup(Boolean preventForkingOutsideGroup) {
this.preventForkingOutsideGroup = preventForkingOutsideGroup;
return (this);
} }
/** /**
...@@ -207,7 +185,9 @@ public class GroupParams implements Serializable { ...@@ -207,7 +185,9 @@ public class GroupParams implements Serializable {
.withParam("request_access_enabled", requestAccessEnabled) .withParam("request_access_enabled", requestAccessEnabled)
.withParam("shared_runners_minutes_limit", sharedRunnersMinutesLimit) .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); .withParam("default_branch_protection", defaultBranchProtection)
.withParam("prevent_sharing_groups_outside_hierarchy", preventSharingGroupsOutsideHierarchy)
.withParam("prevent_forking_outside_group", preventForkingOutsideGroup);
if (isCreate) { if (isCreate) {
form.withParam("parent_id", parentId); form.withParam("parent_id", parentId);
......
...@@ -6,6 +6,11 @@ ...@@ -6,6 +6,11 @@
"visibility": "public", "visibility": "public",
"web_url": "https://gitlab.example.com/groups/twitter", "web_url": "https://gitlab.example.com/groups/twitter",
"request_access_enabled": false, "request_access_enabled": false,
"prevent_sharing_groups_outside_hierarchy": false,
"prevent_forking_outside_group": false,
"project_creation_level": "developer",
"subgroup_creation_level": "owner",
"default_branch_protection": 2,
"full_name": "Twitter", "full_name": "Twitter",
"full_path": "twitter", "full_path": "twitter",
"parent_id": 1234, "parent_id": 1234,
......
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