-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
151 lines (136 loc) · 6.08 KB
/
types.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package dto
//ResponseDTO is struct for response default
type ResponseDTO struct {
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
}
//ResponseNotifyDTO is struct for response the notify
type ResponseNotifyDTO struct {
Ok bool `json:"ok"`
Topic string `json:"topic"`
SentTo []SubscriptionDTO `json:"sent_to"`
}
//QueueMessage is struct of message to sqs
type QueueMessage struct {
ClientId string `json:"client_id"`
Url string `json:"url"`
AuthProvider string `json:"auth_provider,omitempty"`
AssociationId string `json:"association_id,omitempty"`
Retries int `json:"retries,omitempty"`
Callback map[string]interface{} `json:"callback,omitempty"`
Body map[string]interface{} `json:"body"`
}
//SubscriptionDTO is struct for dto the subscription
type SubscriptionDTO struct {
ClientId string `json:"client_id,omitempty"`
Events []string `json:"events,omitempty"`
Url string `json:"url,omitempty"`
AuthProvider string `json:"authProvider,omitempty"`
SubscriptionUrl string `json:"subscription_url,omitempty"`
SubscriptionId string `json:"subscription_id,omitempty"`
SubscriptionEvent string `json:"subscription_event,omitempty"`
AssociationId string `json:"association_id,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
}
//NotifierDTO is struct for dto the notify
type NotifierDTO struct {
ClientId string `json:"client_id,omitempty"`
Event string `json:"event,omitempty"`
Url string `json:"url,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
AssociationsId []string `json:"associations_id,omitempty"`
Callback map[string]interface{} `json:"callback,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
}
//CallbackCashinMessage is struct for callback message
type CallbackCashinMessage struct {
Event string `json:"event,omitempty"`
Payload map[string]interface{} `json:"payload,omitempty"`
ClientId string `json:"client_id,omitempty"`
CashinId string `json:"cashin_id,omitempty"`
DeliveredStatus string `json:"delivered_status,omitempty"`
DeliveredAt string `json:"delivered_at,omitempty"`
DeliveredUrl string `json:"delivered_url,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
StatusCode int `json:"status_code,omitempty"`
}
//CallbackCashinMessage is struct for callback message
type CallbackCashoutMessage struct {
Event string `json:"event,omitempty"`
Payload map[string]interface{} `json:"payload,omitempty"`
ClientId string `json:"client_id,omitempty"`
CashoutId string `json:"cashout_id,omitempty"`
DeliveredStatus string `json:"delivered_status,omitempty"`
DeliveredAt string `json:"delivered_at,omitempty"`
DeliveredUrl string `json:"delivered_url,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
StatusCode int `json:"status_code,omitempty"`
}
//ServiceDTO is struct for dto the service
type ServicesDTO struct {
Name string `json:"name,omitempty"`
Events []string `json:"events,omitempty"`
ServiceId string `json:"service_id,omitempty"`
ApiKey string `json:"api_key,omitempty"`
Entity string `json:"entity,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
//ServiceEventsDTO is struct for dto the service events
type ServiceEventsDTO struct {
Name string `json:"name,omitempty"`
Service string `json:"service,omitempty"`
ServiceId string `json:"service_id,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
//ClientDTO is struct for dto the clients
type ClientDTO struct {
ApiKey string `json:"api_key,omitempty"`
Identifier string `json:"identifier,omitempty"`
Service string `json:"service,omitempty"`
Scopes []string `json:"scopes,omitempty"`
AssociationId string `json:"association_id,omitempty"`
Description string `json:"description,omitempty"`
Provider string `json:"provider,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
//ScopeDTO is struct for dto the scopes
type ScopeDTO struct {
ApiKey string `json:"api_key,omitempty"`
Identifier string `json:"identifier,omitempty"`
ScopeId string `json:"scope_id,omitempty"`
Scope string `json:"scope,omitempty"`
Provider string `json:"provider,omitempty"`
Service string `json:"service,omitempty"`
AssociationId string `json:"association_id,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
//AdminObject is struct the api key of admin
type AdminObject struct {
ClientId string `json:"client_id"`
ApiKey string `json:"api_key"`
}
type ErrorMessage struct {
Source string `json:"source,omitempty"`
Input map[string]interface{} `json:"input,omitempty"`
Reason string `json:"reason"`
Output map[string]interface{} `json:"output,omitempty"`
SourceMessage *QueueMessage `json:"-"`
}
//JWTDto is struct for jwt claims
type JWTDTO struct {
Exp int `json:"exp"`
Nbf int `json:"nbf"`
Iat int `json:"iat"`
Payload JWTDTOPayload `json:"payload"`
}
type JWTDTOPayload struct {
ClientId string `json:"client_id"`
AssociationId string `json:"association_id"`
ApiKeyType string `json:"api_key_type"`
Provider string `json:"provider"`
Scopes string `json:"scopes"`
}