Class OrganizationsResource
java.lang.Object
org.keycloak.organization.admin.resource.OrganizationsResource
-
Constructor Summary
ConstructorsConstructorDescriptionOrganizationsResource(KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Responsecreate(OrganizationRepresentation organization) Creates a new organization based on the specifiedOrganizationRepresentation.Base path for the admin REST API for one particular organization.longgetOrganizationCount(String search, String searchQuery, Boolean exact) Returns the organizations counts.getOrganizations(String memberId, boolean briefRepresentation) search(String search, String searchQuery, Boolean exact, Integer first, Integer max, boolean briefRepresentation) Returns a stream of organizations, filtered according to query parameters.
-
Constructor Details
-
OrganizationsResource
public OrganizationsResource(KeycloakSession session, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
-
-
Method Details
-
create
@POST @Consumes("application/json") public jakarta.ws.rs.core.Response create(OrganizationRepresentation organization) Creates a new organization based on the specifiedOrganizationRepresentation.- Parameters:
organization- the representation containing the organization data.- Returns:
- a
Responsecontaining the status of the operation.
-
search
@GET @Produces("application/json") public Stream<OrganizationRepresentation> search(@QueryParam("search") String search, @QueryParam("q") String searchQuery, @QueryParam("exact") Boolean exact, @QueryParam("first") @DefaultValue("0") Integer first, @QueryParam("max") @DefaultValue("10") Integer max, @QueryParam("briefRepresentation") @DefaultValue("true") boolean briefRepresentation) Returns a stream of organizations, filtered according to query parameters.- Parameters:
search- aStringrepresenting either an organization name or domain.searchQuery- a query to search for organization attributes, in the format 'key1:value2 key2:value2'.exact- iftrue, the organizations will be searched using exact match for thesearchparam - i.e. either the organization name or one of its domains must match exactly thesearchparam. If false, the method returns all organizations whose name or (domains) partially match thesearchparam.first- the position of the first result to be processed (pagination offset). Ignored if negative ornull.max- the maximum number of results to be returned. Ignored if negative ornull.- Returns:
- a non-null
Streamof matched organizations.
-
get
Base path for the admin REST API for one particular organization. -
getOrganizationCount
@GET @Path("count") @Produces("application/json") public long getOrganizationCount(@QueryParam("search") String search, @QueryParam("q") String searchQuery, @QueryParam("exact") Boolean exact) Returns the organizations counts.- Returns:
-
getOrganizations
@Path("members/{member-id}/organizations") @GET @Produces("application/json") public Stream<OrganizationRepresentation> getOrganizations(@PathParam("member-id") String memberId, @QueryParam("briefRepresentation") @DefaultValue("true") boolean briefRepresentation)
-