From 2ce44dcdf71560b8e4c765af84c83fe4ec3f9970 Mon Sep 17 00:00:00 2001 From: Christoph Brill Date: Wed, 8 Nov 2023 16:53:54 +0100 Subject: [PATCH 1/2] feat: Add allow_force_push in ProtectedBranch See https://docs.gitlab.com/ee/api/protected_branches.html --- .../org/gitlab4j/api/models/ProtectedBranch.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/org/gitlab4j/api/models/ProtectedBranch.java b/src/main/java/org/gitlab4j/api/models/ProtectedBranch.java index 49c780657..ee1958965 100644 --- a/src/main/java/org/gitlab4j/api/models/ProtectedBranch.java +++ b/src/main/java/org/gitlab4j/api/models/ProtectedBranch.java @@ -13,6 +13,7 @@ public class ProtectedBranch { private List mergeAccessLevels; private List unprotectAccessLevels; private Boolean codeOwnerApprovalRequired; + private Boolean allowForcePush; public Long getId() { return id; @@ -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)); From 3c4a5303c13ad485e776c0b1a24760161097f768 Mon Sep 17 00:00:00 2001 From: Jeremie Bresson Date: Sat, 11 Nov 2023 06:46:18 +0100 Subject: [PATCH 2/2] Update "protected-branch.json" example file --- src/test/resources/org/gitlab4j/api/protected-branch.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/resources/org/gitlab4j/api/protected-branch.json b/src/test/resources/org/gitlab4j/api/protected-branch.json index 082f273b9..08ed67f66 100644 --- a/src/test/resources/org/gitlab4j/api/protected-branch.json +++ b/src/test/resources/org/gitlab4j/api/protected-branch.json @@ -20,5 +20,7 @@ { "group_id": 2 } - ] + ], + "allow_force_push": false, + "code_owner_approval_required": false }