-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebhooks.java
More file actions
57 lines (49 loc) · 1.73 KB
/
Webhooks.java
File metadata and controls
57 lines (49 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package io.mailtrap.api.webhooks;
import io.mailtrap.model.request.webhooks.CreateWebhookRequest;
import io.mailtrap.model.request.webhooks.UpdateWebhookRequest;
import io.mailtrap.model.response.webhooks.CreateWebhookResponse;
import io.mailtrap.model.response.webhooks.ListWebhooksResponse;
import io.mailtrap.model.response.webhooks.WebhookResponse;
public interface Webhooks {
/**
* Create a new webhook for the account. The response includes the
* {@code signing_secret} used to verify webhook signatures (only returned on creation).
*
* @param accountId unique account ID
* @param request webhook configuration
* @return created webhook including the signing secret
*/
CreateWebhookResponse createWebhook(long accountId, CreateWebhookRequest request);
/**
* List all webhooks for the account.
*
* @param accountId unique account ID
* @return webhooks
*/
ListWebhooksResponse getAllWebhooks(long accountId);
/**
* Get a single webhook by ID.
*
* @param accountId unique account ID
* @param webhookId webhook ID
* @return webhook details
*/
WebhookResponse getWebhook(long accountId, long webhookId);
/**
* Update an existing webhook.
*
* @param accountId unique account ID
* @param webhookId webhook ID
* @param request fields to update
* @return updated webhook
*/
WebhookResponse updateWebhook(long accountId, long webhookId, UpdateWebhookRequest request);
/**
* Permanently delete a webhook.
*
* @param accountId unique account ID
* @param webhookId webhook ID
* @return the deleted webhook
*/
WebhookResponse deleteWebhook(long accountId, long webhookId);
}