Interface DuoAdminClient
- All Known Implementing Classes:
DefaultDuoAdminClient
public interface DuoAdminClient
A client that supports retrieval of information from the Duo Admin API.
Clients should be thread-safe and re-usable.
- Since:
- 2.1.0
-
Method Summary
Modifier and TypeMethodDescriptiongetUser(ProfileRequestContext context, String username) Get the User that corresponds to the given username from the Duo Admin API.Generic method for returning aDuoAdminListMapResponseWrapperresponse from the given path and parameters.<T extends DuoAdminResponseWrapper<?>>
Tretrieve(ProfileRequestContext context, String path, Map<String, String> parameters, com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef) Generic method for returning a type ofDuoAdminResponseWrapperresponse from the given path and parameters.
-
Method Details
-
getUser
@Nullable User getUser(@Nonnull ProfileRequestContext context, @Nonnull @NotEmpty String username) throws DuoException Get the User that corresponds to the given username from the Duo Admin API.- Parameters:
context- context the profile request context, typically used in locating theDuoIntegrationto useusername- a user name (or username alias) to look up a single user- Returns:
- the User iff found, or null
- Throws:
DuoException- on error retrieving a response from the API
-
retrieve
@Nonnull <T extends DuoAdminResponseWrapper<?>> T retrieve(@Nonnull ProfileRequestContext context, @Nonnull @NotEmpty String path, @Nullable @NonnullElements Map<String, String> parameters, @Nonnull com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef) throws DuoExceptionGeneric method for returning a type ofDuoAdminResponseWrapperresponse from the given path and parameters.Note, only GET requests should be allowed and hence only retrieval operations should be supported.
- Type Parameters:
T- the type of response- Parameters:
context- the profile request context, typically used in locating theDuoIntegrationto usepath- the path component of the API endpointparameters- any name value pairs to add to the HTTP request parameterswrapperTypeRef- the type of response to return- Returns:
- a
DuoAdminResponseWrapperwith the correct response type embedded - Throws:
DuoException- on error retrieving a response from the API
-
retrieve
@Nonnull DuoAdminListMapResponseWrapper retrieve(@Nonnull ProfileRequestContext context, @Nonnull @NotEmpty String path, @Nullable @NonnullElements Map<String, String> parameters) throws DuoExceptionGeneric method for returning aDuoAdminListMapResponseWrapperresponse from the given path and parameters.Note, only GET requests should be allowed and hence only retrieval operations should be supported.
- Parameters:
context- the profile request context, typically used in locating theDuoIntegrationto usepath- the path component of the API endpointparameters- any name value pairs to add to the HTTP request parameters- Returns:
- a
DuoAdminListMapResponseWrapperwith a List of Maps response type embedded - Throws:
DuoException- on error retrieving a response from the API
-