Unverified Commit 8af68995 authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze Committed by GitHub
Browse files

Merge pull request #797 from Djcd/feature/groupFilter_topLevelOnly

Add top_level_only parameter to GroupFilter
parents 231d5066 7bd07f0d
...@@ -20,6 +20,7 @@ public class GroupFilter { ...@@ -20,6 +20,7 @@ public class GroupFilter {
private Boolean withCustomAttributes; private Boolean withCustomAttributes;
private Boolean owned; private Boolean owned;
private AccessLevel accessLevel; private AccessLevel accessLevel;
private Boolean topLevelOnly;
/** /**
* Do not include the provided groups IDs. * Do not include the provided groups IDs.
...@@ -29,7 +30,7 @@ public class GroupFilter { ...@@ -29,7 +30,7 @@ public class GroupFilter {
*/ */
public GroupFilter withSkipGroups(List<Integer> skipGroups) { public GroupFilter withSkipGroups(List<Integer> skipGroups) {
this.skipGroups = skipGroups; this.skipGroups = skipGroups;
return (this); return (this);
} }
/** /**
...@@ -41,7 +42,7 @@ public class GroupFilter { ...@@ -41,7 +42,7 @@ public class GroupFilter {
*/ */
public GroupFilter withAllAvailabley(Boolean allAvailable) { public GroupFilter withAllAvailabley(Boolean allAvailable) {
this.allAvailable = allAvailable; this.allAvailable = allAvailable;
return (this); return (this);
} }
/** /**
...@@ -90,7 +91,7 @@ public class GroupFilter { ...@@ -90,7 +91,7 @@ public class GroupFilter {
/** /**
* Include custom attributes in response (admins only). * Include custom attributes in response (admins only).
* *
* @param withCustomAttributes if true, include custom attributes in the response * @param withCustomAttributes if true, include custom attributes in the response
* @return the reference to this GroupFilter instance * @return the reference to this GroupFilter instance
*/ */
...@@ -121,6 +122,17 @@ public class GroupFilter { ...@@ -121,6 +122,17 @@ public class GroupFilter {
return (this); 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. * Get the query params specified by this filter.
* *
...@@ -135,8 +147,9 @@ public class GroupFilter { ...@@ -135,8 +147,9 @@ public class GroupFilter {
.withParam("sort", sort) .withParam("sort", sort)
.withParam("statistics", statistics) .withParam("statistics", statistics)
.withParam("with_custom_attributes", withCustomAttributes) .withParam("with_custom_attributes", withCustomAttributes)
.withParam("owned", owned) .withParam("owned", owned)
.withParam("min_access_level", accessLevel) .withParam("min_access_level", accessLevel)
.withParam("top_level_only", topLevelOnly)
); );
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment