public class CMAWebhook extends CMAResource
A valid webhook needs to at least have called setName(String), setUrl(String),
addTopic(CMAWebhookTopic).
| Constructor and Description |
|---|
CMAWebhook()
Create a webhoook, setting up the system attribute for it.
|
| Modifier and Type | Method and Description |
|---|---|
CMAWebhook |
addHeader(java.lang.String key,
java.lang.String value)
Adds a custom http header to the call done by this webhook.
|
CMAWebhook |
addTopic(CMAWebhookTopic topic)
Add a topic this webhook should be triggered on.
|
java.util.List<CMAWebhookHeader> |
getHeaders() |
java.lang.String |
getName() |
java.lang.String |
getPassword() |
java.util.List<CMAWebhookTopic> |
getTopics() |
java.lang.String |
getUrl() |
java.lang.String |
getUser() |
CMAWebhook |
setBasicAuthorization(java.lang.String user,
java.lang.String password)
Set authorization parameter for basic HTTP authorization on the url to be called by this
webhook.
|
CMAWebhook |
setId(java.lang.String id)
Convenience: Update the id of this entry without going through
CMAResource.getSystem(). |
CMAWebhook |
setName(java.lang.String name)
Set the name of this webhook.
|
CMAWebhook |
setSpaceId(java.lang.String spaceId)
Convenience: Update the space id of this entry without going through
CMAResource.getSystem(). |
CMAWebhook |
setSystem(CMASystem system)
Sets the system field.
|
CMAWebhook |
setUrl(java.lang.String url)
Sets the url to be called when this webhook is triggered.
|
CMAWebhook |
setVersion(java.lang.Integer version)
Convenience: Update the version of this entry without going through
CMAResource.getSystem(). |
java.lang.String |
toString() |
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, isArchived, isPublished, setEnvironmentIdpublic CMAWebhook()
public CMAWebhook setSystem(CMASystem system)
setSystem in class CMAResourcesystem - sets the system property.public CMAWebhook setId(java.lang.String id)
CMAResource.getSystem().setId in class CMAResourceid - to be set.public CMAWebhook setVersion(java.lang.Integer version)
CMAResource.getSystem().setVersion in class CMAResourceversion - to be set.public CMAWebhook setSpaceId(java.lang.String spaceId)
CMAResource.getSystem().setSpaceId in class CMAResourcespaceId - to be set.public CMAWebhook addTopic(CMAWebhookTopic topic)
topic - a valid enum value for the trigger reason.public CMAWebhook addHeader(java.lang.String key, java.lang.String value)
key - HTTP header key to be used (aka 'X-My-Header-Name')value - HTTP header value to be used (aka 'this-is-my-name')public CMAWebhook setBasicAuthorization(java.lang.String user, java.lang.String password)
user - username to be usedpassword - password to be used (cannot be retrieved, only updated!)public java.lang.String getName()
public CMAWebhook setName(java.lang.String name)
name - to identify this webhookpublic java.lang.String getUrl()
public CMAWebhook setUrl(java.lang.String url)
url - complete, existing url to be usedpublic java.util.List<CMAWebhookTopic> getTopics()
public java.util.List<CMAWebhookHeader> getHeaders()
public java.lang.String getUser()
setBasicAuthorization(String, String)public java.lang.String getPassword()
setBasicAuthorization(String, String)public java.lang.String toString()
toString in class CMAResourceCopyright © 2019 Contentful, GmbH.. All Rights Reserved.