public final class ModuleApiKeys
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleApiKeys.Async
Async module.
|
| Constructor and Description |
|---|
ModuleApiKeys(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.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(java.lang.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(java.util.Map<java.lang.String,java.lang.String> query)
Query for specific api keys from the configured space.
|
CMAArray<CMAApiKey> |
fetchAll(java.lang.String spaceId)
Fetch all delivery api keys from the given space.
|
CMAArray<CMAApiKey> |
fetchAll(java.lang.String spaceId,
java.util.Map<java.lang.String,java.lang.String> query)
Query for specific api keys, overriding the configuration set.
|
CMAApiKey |
fetchOne(java.lang.String keyId)
Fetch only one delivery api key from the configured space.
|
CMAApiKey |
fetchOne(java.lang.String spaceId,
java.lang.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,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.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()
java.lang.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(java.lang.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.java.lang.IllegalArgumentException - if spaceId is null.public CMAArray<CMAApiKey> fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
query - the terms to query for specific keys.java.lang.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(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.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.java.lang.IllegalArgumentException - if spaceId is null.public CMAApiKey fetchOne(java.lang.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.java.lang.IllegalArgumentException - if configured spaceId is null.java.lang.IllegalArgumentException - if keyId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAApiKey fetchOne(java.lang.String spaceId, java.lang.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.java.lang.IllegalArgumentException - if spaceId is null.java.lang.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.java.lang.IllegalArgumentException - if configured spaceId is null.java.lang.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.java.lang.IllegalArgumentException - if key is null.java.lang.IllegalArgumentException - if keys id is null.java.lang.IllegalArgumentException - if keys spaceId is null.public CMAApiKey create(java.lang.String spaceId, CMAApiKey key)
spaceId - the id of the space this is valid on.key - the key to be created.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if key is null.public int delete(CMAApiKey key)
key - the key to be deleted.java.lang.IllegalArgumentException - if key is null.java.lang.IllegalArgumentException - if key's spaceId is null.public ModuleApiKeys.Async async()
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.