From 7bd07f0df82a4bb64f2e8a28579d9c5bcc983a57 Mon Sep 17 00:00:00 2001 From: David Claybourne Date: Tue, 15 Feb 2022 13:50:51 +0100 Subject: [PATCH] Add top level attribute to Groupfilter --- .../org/gitlab4j/api/models/GroupFilter.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gitlab4j/api/models/GroupFilter.java b/src/main/java/org/gitlab4j/api/models/GroupFilter.java index 0b9b27499..d8f3047cf 100644 --- a/src/main/java/org/gitlab4j/api/models/GroupFilter.java +++ b/src/main/java/org/gitlab4j/api/models/GroupFilter.java @@ -20,6 +20,7 @@ public class GroupFilter { private Boolean withCustomAttributes; private Boolean owned; private AccessLevel accessLevel; + private Boolean topLevelOnly; /** * Do not include the provided groups IDs. @@ -29,7 +30,7 @@ public class GroupFilter { */ public GroupFilter withSkipGroups(List skipGroups) { this.skipGroups = skipGroups; - return (this); + return (this); } /** @@ -41,7 +42,7 @@ public GroupFilter withSkipGroups(List skipGroups) { */ public GroupFilter withAllAvailabley(Boolean allAvailable) { this.allAvailable = allAvailable; - return (this); + return (this); } /** @@ -90,7 +91,7 @@ public GroupFilter withStatistics(Boolean statistics) { /** * Include custom attributes in response (admins only). - * + * * @param withCustomAttributes if true, include custom attributes in the response * @return the reference to this GroupFilter instance */ @@ -121,6 +122,17 @@ public GroupFilter withMinAccessLevel(AccessLevel accessLevel) { return (this); } + /** + * Limit by groups which are top level groups + * + * @param topLevelOnly if true, limit to groups which are top level groups + * @return the reference to this GroupFilter instance + */ + public GroupFilter withTopLevelOnly(Boolean topLevelOnly) { + this.topLevelOnly = topLevelOnly; + return (this); + } + /** * Get the query params specified by this filter. * @@ -135,8 +147,9 @@ public GitLabApiForm getQueryParams() { .withParam("sort", sort) .withParam("statistics", statistics) .withParam("with_custom_attributes", withCustomAttributes) - .withParam("owned", owned) + .withParam("owned", owned) .withParam("min_access_level", accessLevel) + .withParam("top_level_only", topLevelOnly) ); } }