public class CMAPersonalAccessToken extends CMAResource
Once a personal access token is created, it's token field will be returned only once: directly as a result of the create call.
Modifier and Type | Class and Description |
---|---|
static class |
CMAPersonalAccessToken.Scope
Enum holding the allowed values of scope.
|
Constructor and Description |
---|
CMAPersonalAccessToken()
Create a new personal access token to be uploaded to Contentful.
|
Modifier and Type | Method and Description |
---|---|
CMAPersonalAccessToken |
addScope(CMAPersonalAccessToken.Scope scope)
Add a new scope to the list of scopes.
|
java.lang.String |
getName() |
java.lang.String |
getRevokedAt() |
java.util.List<CMAPersonalAccessToken.Scope> |
getScopes() |
java.lang.String |
getToken()
This getter returns the token string of this token.
|
CMAPersonalAccessToken |
setName(java.lang.String name)
Sets the name for this personal access token.
|
CMAPersonalAccessToken |
setSystem(CMASystem system)
Sets the system field.
|
java.lang.String |
toString() |
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, isArchived, isPublished, setEnvironmentId, setId, setSpaceId, setVersion
public CMAPersonalAccessToken()
public CMAPersonalAccessToken setSystem(CMASystem system)
setSystem
in class CMAResource
system
- sets the system property.public java.lang.String getName()
public CMAPersonalAccessToken setName(java.lang.String name)
name
- the name of the personal access token to be set.CMAPersonalAccessToken
instance.public java.lang.String getRevokedAt()
ModulePersonalAccessTokens.revoke(CMAPersonalAccessToken)
public CMAPersonalAccessToken addScope(CMAPersonalAccessToken.Scope scope)
scope
- the new scope to be added.public java.util.List<CMAPersonalAccessToken.Scope> getScopes()
public java.lang.String getToken()
This string is to be used instead of the CMA token used to create it. Sadly it is only available directly after the token got created, as a response to the create call. Subsequent calls of fetching it by id, or as a collection request, will not return it, so please save it securely after creation.
public java.lang.String toString()
toString
in class CMAResource
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.