Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
6207403c
Unverified
Commit
6207403c
authored
Jul 22, 2020
by
Thomas van Putten
Committed by
GitHub
Jul 21, 2020
Browse files
Add default branch protection level to the groups api (#597)
parent
2214d7bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/GroupParams.java
View file @
6207403c
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment