Class ModulePersonalAccessTokens


  • public class ModulePersonalAccessTokens
    extends java.lang.Object
    Personal Access Token Module.
    • 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​(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 a fetchOne(String) will _not_ return it!

        Parameters:
        token - the token to be created on Contentful.
        Returns:
        the just created token, containing the access token string.