-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathwebhooks_interface.go
More file actions
63 lines (51 loc) · 2.57 KB
/
Copy pathwebhooks_interface.go
File metadata and controls
63 lines (51 loc) · 2.57 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
58
59
60
61
62
63
package meilisearch
import "context"
type WebhookManager interface {
WebhookReader
// AddWebhook add a new webhook to meilisearch.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/create-webhook
AddWebhook(params *AddWebhookRequest) (*Webhook, error)
// AddWebhookWithContext add a new webhook to meilisearch with a context.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/create-webhook
AddWebhookWithContext(ctx context.Context, params *AddWebhookRequest) (*Webhook, error)
// UpdateWebhook modifies a previously existing webhook.
// If the webhook has isEditable to false the HTTP call returns an error.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/update-webhook
UpdateWebhook(uuid string, params *UpdateWebhookRequest) (*Webhook, error)
// UpdateWebhookWithContext modifies a previously existing webhook with a context.
// If the webhook has isEditable to false the HTTP call returns an error.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/update-webhook
UpdateWebhookWithContext(ctx context.Context, uuid string, params *UpdateWebhookRequest) (*Webhook, error)
// DeleteWebhook deletes an existing webhook. Will also fail when the webhook doesn’t exist.
// If the webhook has isEditable to false the HTTP call returns an error.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/delete-webhook
DeleteWebhook(uuid string) error
// DeleteWebhookWithContext deletes an existing webhook with a context. Will also fail when the webhook doesn’t exist.
// If the webhook has isEditable to false the HTTP call returns an error.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/delete-webhook
DeleteWebhookWithContext(ctx context.Context, uuid string) error
}
type WebhookReader interface {
// ListWebhooks lists all the webhooks.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/list-webhooks
ListWebhooks() (*WebhookResults, error)
// ListWebhooksWithContext lists all the webhooks with context.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/list-webhooks
ListWebhooksWithContext(ctx context.Context) (*WebhookResults, error)
// GetWebhook gets a webhook by uuid.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/get-webhook
GetWebhook(uuid string) (*Webhook, error)
// GetWebhookWithContext gets a webhook by uuid with a context.
//
// docs: https://www.meilisearch.com/docs/reference/api/webhooks/get-webhook
GetWebhookWithContext(ctx context.Context, uuid string) (*Webhook, error)
}