-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-defs.go
678 lines (607 loc) · 22.3 KB
/
github-defs.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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
// Copyright © 2015 Dean Karn
// Use of this source code is governed by the MIT license found with the
// source code from where this was derived:
// https://github.com/go-playground/webhooks/blob/v1/github/payload.go
package main
// WatchPayload contains the information for GitHub's watch hook event
type WatchPayload struct {
Action string `json:"action"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// TeamAddPayload contains the information for GitHub's team_add hook event
type TeamAddPayload struct {
Team Team `json:"team"`
Repository Repository `json:"repository"`
Organization Organization `json:"organization"`
Sender Sender `json:"sender"`
}
// StatusPayload contains the information for GitHub's status hook event
type StatusPayload struct {
ID int `json:"id"`
SHA string `json:"sha"`
Name string `json:"name"`
TragetURL string `json:"target_url"`
Context string `json:"context"`
Desctiption string `json:"description"`
State string `json:"state"`
Commit StatusCommit `json:"commit"`
Branches []Branch `json:"branches"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// ReleasePayload contains the information for GitHub's release hook event
type ReleasePayload struct {
Action string `json:"action"`
Release Release `json:"release"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// RepositoryPayload contains the information for GitHub's repository hook event
type RepositoryPayload struct {
Action string `json:"action"`
Repository Repository `json:"repository"`
Organization Organization `json:"organization"`
Sender Sender `json:"sender"`
}
// PushPayload contains the information for GitHub's push hook event
type PushPayload struct {
Ref string `json:"ref"`
Before string `json:"before"`
After string `json:"after"`
Created bool `json:"created"`
Deleted bool `json:"deleted"`
Forced bool `json:"forced"`
BaseRef string `json:"base_ref"`
Compare string `json:"compare"`
Commits []Commit `json:"commits"`
HeadCommit HeadCommit `json:"head_commit"`
Repository Repository `json:"repository"`
Pusher PusherPush `json:"pusher"`
Sender Sender `json:"sender"`
}
// PullRequestPayload contains the information for GitHub's pull_request hook event
type PullRequestPayload struct {
Action string `json:"action"`
Number int `json:"number"`
PullRequest PullRequest `json:"pull_request"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// PullRequestReviewCommentPayload contains the information for GitHub's pull_request_review_comment hook event
type PullRequestReviewCommentPayload struct {
Action string `json:"action"`
Comment PullRequestComment `json:"comment"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// PublicPayload contains the information for GitHub's public hook event
type PublicPayload struct {
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// PageBuildPayload contains the information for GitHub's page_build hook event
type PageBuildPayload struct {
ID int `json:"id"`
Build Build `json:"build"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// MembershipPayload contains the information for GitHub's membership hook event
type MembershipPayload struct {
Action string `json:"action"`
Scope string `json:"scope"`
Member Member `json:"member"`
Sender Sender `json:"sender"`
Team Team `json:"team"`
Organization Organization `json:"organization"`
}
// MemberPayload contains the information for GitHub's member hook event
type MemberPayload struct {
Action string `json:"action"`
Member Member `json:"member"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// IssuesPayload contains the information for GitHub's issues hook event
type IssuesPayload struct {
Action string `json:"action"`
Issue Issue `json:"issue"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// IssueCommentPayload contains the information for GitHub's issue_comment hook event
type IssueCommentPayload struct {
IssuesPayload
Comment Comment `json:"comment"`
}
// GollumPayload contains the information for GitHub's gollum hook event
type GollumPayload struct {
Pages []Page `json:"pages"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// ForkPayload contains the information for GitHub's fork hook event
type ForkPayload struct {
Forkee Forkee `json:"forkee"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// DeploymentStatusPayload contains the information for GitHub's deployment_status hook event
type DeploymentStatusPayload struct {
Deployment Deployment `json:"deployment"`
DeploymentStatus DeploymentStatus `json:"deployment_status"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// DeploymentPayload contains the information for GitHub's deployment hook
type DeploymentPayload struct {
Deployment Deployment `json:"deployment"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// CommitCommentPayload contains the information for GitHub's commit_comment hook event
type CommitCommentPayload struct {
Action string `json:"action"`
RefType string `json:"ref_type"`
Comment Comment `json:"comment"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// DeletePayload contains the information for GitHub's delete hook event
type DeletePayload struct {
Ref string `json:"ref"`
RefType string `json:"ref_type"`
PusherType string `json:"pusher_type"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// CreatePayload contains the information for GitHub's create hook event
type CreatePayload struct {
Ref string `json:"ref"`
RefType string `json:"ref_type"`
MasterBranch string `json:"master_branch"`
Description string `json:"description"`
PusherType string `json:"pusher_type"`
Repository Repository `json:"repository"`
Sender Sender `json:"sender"`
}
// Repository contais all of the GitHub repository information
type Repository struct {
ID int `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name"`
Owner Owner `json:"owner"`
Private bool `json:"private"`
HTMLURL string `json:"html_url"`
Description string `json:"description"`
Fork bool `json:"fork"`
URL string `json:"url"`
ForksURL string `json:"forks_url"`
KeysURL string `json:"keys_url"`
CollaboratorsURL string `json:"collaborators_url"`
TeamsURL string `json:"teams_url"`
HooksURL string `json:"hooks_url"`
IssueEventsURL string `json:"issue_events_url"`
EventsURL string `json:"events_url"`
AssigneesURL string `json:"assignees_url"`
BranchesURL string `json:"branches_url"`
TagsURL string `json:"tags_url"`
BlobsURL string `json:"blobs_url"`
GitTagsURL string `json:"git_tags_url"`
GitRefsURL string `json:"git_refs_url"`
TreesURL string `json:"trees_url"`
StatusesURL string `json:"statuses_url"`
LanguagesURL string `json:"languages_url"`
StargazersURL string `json:"stargazers_url"`
ContributorsURL string `json:"contributors_url"`
SubscribersURL string `json:"subscribers_url"`
SubscriptionURL string `json:"subscription_url"`
CommitsURL string `json:"commits_url"`
GitCommitsURL string `json:"git_commits_url"`
CommentsURL string `json:"comments_url"`
IssueCommentURL string `json:"issue_comment_url"`
ContentsURL string `json:"contents_url"`
CompareURL string `json:"compare_url"`
MergesURL string `json:"merges_url"`
ArchiveURL string `json:"archive_url"`
DownloadsURL string `json:"downloads_url"`
IssuesURL string `json:"issues_url"`
PullsURL string `json:"pulls_url"`
MilestonesURL string `json:"milestones_url"`
NotificationsURL string `json:"notifications_url"`
LabelsURL string `json:"labels_url"`
ReleasesURL string `json:"releases_url"`
GitURL string `json:"git_url"`
SSHURL string `json:"ssh_url"`
CloneURL string `json:"clone_url"`
SVNURL string `json:"svn_url"`
Homepage string `json:"homepage"`
Size int `json:"size"`
StargazersCount int `json:"stargazers_count"`
WatchersCount int `json:"watchers_count"`
Language string `json:"language"`
HasIssues bool `json:"has_issues"`
HasDownloads bool `json:"has_downloads"`
HasWiki bool `json:"has_wiki"`
HasPages bool `json:"has_pages"`
ForksCount int `json:"forks_count"`
MirrorURL string `json:"mirror_url"`
OpenIssuesCount int `json:"open_issues_count"`
Forks int `json:"forks"`
OpenIssues int `json:"open_issues"`
Watchers int `json:"watchers"`
DefaultBranch string `json:"default_branch"`
}
// // Repo contains GitHub's repo information
// type Repo struct {
// Repository
// }
// User contains GitHub's user information
type User struct {
Login string `json:"login"`
ID int `json:"id"`
AvatarURL string `json:"avatar_url"`
GravatarID string `json:"gravatar_id"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
FollowersURL string `json:"followers_url"`
FollowingURL string `json:"following_url"`
GistsURL string `json:"gists_url"`
StarredURL string `json:"starred_url"`
SubscriptionsURL string `json:"subscriptions_url"`
OrganizationsURL string `json:"organizations_url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
ReceivedEventsURL string `json:"received_events_url"`
Type string `json:"type"`
SiteAdmin bool `json:"site_admin"`
}
// Member contains GitHub's member information
type Member struct {
User
}
// Owner contains GitHub's owner information
type Owner struct {
User
}
// Sender contains GitHub's sender information
type Sender struct {
User
}
// Creator contains GitHub's creator information
type Creator struct {
User
}
// Pusher contains GitHub's pusher information
type Pusher struct {
User
}
// Author contains GitHub's author information
type Author struct {
User
}
// Commiter contains GitHub's commiter information
type Commiter struct {
User
}
// Comment contains GitHub's comment information
type Comment struct {
URL string `json:"url"`
HTMLURL string `json:"html_url"`
ID int `json:"id"`
User User `json:"user"`
Position int `json:"position"`
Line int `json:"line"`
Path string `json:"path"`
CommitID string `json:"commit_id"`
Body string `json:"body"`
}
// Deployment contains GitHub's deployment information
type Deployment struct {
URL string `json:"url"`
ID int `json:"id"`
SHA string `json:"sha"`
Ref string `json:"ref"`
Task string `json:"task"`
//paylod
Environment string `json:"environment"`
Description string `json:"description"`
Creator Creator `json:"creator"`
StatusesURL string `json:"statuses_url"`
RepositoryURL string `json:"repository_url"`
}
// DeploymentStatus contains GitHub's deployment_status information
type DeploymentStatus struct {
URL string `json:"url"`
ID int `json:"id"`
State string `json:"state"`
Creator Creator `json:"creator"`
Description string `json:"description"`
TargetURL string `json:"target_url"`
DeploymentURL string `json:"deployment_url"`
RepositoryURL string `json:"repository_url"`
}
// Forkee contains GitHub's forkee information
type Forkee struct {
Repository
Public bool `json:"public"`
}
// Page contains GitHub's page information
type Page struct {
PageName string `json:"page_name"`
Title string `json:"title"`
Summary string `json:"summary"`
Action string `json:"action"`
SHA string `json:"sha"`
HTMLURL string `json:"html_url"`
}
// Label contains GitHub's label information
type Label struct {
URL string `json:"url"`
Name string `json:"name"`
Color string `json:"color"`
}
// Issue contains GitHub's issue information
type Issue struct {
URL string `json:"url"`
LabelsURL string `json:"labels_url"`
CommentsURL string `json:"comments_url"`
EventsURL string `json:"events_url"`
HTMLURL string `json:"html_url"`
ID int `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
User User `json:"user"`
Labels []Label `json:"labels"`
State string `json:"state"`
Locked bool `json:"locked"`
Assignee string `json:"assignee"`
Milestone string `json:"milestone"`
Comments int `json:"comments"`
Body string `json:"body"`
}
// Team contains GitHub's team information
type Team struct {
Name string `json:"name"`
ID int `json:"id"`
Slug string `json:"slug"`
Permission string `json:"permission"`
URL string `json:"url"`
MembersURL string `json:"members_url"`
RepositoriesURL string `json:"repositories_url"`
}
// Organization contains GitHub's organization information
type Organization struct {
Login string `json:"login"`
ID int `json:"id"`
URL string `json:"url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
MembersURL string `json:"members_url"`
PublicMembersURL string `json:"public_members_url"`
AvatarURL string `json:"avatar_url"`
}
// Error contains GitHub's error information
type Error struct {
Message string `json:"message"`
}
// Build contains GitHub's build information
type Build struct {
URL string `json:"url"`
Status string `json:"status"`
Error Error `json:"error"`
Pusher Pusher `json:"pusher"`
Commit string `json:"commit"`
Duration int `json:"duration"`
}
// PullRequestHREF contains GitHub's pull_request href information
type PullRequestHREF struct {
HREF string `json:"href"`
}
// HTML contains GitHub's html information
type HTML struct {
HREF string `json:"href"`
}
// Self contains GitHub's self information
type Self struct {
HREF string `json:"href"`
}
// Links contains GitHub's link information
type Links struct {
Self Self `json:"self"`
HTML HTML `json:"html"`
PullRequest PullRequestHREF `json:"pull_request"`
}
// PullRequestComment contains GitHub's pull request comment information
type PullRequestComment struct {
URL string `json:"url"`
ID int `json:"id"`
DiffHunk string `json:"diff_hunk"`
Path string `json:"path"`
Position int `json:"position"`
OriginalPosition int `json:"original_position"`
CommitID string `json:"commit_id"`
OriginalCommitID string `json:"original_commit_id"`
User User `json:"user"`
Body string `json:"body"`
HTMLURL string `json:"html_url"`
PullRequestURL string `json:"pull_request_url"`
Links Links `json:"links"`
}
// Head contains GitHub's head information
type Head struct {
Label string `json:"label"`
Ref string `json:"ref"`
SHA string `json:"sha"`
User User `json:"user"`
Repo Repository `json:"repo"`
}
// Base contains GitHub's base information
type Base struct {
Head
}
// IssueHREF contains GitHub's issue href information
type IssueHREF struct {
HREF string `json:"href"`
}
// CommentsHREF contains GitHub's comments href information
type CommentsHREF struct {
HREF string `json:"href"`
}
// ReviewCommentsHREF contains GitHub's review comments href information
type ReviewCommentsHREF struct {
HREF string `json:"href"`
}
// ReviewCommentHREF contains GitHub's review comment href information
type ReviewCommentHREF struct {
HREF string `json:"href"`
}
// CommitsHREF contains GitHub's commits href information
type CommitsHREF struct {
HREF string `json:"href"`
}
// StatusesHREF contains GitHub's statuses href information
type StatusesHREF struct {
HREF string `json:"href"`
}
// LinksPullRequest contains GitHub's pull request link information
type LinksPullRequest struct {
Self Self `json:"self"`
HTML HTML `json:"html"`
Issue IssueHREF `json:"issue"`
Comments CommentsHREF `json:"comments"`
ReviewComments ReviewCommentsHREF `json:"review_comments"`
ReviewComment ReviewCommentHREF `json:"review_comment"`
Commits CommitsHREF `json:"commits"`
Statuses StatusesHREF `json:"statuses"`
}
// PullRequest contains GitHub's pull_request information
type PullRequest struct {
URL string `json:"url"`
ID int `json:"id"`
HTMLURL string `json:"html_url"`
DiffURL string `json:"diff_url"`
PatchURL string `json:"patch_url"`
IssueURL string `json:"issue_url"`
Number int `json:"number"`
State string `json:"state"`
Locked bool `json:"locked"`
Title string `json:"title"`
User User `json:"user"`
Body string `json:"body"`
MergeCommitSHA string `json:"merge_commit_sha"`
Assignee string `json:"assignee"`
Milestone string `json:"milestone"`
CommitsURL string `json:"commits_url"`
ReviewCommentsURL string `json:"review_comments_url"`
ReviewCommentURL string `json:"review_comment_url"`
CommentsURL string `json:"comments_url"`
StatusesURL string `json:"statuses_url"`
Head Head `json:"head"`
Base Base `json:"base"`
Links LinksPullRequest `json:"_links"`
Merged bool `json:"merged"`
Mergable bool `json:"mergeable"`
MergableState string `json:"mergeable_state"`
MergedBy string `json:"merged_by"`
Comments int `json:"comments"`
ReviewComments int `json:"review_comments"`
Commits int `json:"commits"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
ChangedFiles int `json:"changed_files"`
}
// PusherPush contains GitHub's push pusher information
type PusherPush struct {
Name string `json:"name"`
Email string `json:"email"`
}
// CommitAuthor contains GitHub's commit author information
type CommitAuthor struct {
Name string `json:"name"`
Email string `json:"email"`
Username string `json:"username"`
}
// CommitCommitter contains GitHub's commit commiter information
type CommitCommitter struct {
CommitAuthor
}
// Commit contains GitHub's commit information
type Commit struct {
ID string `json:"id"`
Distinct bool `json:"distinct"`
Message string `json:"message"`
URL string `json:"url"`
Author CommitAuthor `json:"author"`
Committer CommitCommitter `json:"committer"`
Added []string `json:"added"`
Removed []string `json:"removed"`
Modified []string `json:"modified"`
}
// HeadCommit contains GitHub's head_commit information
type HeadCommit struct {
Commit
}
// Release contains GitHub's release information
type Release struct {
URL string `json:"url"`
AssetsURL string `json:"assets_url"`
UploadURL string `json:"upload_url"`
HTMLURL string `json:"html_url"`
ID int `json:"id"`
TagName string `json:"tag_name"`
TargetCommitish string `json:"target_commitish"`
Name string `json:"name"`
Draft bool `json:"draft"`
Author Author `json:"author"`
Prelelease bool `json:"prerelease"`
Assets []string `json:"assets"`
TarballURL string `json:"tarball_url"`
ZipballURL string `json:"zipball_url"`
Body string `json:"body"`
}
// BranchCommit contains GitHub's branch commit information
type BranchCommit struct {
SHA string `json:"sha"`
URL string `json:"url"`
}
// Branch contains GitHub's branch information
type Branch struct {
Name string `json:"name"`
Commit BranchCommit `json:"commit"`
}
// StatusCommitAuthor contains GitHub's status commit author information
type StatusCommitAuthor struct {
Name string `json:"name"`
Email string `json:"email"`
}
// StatusCommitCommiter contains GitHub's status commit committer information
type StatusCommitCommiter struct {
Name string `json:"name"`
Email string `json:"email"`
}
// Tree contains GitHub's tree information
type Tree struct {
BranchCommit
}
// StatusCommitInner contains GitHub's inner status commit information
type StatusCommitInner struct {
Author StatusCommitAuthor `json:"author"`
Commiter StatusCommitCommiter `jsons:"committer"`
Message string `json:"message"`
Tree Tree `json:"tree"`
URL string `json:"url"`
CommentCount int `json:"comment_count"`
}
// StatusCommit contains GitHub's status commit information
type StatusCommit struct {
SHA string `json:"sha"`
Commit StatusCommitInner `json:"commit"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
CommentsURL string `json:"comments_url"`
Author Author `json:"author"`
Committer Commiter `json:"committer"`
Parents []string `json:"parents"`
}