-
Notifications
You must be signed in to change notification settings - Fork 239
/
Copy pathpayload.go
510 lines (485 loc) · 14 KB
/
payload.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
package bitbucket
import "time"
// RepoPushPayload is the Bitbucket repo:push payload
type RepoPushPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
Push struct {
Changes []struct {
New struct {
Type string `json:"type"`
Name string `json:"name"`
Target struct {
Type string `json:"type"`
Hash string `json:"hash"`
Author Owner `json:"author"`
Message string `json:"message"`
Date time.Time `json:"date"`
Parents []struct {
Type string `json:"type"`
Hash string `json:"hash"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
} `json:"parents"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
} `json:"target"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
Commits struct {
Href string `json:"href"`
} `json:"commits"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
} `json:"new"`
Old struct {
Type string `json:"type"`
Name string `json:"name"`
Target struct {
Type string `json:"type"`
Hash string `json:"hash"`
Author Owner `json:"author"`
Message string `json:"message"`
Date time.Time `json:"date"`
Parents []struct {
Type string `json:"type"`
Hash string `json:"hash"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
} `json:"parents"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
} `json:"target"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
Commits struct {
Href string `json:"href"`
} `json:"commits"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
} `json:"old"`
Links struct {
HTML struct {
Href string `json:"href"`
} `json:"html"`
Diff struct {
Href string `json:"href"`
} `json:"diff"`
Commits struct {
Href string `json:"href"`
} `json:"commits"`
} `json:"links"`
Created bool `json:"created"`
Forced bool `json:"forced"`
Closed bool `json:"closed"`
Commits []struct {
Hash string `json:"hash"`
Type string `json:"type"`
Message string `json:"message"`
Author Owner `json:"author"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
} `json:"commits"`
Truncated bool `json:"truncated"`
} `json:"changes"`
} `json:"push"`
}
// RepoForkPayload is the Bitbucket repo:fork payload
type RepoForkPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
Fork Repository `json:"fork"`
}
// RepoUpdatedPayload is the Bitbucket repo:updated payload
type RepoUpdatedPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
Changes struct {
Name struct {
New string `json:"new"`
Old string `json:"old"`
} `json:"name"`
Website struct {
New string `json:"new"`
Old string `json:"old"`
} `json:"website"`
Language struct {
New string `json:"new"`
Old string `json:"old"`
} `json:"language"`
Links struct {
New struct {
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"new"`
Old struct {
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"old"`
} `json:"links"`
Description struct {
New string `json:"new"`
Old string `json:"old"`
} `json:"description"`
FullName struct {
New string `json:"new"`
Old string `json:"old"`
} `json:"full_name"`
} `json:"changes"`
}
// RepoCommitCommentCreatedPayload is the Bitbucket repo:commit_comment_created payload
type RepoCommitCommentCreatedPayload struct {
Actor Owner `json:"actor"`
Comment Comment `json:"comment"`
Repository Repository `json:"repository"`
Commit struct {
Hash string `json:"hash"`
} `json:"commit"`
}
// RepoCommitStatusCreatedPayload is the Bitbucket repo:commit_status_created payload
type RepoCommitStatusCreatedPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
CommitStatus struct {
Name string `json:"name"`
Description string `json:"description"`
State string `json:"state"`
Key string `json:"key"`
URL string `json:"url"`
Type string `json:"type"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on"`
Links struct {
Commit struct {
Href string `json:"href"`
} `json:"commit"`
Self struct {
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
} `json:"commit_status"`
}
// RepoCommitStatusUpdatedPayload is the Bitbucket repo:commit_status_updated payload
type RepoCommitStatusUpdatedPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
CommitStatus struct {
Name string `json:"name"`
Description string `json:"description"`
State string `json:"state"`
Key string `json:"key"`
URL string `json:"url"`
Type string `json:"type"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on"`
Links struct {
Commit struct {
Href string `json:"href"`
} `json:"commit"`
Self struct {
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
} `json:"commit_status"`
}
// IssueCreatedPayload is the Bitbucket issue:created payload
type IssueCreatedPayload struct {
Actor Owner `json:"actor"`
Issue Issue `json:"issue"`
Repository Repository `json:"repository"`
}
// IssueUpdatedPayload is the Bitbucket issue:updated payload
type IssueUpdatedPayload struct {
Actor Owner `json:"actor"`
Issue Issue `json:"issue"`
Repository Repository `json:"repository"`
Comment Comment `json:"comment"`
Changes struct {
Status struct {
Old string `json:"old"`
New string `json:"new"`
} `json:"status"`
} `json:"changes"`
}
// IssueCommentCreatedPayload is the Bitbucket pullrequest:created payload
type IssueCommentCreatedPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
Issue Issue `json:"issue"`
Comment Comment `json:"comment"`
}
// PullRequestCreatedPayload is the Bitbucket pullrequest:created payload
type PullRequestCreatedPayload struct {
Actor Owner `json:"actor"`
PullRequest PullRequest `json:"pullrequest"`
Repository Repository `json:"repository"`
}
// PullRequestUpdatedPayload is the Bitbucket pullrequest:updated payload
type PullRequestUpdatedPayload struct {
Actor Owner `json:"actor"`
PullRequest PullRequest `json:"pullrequest"`
Repository Repository `json:"repository"`
}
// PullRequestApprovedPayload is the Bitbucket pullrequest:approved payload
type PullRequestApprovedPayload struct {
Actor Owner `json:"actor"`
PullRequest PullRequest `json:"pullrequest"`
Repository Repository `json:"repository"`
Approval struct {
Date time.Time `json:"date"`
User Owner `json:"user"`
} `json:"approval"`
}
// PullRequestUnapprovedPayload is the Bitbucket pullrequest:unapproved payload
type PullRequestUnapprovedPayload struct {
Actor Owner `json:"actor"`
PullRequest PullRequest `json:"pullrequest"`
Repository Repository `json:"repository"`
Approval struct {
Date time.Time `json:"date"`
User Owner `json:"user"`
} `json:"approval"`
}
// PullRequestMergedPayload is the Bitbucket pullrequest:fulfilled payload
type PullRequestMergedPayload struct {
Actor Owner `json:"actor"`
PullRequest PullRequest `json:"pullrequest"`
Repository Repository `json:"repository"`
}
// PullRequestDeclinedPayload is the Bitbucket pullrequest:rejected payload
type PullRequestDeclinedPayload struct {
Actor Owner `json:"actor"`
PullRequest PullRequest `json:"pullrequest"`
Repository Repository `json:"repository"`
}
// PullRequestCommentCreatedPayload is the Bitbucket pullrequest:comment_updated payload
type PullRequestCommentCreatedPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
PullRequest PullRequest `json:"pullrequest"`
Comment Comment `json:"comment"`
}
// PullRequestCommentUpdatedPayload is the Bitbucket pullrequest:comment_created payload
type PullRequestCommentUpdatedPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
PullRequest PullRequest `json:"pullrequest"`
Comment Comment `json:"comment"`
}
// PullRequestCommentDeletedPayload is the Bitbucket pullrequest:comment_deleted payload
type PullRequestCommentDeletedPayload struct {
Actor Owner `json:"actor"`
Repository Repository `json:"repository"`
PullRequest PullRequest `json:"pullrequest"`
Comment Comment `json:"comment"`
}
// Owner is the common Bitbucket Owner Sub Entity
type Owner struct {
Type string `json:"type"`
NickName string `json:"nickname"`
DisplayName string `json:"display_name"`
AccountID string `json:"account_id"`
UUID string `json:"uuid"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
} `json:"links"`
}
// Repository is the common Bitbucket Repository Sub Entity
type Repository struct {
Type string `json:"type"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
} `json:"links"`
UUID string `json:"uuid"`
Project Project `json:"project"`
FullName string `json:"full_name"`
Name string `json:"name"`
Website string `json:"website"`
Owner Owner `json:"owner"`
Scm string `json:"scm"`
IsPrivate bool `json:"is_private"`
}
// Project is the common Bitbucket Project Sub Entity
type Project struct {
Type string `json:"type"`
Project string `json:"project"`
UUID string `json:"uuid"`
Links struct {
HTML struct {
Href string `json:"href"`
} `json:"html"`
Avatar struct {
Href string `json:"href"`
} `json:"avatar"`
} `json:"links"`
Key string `json:"key"`
}
// Issue is the common Bitbucket Issue Sub Entity
type Issue struct {
ID int64 `json:"id"`
Component string `json:"component"`
Title string `json:"title"`
Content struct {
Raw string `json:"raw"`
HTML string `json:"html"`
Markup string `json:"markup"`
} `json:"content"`
Priority string `json:"priority"`
State string `json:"state"`
Type string `json:"type"`
Milestone struct {
Name string `json:"name"`
} `json:"milestone"`
Version struct {
Name string `json:"name"`
} `json:"version"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
}
// Comment is the common Bitbucket Comment Sub Entity
type Comment struct {
ID int64 `json:"id"`
Parent struct {
ID int64 `json:"id"`
} `json:"parent"`
Content struct {
Raw string `json:"raw"`
HTML string `json:"html"`
Markup string `json:"markup"`
} `json:"content"`
Inline struct {
Path string `json:"path"`
From *int64 `json:"from"`
To int64 `json:"to"`
} `json:"inline"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
}
// PullRequest is the common Bitbucket Pull Request Sub Entity
type PullRequest struct {
ID int64 `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
State string `json:"state"`
Author Owner `json:"author"`
Source struct {
Branch struct {
Name string `json:"name"`
} `json:"branch"`
Commit struct {
Hash string `json:"hash"`
} `json:"commit"`
Repository Repository `json:"repository"`
} `json:"source"`
Destination struct {
Branch struct {
Name string `json:"name"`
} `json:"branch"`
Commit struct {
Hash string `json:"hash"`
} `json:"commit"`
Repository Repository `json:"repository"`
} `json:"destination"`
MergeCommit struct {
Hash string `json:"hash"`
} `json:"merge_commit"`
Participants []Owner `json:"participants"`
Reviewers []Owner `json:"reviewers"`
CloseSourceBranch bool `json:"close_source_branch"`
ClosedBy Owner `json:"closed_by"`
Reason string `json:"reason"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
HTML struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
}