Skip to content

Commit 9aae1d8

Browse files
egorejmini
andauthored
Add allow_force_push in ProtectedBranch (#1051)
--------- Co-authored-by: Jeremie Bresson <[email protected]>
1 parent 30f18d6 commit 9aae1d8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/main/java/org/gitlab4j/api/models/ProtectedBranch.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class ProtectedBranch {
1313
private List<BranchAccessLevel> mergeAccessLevels;
1414
private List<BranchAccessLevel> unprotectAccessLevels;
1515
private Boolean codeOwnerApprovalRequired;
16+
private Boolean allowForcePush;
1617

1718
public Long getId() {
1819
return id;
@@ -86,6 +87,19 @@ public ProtectedBranch withCodeOwnerApprovalRequired(Boolean codeOwnerApprovalRe
8687
return this;
8788
}
8889

90+
public Boolean getAllowForcePush() {
91+
return allowForcePush;
92+
}
93+
94+
public void setAllowForcePush(Boolean allowForcePush) {
95+
this.allowForcePush = allowForcePush;
96+
}
97+
98+
public ProtectedBranch withAllowForcePush(Boolean allowForcePush) {
99+
this.allowForcePush = allowForcePush;
100+
return this;
101+
}
102+
89103
@Override
90104
public String toString() {
91105
return (JacksonJson.toJsonString(this));

src/test/resources/org/gitlab4j/api/protected-branch.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
{
2121
"group_id": 2
2222
}
23-
]
23+
],
24+
"allow_force_push": false,
25+
"code_owner_approval_required": false
2426
}

0 commit comments

Comments
 (0)