-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathevents_specialize.go
More file actions
210 lines (206 loc) · 6.64 KB
/
events_specialize.go
File metadata and controls
210 lines (206 loc) · 6.64 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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
package scalingo
// Do not edit, generated with 'go generate'
import (
"encoding/json"
"github.com/Scalingo/go-scalingo/v11/debug"
)
func (pev *Event) Specialize() DetailedEvent {
var e DetailedEvent
ev := *pev
switch ev.Type {
case EventNewUser:
e = &EventNewUserType{Event: ev}
case EventNewApp:
e = &EventNewAppType{Event: ev}
case EventEditApp:
e = &EventEditAppType{Event: ev}
case EventDeleteApp:
e = &EventDeleteAppType{Event: ev}
case EventRenameApp:
e = &EventRenameAppType{Event: ev}
case EventUpdateAppProject:
e = &EventUpdateAppProjectType{Event: ev}
case EventTransferApp:
e = &EventTransferAppType{Event: ev}
case EventRestart:
e = &EventRestartType{Event: ev}
case EventScale:
e = &EventScaleType{Event: ev}
case EventStopApp:
e = &EventStopAppType{Event: ev}
case EventCrash:
e = &EventCrashType{Event: ev}
case EventRepeatedCrash:
e = &EventRepeatedCrashType{Event: ev}
case EventDeployment:
e = &EventDeploymentType{Event: ev}
case EventLinkSCM:
e = &EventLinkSCMType{Event: ev}
case EventUpdateSCM:
e = &EventUpdateSCMType{Event: ev}
case EventUnlinkSCM:
e = &EventUnlinkSCMType{Event: ev}
case EventNewIntegration:
e = &EventNewIntegrationType{Event: ev}
case EventDeleteIntegration:
e = &EventDeleteIntegrationType{Event: ev}
case EventAuthorizeGithub:
e = &EventAuthorizeGithubType{Event: ev}
case EventRevokeGithub:
e = &EventRevokeGithubType{Event: ev}
case EventRun:
e = &EventRunType{Event: ev}
case EventNewDomain:
e = &EventNewDomainType{Event: ev}
case EventEditDomain:
e = &EventEditDomainType{Event: ev}
case EventDeleteDomain:
e = &EventDeleteDomainType{Event: ev}
case EventUpgradeDatabase:
e = &EventUpgradeDatabaseType{Event: ev}
case EventNewAddon:
e = &EventNewAddonType{Event: ev}
case EventUpgradeAddon:
e = &EventUpgradeAddonType{Event: ev}
case EventDeleteAddon:
e = &EventDeleteAddonType{Event: ev}
case EventResumeAddon:
e = &EventResumeAddonType{Event: ev}
case EventSuspendAddon:
e = &EventSuspendAddonType{Event: ev}
case EventDatabaseAddFeature:
e = &EventDatabaseAddFeatureType{Event: ev}
case EventDatabaseRemoveFeature:
e = &EventDatabaseRemoveFeatureType{Event: ev}
case EventDatabaseBackupFailed:
e = &EventDatabaseBackupFailedType{Event: ev}
case EventDatabaseBackupSucceeded:
e = &EventDatabaseBackupSucceededType{Event: ev}
case EventNewCollaborator:
e = &EventNewCollaboratorType{Event: ev}
case EventAcceptCollaborator:
e = &EventAcceptCollaboratorType{Event: ev}
case EventDeleteCollaborator:
e = &EventDeleteCollaboratorType{Event: ev}
case EventChangeCollaboratorRole:
e = &EventChangeCollaboratorRoleType{Event: ev}
case EventNewVariable:
e = &EventNewVariableType{Event: ev}
case EventEditVariable:
e = &EventEditVariableType{Event: ev}
case EventEditVariables:
e = &EventEditVariablesType{Event: ev}
case EventDeleteVariable:
e = &EventDeleteVariableType{Event: ev}
case EventAddCredit:
e = &EventAddCreditType{Event: ev}
case EventAddPaymentMethod:
e = &EventAddPaymentMethodType{Event: ev}
case EventAddVoucher:
e = &EventAddVoucherType{Event: ev}
case EventNewKey:
e = &EventNewKeyType{Event: ev}
case EventEditKey:
e = &EventEditKeyType{Event: ev}
case EventDeleteKey:
e = &EventDeleteKeyType{Event: ev}
case EventPaymentAttempt:
e = &EventPaymentAttemptType{Event: ev}
case EventNewAlert:
e = &EventNewAlertType{Event: ev}
case EventAlert:
e = &EventAlertType{Event: ev}
case EventDeleteAlert:
e = &EventDeleteAlertType{Event: ev}
case EventNewAutoscaler:
e = &EventNewAutoscalerType{Event: ev}
case EventEditAutoscaler:
e = &EventEditAutoscalerType{Event: ev}
case EventDeleteAutoscaler:
e = &EventDeleteAutoscalerType{Event: ev}
case EventAddonUpdated:
e = &EventAddonUpdatedType{Event: ev}
case EventStartRegionMigration:
e = &EventStartRegionMigrationType{Event: ev}
case EventNewLogDrain:
e = &EventNewLogDrainType{Event: ev}
case EventDeleteLogDrain:
e = &EventDeleteLogDrainType{Event: ev}
case EventNewAddonLogDrain:
e = &EventNewAddonLogDrainType{Event: ev}
case EventDeleteAddonLogDrain:
e = &EventDeleteAddonLogDrainType{Event: ev}
case EventNewNotifier:
e = &EventNewNotifierType{Event: ev}
case EventEditNotifier:
e = &EventEditNotifierType{Event: ev}
case EventDeleteNotifier:
e = &EventDeleteNotifierType{Event: ev}
case EventEditHDSContact:
e = &EventEditHDSContactType{Event: ev}
case EventCreateDataAccessConsent:
e = &EventCreateDataAccessConsentType{Event: ev}
case EventNewToken:
e = &EventNewTokenType{Event: ev}
case EventRegenerateToken:
e = &EventRegenerateTokenType{Event: ev}
case EventDeleteToken:
e = &EventDeleteTokenType{Event: ev}
case EventTfaEnabled:
e = &EventTfaEnabledType{Event: ev}
case EventTfaDisabled:
e = &EventTfaDisabledType{Event: ev}
case EventLoginSuccess:
e = &EventLoginSuccessType{Event: ev}
case EventLoginFailure:
e = &EventLoginFailureType{Event: ev}
case EventLoginLock:
e = &EventLoginLockType{Event: ev}
case EventLoginUnlockSuccess:
e = &EventLoginUnlockSuccessType{Event: ev}
case EventPasswordResetQuery:
e = &EventPasswordResetQueryType{Event: ev}
case EventPasswordResetSuccess:
e = &EventPasswordResetSuccessType{Event: ev}
case EventStackChanged:
e = &EventStackChangedType{Event: ev}
case EventCreateReviewApp:
e = &EventCreateReviewAppType{Event: ev}
case EventDestroyReviewApp:
e = &EventDestroyReviewAppType{Event: ev}
case EventPlanDatabaseMaintenance:
e = &EventPlanDatabaseMaintenanceType{Event: ev}
case EventStartDatabaseMaintenance:
e = &EventStartDatabaseMaintenanceType{Event: ev}
case EventCompleteDatabaseMaintenance:
e = &EventCompleteDatabaseMaintenanceType{Event: ev}
case EventLinkGithub:
e = &EventLinkGithubType{Event: ev}
case EventUnlinkGithub:
e = &EventUnlinkGithubType{Event: ev}
case EventDeleteProject:
e = &EventDeleteProjectType{Event: ev}
case EventNewProject:
e = &EventNewProjectType{Event: ev}
case EventEditProject:
e = &EventEditProjectType{Event: ev}
case EventNewProjectTransferInvitation:
e = &EventNewProjectTransferInvitationType{Event: ev}
case EventAcceptProjectTransferInvitation:
e = &EventAcceptProjectTransferInvitationType{Event: ev}
case EventAcceptProjectTransferInvitationError:
e = &EventAcceptProjectTransferInvitationErrorType{Event: ev}
case EventCancelProjectTransferInvitation:
e = &EventCancelProjectTransferInvitationType{Event: ev}
case EventDeclineProjectTransferInvitation:
e = &EventDeclineProjectTransferInvitationType{Event: ev}
default:
return pev
}
err := json.Unmarshal(pev.RawTypeData, e.TypeDataPtr())
if err != nil {
debug.Printf("error reading the data: %+v\n", err)
return pev
}
return e
}