Package com.contentful.java.cma
Class ModulePreviewApiKeys
- java.lang.Object
-
- com.contentful.java.cma.ModulePreviewApiKeys
-
public class ModulePreviewApiKeys extends java.lang.ObjectPreview Api Keys Module.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classModulePreviewApiKeys.AsyncAsync module.
-
Constructor Summary
Constructors Constructor Description ModulePreviewApiKeys(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)Create the module for preview api keys.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModulePreviewApiKeys.Asyncasync()protected com.contentful.java.cma.ServicePreviewApiKeyscreateService(retrofit2.Retrofit retrofit)CMAArray<CMAPreviewApiKey>fetchAll()Fetch all preview API keys from the configured space.CMAArray<CMAPreviewApiKey>fetchAll(java.lang.String spaceId)Fetch all preview api keys from the given space.CMAPreviewApiKeyfetchOne(java.lang.String keyId)Fetch only one preview api key from the configured space.CMAPreviewApiKeyfetchOne(java.lang.String spaceId, java.lang.String keyId)Fetch only one preview api key.
-
-
-
Constructor Detail
-
ModulePreviewApiKeys
public ModulePreviewApiKeys(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)Create the module for preview api keys.- Parameters:
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.
-
-
Method Detail
-
createService
protected com.contentful.java.cma.ServicePreviewApiKeys createService(retrofit2.Retrofit retrofit)
-
fetchAll
public CMAArray<CMAPreviewApiKey> fetchAll()
Fetch all preview API keys from the configured space.- Returns:
- a list of preview api keys.
- Throws:
java.lang.IllegalArgumentException- if configured space Id is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String)
-
fetchAll
public CMAArray<CMAPreviewApiKey> fetchAll(java.lang.String spaceId)
Fetch all preview api keys from the given space.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the id of the space to host the api keys.- Returns:
- a list of preview api keys.
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.
-
fetchOne
public CMAPreviewApiKey fetchOne(java.lang.String keyId)
Fetch only one preview api key from the configured space.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
keyId- the id of the key itself.- Returns:
- one preview api key.
- Throws:
java.lang.IllegalArgumentException- if configured spaceId is null.java.lang.IllegalArgumentException- if keyId is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String)
-
fetchOne
public CMAPreviewApiKey fetchOne(java.lang.String spaceId, java.lang.String keyId)
Fetch only one preview api key.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the id of the space this is valid on.keyId- the id of the key itself.- Returns:
- one preview api key.
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if keyId is null.
-
async
public ModulePreviewApiKeys.Async async()
- Returns:
- a module with a set of asynchronous methods.
-
-