org.keycloak.services.resources.admin

## Class GroupsResource

- java.lang.Object
- - org.keycloak.services.resources.admin.GroupsResource

-     public class GroupsResource
      extends Object

  Author:
    Bill Burke

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GroupsResource(RealmModel realm, KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.ws.rs.core.Response` | `addTopLevelGroup(GroupRepresentation rep)` create or add a top level realm groupSet or create child.
    `GroupResource` | `getGroupById(String id)` Does not expand hierarchy.
    `Map<String,Long>` | `getGroupCount(String search, boolean onlyTopGroups)` Returns the groups counts.
    `Stream<GroupRepresentation>` | `getGroups(String search, Integer firstResult, Integer maxResults, boolean briefRepresentation)` Get group hierarchy.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GroupsResource

          public GroupsResource(RealmModel realm,
                                KeycloakSession session,
                                AdminPermissionEvaluator auth,
                                AdminEventBuilder adminEvent)

  - ### Method Detail

    - #### getGroups

          @GET
           @Produces(value="application/json")
          public Stream<GroupRepresentation> getGroups(@QueryParam(value="search")
                                                                                                 String search,
                                                                                                 @QueryParam(value="first")
                                                                                                 Integer firstResult,
                                                                                                 @QueryParam(value="max")
                                                                                                 Integer maxResults,
                                                                                                 @QueryParam(value="briefRepresentation") @DefaultValue(value="true")
                                                                                                 boolean briefRepresentation)

      Get group hierarchy. Only name and ids are returned.
      Returns:

    - #### getGroupById

          @Path(value="{id}")
          public GroupResource getGroupById(@PathParam(value="id")
                                                                String id)

      Does not expand hierarchy. Subgroups will not be set.
      Parameters:
        `id` -
      Returns:

    - #### getGroupCount

          @GET
           @Path(value="count")
           @Produces(value="application/json")
          public Map<String,Long> getGroupCount(@QueryParam(value="search")
                                                                                                                String search,
                                                                                                                @QueryParam(value="top") @DefaultValue(value="false")
                                                                                                                boolean onlyTopGroups)

      Returns the groups counts.
      Returns:

    - #### addTopLevelGroup

          @POST
           @Consumes(value="application/json")
          public javax.ws.rs.core.Response addTopLevelGroup(GroupRepresentation rep)

      create or add a top level realm groupSet or create child. This will update the group and set the parent if it exists. Create it and set the parent if the group doesn't exist.
      Parameters:
        `rep` -

Copyright © 2021 JBoss by Red Hat. All rights reserved.