-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebhook.go
More file actions
28 lines (21 loc) · 804 Bytes
/
Copy pathwebhook.go
File metadata and controls
28 lines (21 loc) · 804 Bytes
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
package monta
// WebhookRequest is a webhook request from Monta.
type WebhookRequest struct {
// List of webhook entries delivered in a batch.
Entries []WebhookEntry `json:"entries"`
// Number of pending events left for delivery.
Pending int64 `json:"pending"`
// Timestamp of the request (milliseconds from the epoch of 1970-01-01T00:00:00Z).
Timestamp UnixTimestamp `json:"timestamp"`
}
// WebhookEntry is an entry of the webhook request.
type WebhookEntry struct {
// Type of the entity.
EntityType WebhookEntityType `json:"entityType"`
// ID of the entity.
EntityID string `json:"entityId"`
// Type of event, ie. created, deleted, updated.
EventType WebhookEventType `json:"eventType"`
// Payload of this entity, e.g. a full Charge object.
Payload interface{} `json:"payload"`
}