-
Notifications
You must be signed in to change notification settings - Fork 1
/
models_webhook.go
69 lines (59 loc) · 2.59 KB
/
models_webhook.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package cloudloyalty_client
const (
EventSourceInternal = "internal"
EventSourceAPI = "api"
)
type Events []Event
type Event struct {
EventName string `json:"event"`
EventID string `json:"eventId"`
EventTime string `json:"eventTime"`
Source string `json:"source"`
ClientNew *ClientNewEvent `json:"EVENT_CLIENT_NEW"`
ClientChanged *ClientChangedEvent `json:"EVENT_CLIENT_CHANGED"`
ClientBonusesChanged *ClientBonusesChangedEvent `json:"EVENT_CLIENT_BONUSES_CHANGED"`
ClientEmailSubscribed *ClientEmailSubscriptionChangedEvent `json:"EVENT_CLIENT_EMAIL_SUBSCRIBED"`
ClientEmailUnsubscribed *ClientEmailSubscriptionChangedEvent `json:"EVENT_CLIENT_EMAIL_UNSUBSCRIBED"`
}
type ClientNewEvent struct {
ClientData ClientChangedEventClientData `json:"clientData"`
}
type ClientChangedEvent struct {
Client ClientEventClientQuery `json:"client"`
ClientData ClientChangedEventClientData `json:"clientData"`
}
type ClientEventClientQuery struct {
PhoneNumber string `json:"phoneNumber"`
Card string `json:"card"`
ExternalID string `json:"externalId"`
}
type ClientChangedEventClientData struct {
PhoneNumber string `json:"phoneNumber"`
Card string `json:"card"`
ExternalID string `json:"externalId"`
Surname string `json:"surname"`
Name string `json:"name"`
PatronymicName string `json:"patronymicName"`
FullName string `json:"fullName"`
Gender int `json:"gender"`
Birthdate string `json:"birthdate"`
Email string `json:"email"`
Level int `json:"level"`
IsEmailSubscribed bool `json:"isEmailSubscribed"`
IsPhoneSubscribed bool `json:"isPhoneSubscribed"`
ExtraFields ExtraFields `json:"extraFields"`
IsDeleted bool `json:"isDeleted"`
}
type ClientBonusesChangedEvent struct {
Client ClientEventClientQuery `json:"client"`
ClientBonuses ClientBonusesChangedEventBonuses `json:"clientBonuses"`
}
type ClientBonusesChangedEventBonuses struct {
TotalAmount int `json:"totalAmount"`
AvailableAmount int `json:"availableAmount"`
PendingAmount int `json:"pendingAmount"`
}
type ClientEmailSubscriptionChangedEvent struct {
Client ClientEventClientQuery `json:"client"`
Email string `json:"email"`
}