public class ModuleWebhooks
extends java.lang.Object
All methods here are available twice: Once synchronously and asynchronously through
async().
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleWebhooks.Async
Async module.
|
| Constructor and Description |
|---|
ModuleWebhooks(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor)
Create this module.
|
| Modifier and Type | Method and Description |
|---|---|
ModuleWebhooks.Async |
async()
Use this method if you require asynchronous requests through retrofit.
|
CMAWebhookCallDetail |
callDetails(java.lang.String spaceId,
java.lang.String webhookId,
java.lang.String callId)
Get more information about one specific call to one specific webhook, hosted by one specific
space.
|
CMAArray<CMAWebhookCall> |
calls(java.lang.String spaceId,
java.lang.String webhookId)
Get more information about a specific webhook.
|
CMAWebhook |
create(java.lang.String spaceId,
CMAWebhook webhook)
Create a new webhook.
|
CMAWebhook |
create(java.lang.String spaceId,
java.lang.String webhookId,
CMAWebhook webhook)
Create a new webhook with specified ID.
|
protected com.contentful.java.cma.ServiceWebhooks |
createService(retrofit2.Retrofit retrofit)
Internal method used for creating the service.
|
java.lang.Integer |
delete(java.lang.String spaceId,
java.lang.String webhookId)
Delete a given Webhook by its ID.
|
CMAArray<CMAWebhook> |
fetchAll(java.lang.String spaceId)
Retrieve all the webhooks defined for this space.
|
CMAArray<CMAWebhook> |
fetchAll(java.lang.String spaceId,
java.util.Map<java.lang.String,java.lang.String> query)
Retrieve specific webhooks matching a query for this space.
|
CMAWebhook |
fetchOne(java.lang.String spaceId,
java.lang.String webhookId)
Retrieve exactly one webhook, whose id you know.
|
CMAWebhookHealth |
health(java.lang.String spaceId,
java.lang.String webhookId)
Return a general understanding of the health of the webhooks.
|
CMAWebhook |
update(CMAWebhook webhook)
Change the content of a webhook.
|
public ModuleWebhooks(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor)
retrofit - An instance to an already setup Retrofit modulecallbackExecutor - Use this executor for this module.public ModuleWebhooks.Async async()
public CMAWebhook create(java.lang.String spaceId, CMAWebhook webhook)
This will create a new ID and return the newly created webhook as a return value.
spaceId - Which space should be used?webhook - A representation of the Webhook to be used.java.lang.IllegalArgumentException - if space's id is null.java.lang.IllegalArgumentException - if webhook is null.public CMAWebhook create(java.lang.String spaceId, java.lang.String webhookId, CMAWebhook webhook)
Similar to create(String, CMAWebhook) but uses an id for this Webhook.
spaceId - the space, this Webhook should be created in.webhookId - What id should be given to the new webhook?webhook - Contains the actual data of the webhook to be created.java.lang.IllegalArgumentException - if space's id is null.java.lang.IllegalArgumentException - if webhookId is null.java.lang.IllegalArgumentException - if webhook is null.public java.lang.Integer delete(java.lang.String spaceId,
java.lang.String webhookId)
spaceId - The id of the space hosting the webhook to be deleted.webhookId - The id of the actual webhook to be deleted.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhookId is null.public CMAArray<CMAWebhook> fetchAll(java.lang.String spaceId)
spaceId - The id of the space to be asked for all of its spaces.CMAArray containing all found webhooks for this space.java.lang.IllegalArgumentException - if spaceId is null.public CMAArray<CMAWebhook> fetchAll(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> query)
spaceId - The id of the space to be asked for all of its spaces.query - Specifying the criteria on which webhooks to return.CMAArray containing all found webhooks for this space.java.lang.IllegalArgumentException - if spaceId is null.public CMAWebhook fetchOne(java.lang.String spaceId, java.lang.String webhookId)
spaceId - The id of the space to be hosting this webhook.webhookId - The id of the webhook to be returned.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhookId is null.public CMAWebhook update(CMAWebhook webhook)
This will take the webhooks id and update it on the backend.
webhook - The webhook retrieved beforehand to be changed.java.lang.IllegalArgumentException - if webhook is null.java.lang.IllegalArgumentException - if webhookId is null.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if version is null.public CMAArray<CMAWebhookCall> calls(java.lang.String spaceId, java.lang.String webhookId)
spaceId - The id of the space hosting the webhookwebhookId - The id of the webhook to be asked for more detail.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhook is null.CMAWebhookCallpublic CMAWebhookCallDetail callDetails(java.lang.String spaceId, java.lang.String webhookId, java.lang.String callId)
spaceId - A space id, identifying the space containing the webhook.webhookId - A webhook id containing the webhook containing the call.callId - A call id identifying the call to be informed about.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhook is null.java.lang.IllegalArgumentException - if callId is null.public CMAWebhookHealth health(java.lang.String spaceId, java.lang.String webhookId)
spaceId - Which space does host this webhook?webhookId - Which webhook should be asked for its health?java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhook is null.protected com.contentful.java.cma.ServiceWebhooks createService(retrofit2.Retrofit retrofit)
retrofit - A Retrofit instance to create the service from.Copyright © 2018 Contentful, GmbH.. All Rights Reserved.