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,
java.lang.String spaceId,
java.lang.String environmentId,
boolean environmentIdConfigured)
Create this module.
|
| Modifier and Type | Method and Description |
|---|---|
ModuleWebhooks.Async |
async()
Use this method if you require asynchronous requests through retrofit.
|
CMAWebhookCallDetail |
callDetails(CMAWebhookCall call)
Get more information about one specific call to one specific webhook, hosted by one specific
space.
|
CMAArray<CMAWebhookCall> |
calls(CMAWebhook webhook)
Get more information about a specific webhook.
|
CMAWebhook |
create(CMAWebhook webhook)
Create a new webhook.
|
CMAWebhook |
create(java.lang.String spaceId,
CMAWebhook webhook)
Create a new webhook.
|
protected com.contentful.java.cma.ServiceWebhooks |
createService(retrofit2.Retrofit retrofit)
Internal method used for creating the service.
|
java.lang.Integer |
delete(CMAWebhook webhook)
Delete a given Webhook.
|
CMAArray<CMAWebhook> |
fetchAll()
Retrieve all the webhooks defined the configured space.
|
CMAArray<CMAWebhook> |
fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
Retrieve specific webhooks matching a query for this space.
|
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 webhookId)
Retrieve exactly one webhook, whose id you know.
|
CMAWebhook |
fetchOne(java.lang.String spaceId,
java.lang.String webhookId)
Retrieve exactly one webhook, whose id you know.
|
CMAWebhookHealth |
health(CMAWebhook webhook)
Return a general understanding of the health of the webhook.
|
CMAWebhook |
update(CMAWebhook webhook)
Change the content of a webhook.
|
public ModuleWebhooks(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.String environmentId,
boolean environmentIdConfigured)
retrofit - the retrofit instance to be used to create the service.callbackExecutor - to tell on which thread it should run.spaceId - the space to be used when not given.environmentId - the environment to be used when not given.environmentIdConfigured - internal helper to see if environment was set.protected com.contentful.java.cma.ServiceWebhooks createService(retrofit2.Retrofit retrofit)
retrofit - A Retrofit instance to create the service from.public ModuleWebhooks.Async async()
public CMAWebhook create(CMAWebhook webhook)
This will create a new ID and return the newly created webhook as a return value.
webhook - A representation of the Webhook to be used.java.lang.IllegalArgumentException - if configured space id is null.java.lang.IllegalArgumentException - if webhook is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)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.
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - Which space should be used?webhook - A representation of the Webhook to be used.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if webhook is null.public java.lang.Integer delete(CMAWebhook webhook)
webhook - actual webhook to be deleted.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhookId is null.public CMAArray<CMAWebhook> fetchAll()
CMAArray containing all found webhooks for this space.java.lang.IllegalArgumentException - if configured spaceId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMAWebhook> fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
query - Specifying the criteria on which webhooks to return.CMAArray containing all found webhooks for this space.java.lang.IllegalArgumentException - if configured spaceId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMAWebhook> fetchAll(java.lang.String spaceId)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
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)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
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 webhookId)
webhookId - The id of the webhook to be returned.java.lang.IllegalArgumentException - if configured spaceId is null.java.lang.IllegalArgumentException - if webhookId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAWebhook fetchOne(java.lang.String spaceId, java.lang.String webhookId)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
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(CMAWebhook webhook)
webhook - webhook to be asked for more detail.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhook is null.CMAWebhookCallpublic CMAWebhookCallDetail callDetails(CMAWebhookCall call)
call - A call to be get more information 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(CMAWebhook webhook)
webhook - Which webhook should be asked for its health?java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if webhook is null.Copyright © 2019 Contentful, GmbH.. All Rights Reserved.