public class ModuleApiKeys extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleApiKeys.Async
Async module.
|
| Constructor and Description |
|---|
ModuleApiKeys(retrofit2.Retrofit retrofit,
Executor callbackExecutor,
String spaceId,
String environmentId,
boolean environmentIdConfigured)
Create api keys module.
|
| Modifier and Type | Method and Description |
|---|---|
ModuleApiKeys.Async |
async() |
CMAApiKey |
create(CMAApiKey key)
Create a new delivery api key from the configured space.
|
CMAApiKey |
create(String spaceId,
CMAApiKey key)
Create a new delivery api key.
|
protected com.contentful.java.cma.ServiceApiKeys |
createService(retrofit2.Retrofit retrofit) |
int |
delete(CMAApiKey key)
Delete a given api key from the configured space.
|
CMAArray<CMAApiKey> |
fetchAll()
Fetch all delivery API keys from the configured space.
|
CMAArray<CMAApiKey> |
fetchAll(Map<String,String> query)
Query for specific api keys from the configured space.
|
CMAArray<CMAApiKey> |
fetchAll(String spaceId)
Fetch all delivery api keys from the given space.
|
CMAArray<CMAApiKey> |
fetchAll(String spaceId,
Map<String,String> query)
Query for specific api keys, overriding the configuration set.
|
CMAApiKey |
fetchOne(String keyId)
Fetch only one delivery api key from the configured space.
|
CMAApiKey |
fetchOne(String spaceId,
String keyId)
Fetch only one delivery api key.
|
CMAApiKey |
update(CMAApiKey key)
Updates a delivery api key from the configured space.
|
public ModuleApiKeys(retrofit2.Retrofit retrofit,
Executor callbackExecutor,
String spaceId,
String environmentId,
boolean environmentIdConfigured)
retrofit - the retrofit instance to be used to create the service.callbackExecutor - to tell on which thread it should run.spaceId - the space to be used when not given.environmentId - the environment to be used when not given.environmentIdConfigured - internal helper to see if environment was set.protected com.contentful.java.cma.ServiceApiKeys createService(retrofit2.Retrofit retrofit)
public CMAArray<CMAApiKey> fetchAll()
IllegalArgumentException - if configured space Id is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMAApiKey> fetchAll(String spaceId)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - the id of the space to host the api keys.IllegalArgumentException - if spaceId is null.public CMAArray<CMAApiKey> fetchAll(Map<String,String> query)
query - the terms to query for specific keys.IllegalArgumentException - if configured space Id is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMAApiKey> fetchAll(String spaceId, Map<String,String> query)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - the id of the space to host the api keys.query - the terms to query for specific keys.IllegalArgumentException - if spaceId is null.public CMAApiKey fetchOne(String keyId)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
keyId - the id of the key itself.IllegalArgumentException - if configured spaceId is null.IllegalArgumentException - if keyId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAApiKey fetchOne(String spaceId, String keyId)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - the id of the space this is valid on.keyId - the id of the key itself.IllegalArgumentException - if spaceId is null.IllegalArgumentException - if keyId is null.public CMAApiKey create(CMAApiKey key)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
key - the key to be created.IllegalArgumentException - if configured spaceId is null.IllegalArgumentException - if key is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAApiKey update(CMAApiKey key)
key - the key to be updated.IllegalArgumentException - if key is null.IllegalArgumentException - if keys id is null.IllegalArgumentException - if keys spaceId is null.public CMAApiKey create(String spaceId, CMAApiKey key)
spaceId - the id of the space this is valid on.key - the key to be created.IllegalArgumentException - if spaceId is null.IllegalArgumentException - if key is null.public int delete(CMAApiKey key)
key - the key to be deleted.IllegalArgumentException - if key is null.IllegalArgumentException - if key's spaceId is null.public ModuleApiKeys.Async async()
Copyright © 2026 Contentful, GmbH.. All rights reserved.