-
Notifications
You must be signed in to change notification settings - Fork 1
/
webhookevent.go
43 lines (31 loc) · 1.1 KB
/
webhookevent.go
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
package monta
import "time"
// WebhookEvent wraps a WebhookEntry and metadata on a webhook call.
type WebhookEvent struct {
// ID of the webhook event.
ID int64 `json:"id"`
// ConsumerID of the intended receiver of the webhook.
ConsumerID int64 `json:"consumerId"`
// ID of the operator.
OperatorID int64 `json:"operatorId"`
// Entity type related to webhook event.
WebhookEntityPluralType WebhookEntityPluralType `json:"eventType"`
// Payload of the related webhook call.
WebhookEntry WebhookEntry `json:"payload"`
// Status of the webhook call.
Status WebhookEventStatus `json:"status"`
// Error related to the webhook call.
Error string `json:"error"`
// When the webhook event was created.
CreatedAt time.Time `json:"createdAt"`
// When the webhook event was last updated.
UpdatedAt time.Time `json:"updatedAt"`
}
// Status of the webhook call.
type WebhookEventStatus string
// Known [WebhookEventStatus] values.
const (
WebhookStatusPending WebhookEventStatus = "pending"
WebhookStatusCompleted WebhookEventStatus = "completed"
WebhookStatusFailure WebhookEventStatus = "failure"
)