Class UserApiKeyAuthProviderClientImpl
- java.lang.Object
-
- com.mongodb.stitch.core.auth.providers.internal.CoreAuthProviderClient<StitchAuthRequestClient>
-
- com.mongodb.stitch.core.auth.providers.userapikey.internal.CoreUserApiKeyAuthProviderClient
-
- com.mongodb.stitch.android.core.auth.providers.userapikey.internal.UserApiKeyAuthProviderClientImpl
-
- All Implemented Interfaces:
UserApiKeyAuthProviderClient
public final class UserApiKeyAuthProviderClientImpl extends CoreUserApiKeyAuthProviderClient implements UserApiKeyAuthProviderClient
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.mongodb.stitch.core.auth.providers.userapikey.internal.CoreUserApiKeyAuthProviderClient
CoreUserApiKeyAuthProviderClient.ApiKeyFields
-
-
Field Summary
-
Fields inherited from interface com.mongodb.stitch.android.core.auth.providers.userapikey.UserApiKeyAuthProviderClient
factory
-
-
Constructor Summary
Constructors Constructor Description UserApiKeyAuthProviderClientImpl(StitchAuthRequestClient requestClient, StitchAuthRoutes routes, TaskDispatcher dispatcher)
-
Method Summary
Modifier and Type Method Description Task<UserApiKey>
createApiKey(String name)
Creates a user API key that can be used to authenticate as the current user.Task<Void>
deleteApiKey(ObjectId id)
Deletes a user API key associated with the current user.Task<Void>
disableApiKey(ObjectId id)
Disables a user API key associated with the current user.Task<Void>
enableApiKey(ObjectId id)
Enables a user API key associated with the current user.Task<UserApiKey>
fetchApiKey(ObjectId id)
Fetches a user API key associated with the current user.Task<List<UserApiKey>>
fetchApiKeys()
Fetches the user API keys associated with the current user.-
Methods inherited from class com.mongodb.stitch.core.auth.providers.userapikey.internal.CoreUserApiKeyAuthProviderClient
createApiKeyInternal, deleteApiKeyInternal, disableApiKeyInternal, enableApiKeyInternal, fetchApiKeyInternal, fetchApiKeysInternal
-
Methods inherited from class com.mongodb.stitch.core.auth.providers.internal.CoreAuthProviderClient
getBaseRoute, getProviderName, getRequestClient
-
-
-
-
Constructor Detail
-
UserApiKeyAuthProviderClientImpl
public UserApiKeyAuthProviderClientImpl(StitchAuthRequestClient requestClient, StitchAuthRoutes routes, TaskDispatcher dispatcher)
-
-
Method Detail
-
createApiKey
public Task<UserApiKey> createApiKey(@NonNull String name)
Creates a user API key that can be used to authenticate as the current user.- Specified by:
createApiKey
in interfaceUserApiKeyAuthProviderClient
- Parameters:
name
- The name of the API key to be created- Returns:
- A
Task
that contains the created API key.
-
fetchApiKey
public Task<UserApiKey> fetchApiKey(@NonNull ObjectId id)
Fetches a user API key associated with the current user.- Specified by:
fetchApiKey
in interfaceUserApiKeyAuthProviderClient
- Parameters:
id
- The id of the API key to fetch.- Returns:
- A
Task
that contains the fetched API key.
-
fetchApiKeys
public Task<List<UserApiKey>> fetchApiKeys()
Fetches the user API keys associated with the current user.- Specified by:
fetchApiKeys
in interfaceUserApiKeyAuthProviderClient
- Returns:
- A
Task
that contains the list of the fetched API keys.
-
deleteApiKey
public Task<Void> deleteApiKey(@NonNull ObjectId id)
Deletes a user API key associated with the current user.- Specified by:
deleteApiKey
in interfaceUserApiKeyAuthProviderClient
- Parameters:
id
- The id of the API key to delete.- Returns:
- A
Task
that completes when the API key is deleted.
-
enableApiKey
public Task<Void> enableApiKey(@NonNull ObjectId id)
Enables a user API key associated with the current user.- Specified by:
enableApiKey
in interfaceUserApiKeyAuthProviderClient
- Parameters:
id
- The id of the API key to enable.- Returns:
- A
Task
that completes when the API key is enabled.
-
disableApiKey
public Task<Void> disableApiKey(@NonNull ObjectId id)
Disables a user API key associated with the current user.- Specified by:
disableApiKey
in interfaceUserApiKeyAuthProviderClient
- Parameters:
id
- The id of the API key to disable.- Returns:
- A
Task
that completes when the API key is disabled.
-
-