Package au.org.ala.userdetails
Interface UserDetailsClient
public interface UserDetailsClient
An interface that represents the exposed web services of the UserDetails application.
Use the UserDetailsClient.Builder or Retrofit to generate an instance.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA Builder for generating UserDetailsClient instances. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionretrofit2.Call<UserDetails>getUserDetails(String username, boolean includeProps) Return a JSON object containing id, email and display name for a given user, use includeProps=true to get additional information such as organisationretrofit2.Call<List<UserDetails>>getUserDetailsByRole(String role, boolean includeProps, List<String> ids) Get the user details for all users with a given role, with optional filtering by user id / username / emailretrofit2.Call<UserDetailsFromIdListResponse>return the UserDetails objects for a list of user ids.Deprecated.retrofit2.Call<List<UserDetails>>Deprecated.Deprecated.retrofit2.Call<UserStatsResponse>return the User statsretrofit2.Call<List<UserDetails>>searchUserDetails(String query, int max) Search the users for all users whose email or name matches the query.
-
Field Details
-
GET_USER_DETAILS_PATH
- See Also:
-
GET_USER_DETAILS_FROM_ID_LIST_PATH
- See Also:
-
GET_USER_LIST_FULL_PATH
- See Also:
-
GET_USER_LIST_PATH
- See Also:
-
GET_USER_LIST_WITH_IDS_PATH
- See Also:
-
GET_USER_DETAILS_BY_ROLE_PATH
- See Also:
-
SEARCH_USERDETAILS_PATH
- See Also:
-
GET_USER_STATS_PATH
- See Also:
-
-
Method Details
-
getUserDetails
@POST("userDetails/getUserDetails") retrofit2.Call<UserDetails> getUserDetails(@Query("userName") String username, @Query("includeProps") boolean includeProps) Return a JSON object containing id, email and display name for a given user, use includeProps=true to get additional information such as organisation- Parameters:
username- Can be either a numeric id or an email address idincludeProps- True to include extended properties such as organisation, telephone, etc.- Returns:
- A call that will return a UserDetails object.
-
getUserDetailsFromIdList
@POST("userDetails/getUserDetailsFromIdList") retrofit2.Call<UserDetailsFromIdListResponse> getUserDetailsFromIdList(@Body UserDetailsFromIdListRequest request) return the UserDetails objects for a list of user ids.- Parameters:
request- The request body - accepts numeric ids only.- Returns:
- A response object with the matched UserDetails and any missing ids and or error messages.
-
getUserStats
return the User stats- Returns:
- A response object with the user stats
-
getUserDetailsByRole
@GET("userDetails/byRole") retrofit2.Call<List<UserDetails>> getUserDetailsByRole(@Query("role") String role, @Query("includeProps") boolean includeProps, @Query("id") List<String> ids) Get the user details for all users with a given role, with optional filtering by user id / username / email- Parameters:
role- The role to filter for (eg ROLE_USER)includeProps- Whether to include extended properties or notids- List of numeric ids as Strings / user names / passwords- Returns:
- The list of users that match the restrictions
-
searchUserDetails
@GET("userDetails/search") retrofit2.Call<List<UserDetails>> searchUserDetails(@Query("q") String query, @Query("max") int max) Search the users for all users whose email or name matches the query.- Parameters:
query- The query string to search formax- Max number of results to return- Returns:
- The list of users that match the query
-
getUserListFull
@Deprecated @POST("userDetails/getUserListFull") retrofit2.Call<List<UserDetails>> getUserListFull()Deprecated.Return all the UserDetails. This will be super slow probably so caching the result is advised.- Returns:
- A call that returns all the UserDetails.
-
getUserList
Deprecated.Return a map of User email to User display name. Returns all known users.- Returns:
- A map of User email to User display name
-
getUserListWithIds
@Deprecated @POST("userDetails/getUserListWithIds") retrofit2.Call<Map<String,String>> getUserListWithIds()Deprecated.Return a map of User numeric id to User display name. Returns all known users.- Returns:
- A map of User numeric id to User display name
-