Package com.contentful.java.cma.model
Class CMAApiKey
- java.lang.Object
-
- com.contentful.java.cma.model.CMAResource
-
- com.contentful.java.cma.model.CMAApiKey
-
public class CMAApiKey extends CMAResource
Class representing api keys created.
-
-
Constructor Summary
Constructors Constructor Description CMAApiKey()Create a new api key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMAApiKeyaddEnvironment(java.lang.String environment)Add environment ids to the api key.java.lang.StringgetAccessToken()java.lang.StringgetDescription()java.util.List<CMALink>getEnvironments()java.lang.StringgetName()CMALinkgetPreviewApiKey()CMAApiKeysetAccessToken(java.lang.String accessToken)CMAApiKeysetDescription(java.lang.String description)Update the description of this key.CMAApiKeysetName(java.lang.String name)Update the name of the key.CMAApiKeysetPreviewApiKey(CMALink previewApiKey)java.lang.StringtoString()-
Methods inherited from class com.contentful.java.cma.model.CMAResource
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, getVisibility, isArchived, isPublished, setEnvironmentId, setId, setSpaceId, setSystem, setVersion, setVisibility
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- What is the name of this key?
-
setName
public CMAApiKey setName(java.lang.String name)
Update the name of the key.- Parameters:
name- new name to be used.- Returns:
- this instance for ease of chaining.
-
getDescription
public java.lang.String getDescription()
- Returns:
- the description of this key.
-
setDescription
public CMAApiKey setDescription(java.lang.String description)
Update the description of this key.- Parameters:
description- to be changed to.- Returns:
- this instance for chaining.
-
getAccessToken
public java.lang.String getAccessToken()
- Returns:
- readonly api access token for this key.
-
setAccessToken
public CMAApiKey setAccessToken(java.lang.String accessToken)
-
getPreviewApiKey
public CMALink getPreviewApiKey()
- Returns:
- readonly preview api key part.
-
getEnvironments
public java.util.List<CMALink> getEnvironments()
- Returns:
- list of links to environments this key is active on.
-
addEnvironment
public CMAApiKey addEnvironment(java.lang.String environment)
Add environment ids to the api key.- Parameters:
environment- a new environment to be affected by this key. A link for the payload will be created automatically.- Returns:
- the api key for easy chaining.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classCMAResource- Returns:
- a human readable string, representing the object.
-
-