Skip to content

Commit

Permalink
Add allow_force_push in ProtectedBranch (#1051)
Browse files Browse the repository at this point in the history
---------
Co-authored-by: Jeremie Bresson <[email protected]>
  • Loading branch information
egore authored Nov 11, 2023
1 parent 30f18d6 commit 9aae1d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/main/java/org/gitlab4j/api/models/ProtectedBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class ProtectedBranch {
private List<BranchAccessLevel> mergeAccessLevels;
private List<BranchAccessLevel> unprotectAccessLevels;
private Boolean codeOwnerApprovalRequired;
private Boolean allowForcePush;

public Long getId() {
return id;
Expand Down Expand Up @@ -86,6 +87,19 @@ public ProtectedBranch withCodeOwnerApprovalRequired(Boolean codeOwnerApprovalRe
return this;
}

public Boolean getAllowForcePush() {
return allowForcePush;
}

public void setAllowForcePush(Boolean allowForcePush) {
this.allowForcePush = allowForcePush;
}

public ProtectedBranch withAllowForcePush(Boolean allowForcePush) {
this.allowForcePush = allowForcePush;
return this;
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
Expand Down
4 changes: 3 additions & 1 deletion src/test/resources/org/gitlab4j/api/protected-branch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@
{
"group_id": 2
}
]
],
"allow_force_push": false,
"code_owner_approval_required": false
}

0 comments on commit 9aae1d8

Please sign in to comment.