Package com.contentful.java.cma
Class ModulePersonalAccessTokens
- java.lang.Object
-
- com.contentful.java.cma.ModulePersonalAccessTokens
-
public class ModulePersonalAccessTokens extends java.lang.ObjectPersonal Access Token Module.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classModulePersonalAccessTokens.AsyncAsync module.
-
Constructor Summary
Constructors Constructor Description ModulePersonalAccessTokens(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, boolean environmentIdConfigured)Create this module.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModulePersonalAccessTokens.Asyncasync()CMAPersonalAccessTokencreate(CMAPersonalAccessToken token)Create a new personal access token.protected com.contentful.java.cma.ServicePersonalAccessTokenscreateService(retrofit2.Retrofit retrofit)CMAArray<CMAPersonalAccessToken>fetchAll()CMAArray<CMAPersonalAccessToken>fetchAll(java.util.Map<java.lang.String,java.lang.String> query)CMAPersonalAccessTokenfetchOne(java.lang.String tokenId)CMAPersonalAccessTokenrevoke(CMAPersonalAccessToken token)Revoke a delivery api token.
-
-
-
Constructor Detail
-
ModulePersonalAccessTokens
public ModulePersonalAccessTokens(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, boolean environmentIdConfigured)Create this module.- Parameters:
retrofit- the retrofit instance to be used to create the service.callbackExecutor- to tell on which thread it should run.environmentIdConfigured- internal helper to see if environment was set.
-
-
Method Detail
-
createService
protected com.contentful.java.cma.ServicePersonalAccessTokens createService(retrofit2.Retrofit retrofit)
-
fetchAll
public CMAArray<CMAPersonalAccessToken> fetchAll()
- Returns:
- a list of personal access tokens.
-
fetchAll
public CMAArray<CMAPersonalAccessToken> fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
- Parameters:
query- defines the items to be returned.- Returns:
- a list of specific personal access tokens.
-
fetchOne
public CMAPersonalAccessToken fetchOne(java.lang.String tokenId)
- Parameters:
tokenId- the id of the access token to be returned.- Returns:
- one personal access token.
-
create
public CMAPersonalAccessToken create(CMAPersonalAccessToken token)
Create a new personal access token.This method is the _only_ time you will see the personal access token value. Please keep it save after this call, because a
fetchAll()or afetchOne(String)will _not_ return it!- Parameters:
token- the token to be created on Contentful.- Returns:
- the just created token, containing the access token string.
-
revoke
public CMAPersonalAccessToken revoke(CMAPersonalAccessToken token)
Revoke a delivery api token.- Parameters:
token- the token to be revoked.- Returns:
- the just revoked token.
-
async
public ModulePersonalAccessTokens.Async async()
- Returns:
- a module with a set of asynchronous methods.
-
-