Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add group api parameters #1073

Merged
merged 3 commits into from
Dec 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/main/java/org/gitlab4j/api/models/GroupParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public String toString() {
public enum DefaultBranchProtectionLevel {
NOT_PROTECTED(0),
PARTIALLY_PROTECTED(1),
FULLY_PROTECTED(2);
FULLY_PROTECTED(2),
PROTECTED_AGAINST_PUSHES(3),
FULL_PROTECTION_AFTER_INITIAL_PUSH(4);

private final int value;

Expand Down Expand Up @@ -63,6 +65,9 @@ public String toString() {
private Integer extraSharedRunnersMinutesLimit;
private DefaultBranchProtectionLevel defaultBranchProtection;

private Boolean preventSharingGroupsOutsideHierarchy;
private Boolean preventForkingOutsideGroup;

private Boolean membershipLock;
private Long fileTemplateProjectId;

Expand Down Expand Up @@ -179,6 +184,16 @@ public GroupParams withDefaultBranchProtection(DefaultBranchProtectionLevel defa
return (this);
}

public GroupParams withPreventSharingGroupsOutsideHierarchy(Boolean preventSharingGroupsOutsideHierarchy) {
this.preventSharingGroupsOutsideHierarchy = preventSharingGroupsOutsideHierarchy;
return (this);
}

public GroupParams withPreventForkingOutsideGroup(Boolean preventForkingOutsideGroup) {
this.preventForkingOutsideGroup = preventForkingOutsideGroup;
return (this);
}

/**
* Get the form params for a group create oir update call.
*
Expand All @@ -204,7 +219,9 @@ public GitLabApiForm getForm(boolean isCreate) {
.withParam("request_access_enabled", requestAccessEnabled)
.withParam("shared_runners_minutes_limit", sharedRunnersMinutesLimit)
.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) {
form.withParam("parent_id", parentId);
Expand Down
Loading