/
GHEventPayload.java
1596 lines (1431 loc) · 47.2 KB
/
GHEventPayload.java
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
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package org.kohsuke.github;
import com.fasterxml.jackson.annotation.JsonSetter;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.io.Reader;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Base type for types used in databinding of the event payload.
*
* @see GitHub#parseEventPayload(Reader, Class) GitHub#parseEventPayload(Reader, Class)
* @see GHEventInfo#getPayload(Class) GHEventInfo#getPayload(Class)
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads">Webhook events
* and payloads</a>
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" }, justification = "JSON API")
public abstract class GHEventPayload extends GitHubInteractiveObject {
// https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads#webhook-payload-object-common-properties
// Webhook payload object common properties: action, sender, repository, organization, installation
private String action;
private GHUser sender;
private GHRepository repository;
private GHOrganization organization;
private GHAppInstallation installation;
GHEventPayload() {
}
/**
* Gets the action for the triggered event. Most but not all webhook payloads contain an action property that
* contains the specific activity that triggered the event.
*
* @return event action
*/
public String getAction() {
return action;
}
/**
* Gets the sender or {@code null} if accessed via the events API.
*
* @return the sender or {@code null} if accessed via the events API.
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHUser getSender() {
return sender;
}
/**
* Sets sender.
*
* @param sender
* the sender
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setSender(GHUser sender) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets repository.
*
* @return the repository
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHRepository getRepository() {
return repository;
}
/**
* Sets repository.
*
* @param repository
* the repository
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setRepository(GHRepository repository) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets organization.
*
* @return the organization
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHOrganization getOrganization() {
return organization;
}
/**
* Sets organization.
*
* @param organization
* the organization
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setOrganization(GHOrganization organization) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets installation
*
* @return the installation
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHAppInstallation getInstallation() {
return installation;
}
// List of events that still need to be added:
// ContentReferenceEvent
// DeployKeyEvent DownloadEvent FollowEvent ForkApplyEvent GitHubAppAuthorizationEvent GistEvent GollumEvent
// InstallationEvent InstallationRepositoriesEvent IssuesEvent LabelEvent MarketplacePurchaseEvent MemberEvent
// MembershipEvent MetaEvent MilestoneEvent OrganizationEvent OrgBlockEvent PackageEvent PageBuildEvent
// ProjectCardEvent ProjectColumnEvent ProjectEvent RepositoryDispatchEvent RepositoryImportEvent
// RepositoryVulnerabilityAlertEvent SecurityAdvisoryEvent StarEvent StatusEvent TeamEvent TeamAddEvent WatchEvent
void lateBind() {
}
/**
* A check run event has been created, rerequested, completed, or has a requested_action.
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_run">
* check_run event</a>
* @see <a href="https://docs.github.com/en/rest/reference/checks#check-runs">Check Runs</a>
*/
public static class CheckRun extends GHEventPayload {
private int number;
private GHCheckRun checkRun;
private GHRequestedAction requestedAction;
/**
* Gets number.
*
* @return the number
*/
public int getNumber() {
return number;
}
/**
* Sets Check Run object
*
* @param currentCheckRun
* the check run object
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setCheckRun(GHCheckRun currentCheckRun) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets Check Run object
*
* @return the current checkRun object
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHCheckRun getCheckRun() {
return checkRun;
}
/**
* Sets the Requested Action object
*
* @param currentRequestedAction
* the current action
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setRequestedAction(GHRequestedAction currentRequestedAction) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets the Requested Action object
*
* @return the requested action
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHRequestedAction getRequestedAction() {
return requestedAction;
}
@Override
void lateBind() {
if (checkRun == null)
throw new IllegalStateException(
"Expected check_run payload, but got something else. Maybe we've got another type of event?");
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
checkRun.wrap(repository);
} else {
checkRun.wrap(root());
}
}
}
/**
* A check suite event has been requested, rerequested or completed.
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_suite">
* check_suite event</a>
* @see <a href="https://docs.github.com/en/rest/reference/checks#check-suites">Check Suites</a>
*/
public static class CheckSuite extends GHEventPayload {
private GHCheckSuite checkSuite;
/**
* Gets the Check Suite object
*
* @return the Check Suite object
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHCheckSuite getCheckSuite() {
return checkSuite;
}
@Override
void lateBind() {
if (checkSuite == null)
throw new IllegalStateException(
"Expected check_suite payload, but got something else. Maybe we've got another type of event?");
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
checkSuite.wrap(repository);
} else {
checkSuite.wrap(root());
}
}
}
/**
* An installation has been installed, uninstalled, or its permissions have been changed.
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#installation">
* installation event</a>
* @see <a href="https://docs.github.com/en/rest/reference/apps#installations">GitHub App Installation</a>
*/
public static class Installation extends GHEventPayload {
private List<GHRepository> repositories;
/**
* Gets repositories
*
* @return the repositories
*/
public List<GHRepository> getRepositories() {
return Collections.unmodifiableList(repositories);
};
@Override
void lateBind() {
if (getInstallation() == null) {
throw new IllegalStateException(
"Expected installation payload, but got something else. Maybe we've got another type of event?");
}
super.lateBind();
if (repositories != null && !repositories.isEmpty()) {
try {
for (GHRepository singleRepo : repositories) {
// populate each repository
// the repository information provided here is so limited
// as to be unusable without populating, so we do it eagerly
singleRepo.populate();
}
} catch (IOException e) {
throw new GHException("Failed to refresh repositories", e);
}
}
}
}
/**
* A repository has been added or removed from an installation.
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories">
* installation_repositories event</a>
* @see <a href="https://docs.github.com/en/rest/reference/apps#installations">GitHub App installation</a>
*/
public static class InstallationRepositories extends GHEventPayload {
private String repositorySelection;
private List<GHRepository> repositoriesAdded;
private List<GHRepository> repositoriesRemoved;
/**
* Gets installation selection
*
* @return the installation selection
*/
public String getRepositorySelection() {
return repositorySelection;
}
/**
* Gets repositories added
*
* @return the repositories
*/
public List<GHRepository> getRepositoriesAdded() {
return Collections.unmodifiableList(repositoriesAdded);
}
/**
* Gets repositories removed
*
* @return the repositories
*/
public List<GHRepository> getRepositoriesRemoved() {
return Collections.unmodifiableList(repositoriesRemoved);
}
@Override
void lateBind() {
if (getInstallation() == null) {
throw new IllegalStateException(
"Expected installation_repositories payload, but got something else. Maybe we've got another type of event?");
}
super.lateBind();
List<GHRepository> repositories;
if ("added".equals(getAction()))
repositories = repositoriesAdded;
else // action == "removed"
repositories = repositoriesRemoved;
if (repositories != null && !repositories.isEmpty()) {
try {
for (GHRepository singleRepo : repositories) { // warp each of the repository
singleRepo.populate();
}
} catch (IOException e) {
throw new GHException("Failed to refresh repositories", e);
}
}
}
}
/**
* A pull request status has changed.
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request">
* pull_request event</a>
* @see <a href="https://docs.github.com/en/rest/reference/pulls">Pull Requests</a>
*/
@SuppressFBWarnings(value = { "NP_UNWRITTEN_FIELD" }, justification = "JSON API")
public static class PullRequest extends GHEventPayload {
private int number;
private GHPullRequest pullRequest;
private GHLabel label;
private GHPullRequestChanges changes;
/**
* Gets number.
*
* @return the number
*/
public int getNumber() {
return number;
}
/**
* Gets pull request.
*
* @return the pull request
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHPullRequest getPullRequest() {
return pullRequest;
}
/**
* Gets the added or removed label for labeled/unlabeled events.
*
* @return label the added or removed label
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHLabel getLabel() {
return label;
}
/**
* Get changes (for action="edited")
*
* @return changes
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHPullRequestChanges getChanges() {
return changes;
}
@Override
void lateBind() {
if (pullRequest == null)
throw new IllegalStateException(
"Expected pull_request payload, but got something else. Maybe we've got another type of event?");
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
pullRequest.wrapUp(repository);
}
}
}
/**
* A review was added to a pull request
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review">
* pull_request_review event</a>
* @see <a href="https://docs.github.com/en/rest/reference/pulls#reviews">Pull Request Reviews</a>
*/
public static class PullRequestReview extends GHEventPayload {
private GHPullRequestReview review;
private GHPullRequest pullRequest;
/**
* Gets review.
*
* @return the review
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHPullRequestReview getReview() {
return review;
}
/**
* Gets pull request.
*
* @return the pull request
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHPullRequest getPullRequest() {
return pullRequest;
}
@Override
void lateBind() {
if (review == null)
throw new IllegalStateException(
"Expected pull_request_review payload, but got something else. Maybe we've got another type of event?");
super.lateBind();
review.wrapUp(pullRequest);
GHRepository repository = getRepository();
if (repository != null) {
pullRequest.wrapUp(repository);
}
}
}
/**
* Wrapper for changes on issue and pull request review comments action="edited"
*
* @see GHEventPayload.IssueComment
* @see GHEventPayload.PullRequestReviewComment
*/
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "JSON API")
public static class CommentChanges {
private GHFrom body;
/**
* Gets the previous comment body.
*
* @return previous comment body (or null if not changed)
*/
public GHFrom getBody() {
return body;
}
/**
* Wrapper for changed values.
*/
public static class GHFrom {
private String from;
/**
* Previous comment value that was changed.
*
* @return previous value
*/
public String getFrom() {
return from;
}
}
}
/**
* A review comment was added to a pull request
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment">
* pull_request_review_comment event</a>
* @see <a href="https://docs.github.com/en/rest/reference/pulls#review-comments">Pull Request Review Comments</a>
*/
public static class PullRequestReviewComment extends GHEventPayload {
private GHPullRequestReviewComment comment;
private GHPullRequest pullRequest;
private CommentChanges changes;
/**
* Gets comment.
*
* @return the comment
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHPullRequestReviewComment getComment() {
return comment;
}
/**
* Get changes (for action="edited")
*
* @return changes
*/
public CommentChanges getChanges() {
return changes;
}
/**
* Gets pull request.
*
* @return the pull request
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHPullRequest getPullRequest() {
return pullRequest;
}
@Override
void lateBind() {
if (comment == null)
throw new IllegalStateException(
"Expected pull_request_review_comment payload, but got something else. Maybe we've got another type of event?");
super.lateBind();
comment.wrapUp(pullRequest);
GHRepository repository = getRepository();
if (repository != null) {
pullRequest.wrapUp(repository);
}
}
}
/**
* A Issue has been assigned, unassigned, labeled, unlabeled, opened, edited, milestoned, demilestoned, closed, or
* reopened.
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issues">
* issues events</a>
* @see <a href="https://docs.github.com/en/rest/reference/issues#comments">Issues Comments</a>
*/
public static class Issue extends GHEventPayload {
private GHIssue issue;
private GHLabel label;
private GHIssueChanges changes;
/**
* Gets issue.
*
* @return the issue
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHIssue getIssue() {
return issue;
}
/**
* Sets issue.
*
* @param issue
* the issue
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setIssue(GHIssue issue) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets the added or removed label for labeled/unlabeled events.
*
* @return label the added or removed label
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHLabel getLabel() {
return label;
}
/**
* Get changes (for action="edited")
*
* @return changes
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHIssueChanges getChanges() {
return changes;
}
@Override
void lateBind() {
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
issue.wrap(repository);
}
}
}
/**
* A comment was added to an issue
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment">
* issue_comment event</a>
* @see <a href="https://docs.github.com/en/rest/reference/issues#comments">Issue Comments</a>
*/
public static class IssueComment extends GHEventPayload {
private GHIssueComment comment;
private GHIssue issue;
private CommentChanges changes;
/**
* Gets comment.
*
* @return the comment
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHIssueComment getComment() {
return comment;
}
/**
* Get changes (for action="edited")
*
* @return changes
*/
public CommentChanges getChanges() {
return changes;
}
/**
* Sets comment.
*
* @param comment
* the comment
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setComment(GHIssueComment comment) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets issue.
*
* @return the issue
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHIssue getIssue() {
return issue;
}
/**
* Sets issue.
*
* @param issue
* the issue
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setIssue(GHIssue issue) {
throw new RuntimeException("Do not use this method.");
}
@Override
void lateBind() {
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
issue.wrap(repository);
}
comment.wrapUp(issue);
}
}
/**
* A comment was added to a commit
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment">
* commit comment</a>
* @see <a href="https://docs.github.com/en/rest/reference/repos#comments">Comments</a>
*/
public static class CommitComment extends GHEventPayload {
private GHCommitComment comment;
/**
* Gets comment.
*
* @return the comment
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHCommitComment getComment() {
return comment;
}
/**
* Sets comment.
*
* @param comment
* the comment
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setComment(GHCommitComment comment) {
throw new RuntimeException("Do not use this method.");
}
@Override
void lateBind() {
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
comment.wrap(repository);
}
}
}
/**
* A repository, branch, or tag was created
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#create">
* create event</a>
* @see <a href="https://docs.github.com/en/rest/reference/git">Git data</a>
*/
public static class Create extends GHEventPayload {
private String ref;
private String refType;
private String masterBranch;
private String description;
/**
* Gets ref.
*
* @return the ref
*/
public String getRef() {
return ref;
}
/**
* Gets ref type.
*
* @return the ref type
*/
public String getRefType() {
return refType;
}
/**
* Gets default branch.
*
* Name is an artifact of when "master" was the most common default.
*
* @return the default branch
*/
public String getMasterBranch() {
return masterBranch;
}
/**
* Gets description.
*
* @return the description
*/
public String getDescription() {
return description;
}
}
/**
* A branch, or tag was deleted
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#delete">
* delete event</a>
* @see <a href="https://docs.github.com/en/rest/reference/git">Git data</a>
*/
public static class Delete extends GHEventPayload {
private String ref;
private String refType;
/**
* Gets ref.
*
* @return the ref
*/
public String getRef() {
return ref;
}
/**
* Gets ref type.
*
* @return the ref type
*/
public String getRefType() {
return refType;
}
}
/**
* A deployment
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment">
* deployment event</a>
* @see <a href="https://docs.github.com/en/rest/reference/repos#deployments">Deployments</a>
*/
public static class Deployment extends GHEventPayload {
private GHDeployment deployment;
/**
* Gets deployment.
*
* @return the deployment
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHDeployment getDeployment() {
return deployment;
}
/**
* Sets deployment.
*
* @param deployment
* the deployment
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setDeployment(GHDeployment deployment) {
throw new RuntimeException("Do not use this method.");
}
@Override
void lateBind() {
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
deployment.wrap(repository);
}
}
}
/**
* A deployment status
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status">
* deployment_status event</a>
* @see <a href="https://docs.github.com/en/rest/reference/repos#deployments">Deployments</a>
*/
public static class DeploymentStatus extends GHEventPayload {
private GHDeploymentStatus deploymentStatus;
private GHDeployment deployment;
/**
* Gets deployment status.
*
* @return the deployment status
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHDeploymentStatus getDeploymentStatus() {
return deploymentStatus;
}
/**
* Sets deployment status.
*
* @param deploymentStatus
* the deployment status
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setDeploymentStatus(GHDeploymentStatus deploymentStatus) {
throw new RuntimeException("Do not use this method.");
}
/**
* Gets deployment.
*
* @return the deployment
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHDeployment getDeployment() {
return deployment;
}
/**
* Sets deployment.
*
* @param deployment
* the deployment
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setDeployment(GHDeployment deployment) {
throw new RuntimeException("Do not use this method.");
}
@Override
void lateBind() {
super.lateBind();
GHRepository repository = getRepository();
if (repository != null) {
deployment.wrap(repository);
deploymentStatus.lateBind(repository);
}
}
}
/**
* A user forked a repository
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#fork"> fork
* event</a>
* @see <a href="https://docs.github.com/en/rest/reference/repos#forks">Forks</a>
*/
public static class Fork extends GHEventPayload {
private GHRepository forkee;
/**
* Gets forkee.
*
* @return the forkee
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHRepository getForkee() {
return forkee;
}
/**
* Sets forkee.
*
* @param forkee
* the forkee
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
*/
@Deprecated
public void setForkee(GHRepository forkee) {
throw new RuntimeException("Do not use this method.");
}
}
/**
* A ping.
*
* <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#ping"> ping
* event</a>
*/
public static class Ping extends GHEventPayload {
}
/**
* A repository was made public.
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#public">
* public event</a>
*/
public static class Public extends GHEventPayload {
}
/**
* A commit was pushed.
*
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#push"> push
* event</a>
*/
public static class Push extends GHEventPayload {
private String head, before;
private boolean created, deleted, forced;
private String ref;