forked from hub4j/github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGHIssueEvent.java
More file actions
205 lines (184 loc) · 5.31 KB
/
GHIssueEvent.java
File metadata and controls
205 lines (184 loc) · 5.31 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
package org.kohsuke.github;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Date;
/**
* The type GHIssueEvent.
*
* @see <a href="https://developer.github.com/v3/issues/events/">Github documentation for issue events</a>
*
* @author Martin van Zijl
*/
public class GHIssueEvent extends GitHubInteractiveObject {
private long id;
private String node_id;
private String url;
private GHUser actor;
private String event;
private String commit_id;
private String commit_url;
private String created_at;
private GHMilestone milestone;
private GHLabel label;
private GHUser assignee;
private GHIssueRename rename;
private GHUser reviewRequester;
private GHUser requestedReviewer;
private GHIssue issue;
/**
* Gets id.
*
* @return the id
*/
public long getId() {
return id;
}
/**
* Gets node id.
*
* @return the node id
*/
public String getNodeId() {
return node_id;
}
/**
* Gets url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Gets actor.
*
* @return the actor
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHUser getActor() {
return actor;
}
/**
* Gets event.
*
* @return the event
*/
public String getEvent() {
return event;
}
/**
* Gets commit id.
*
* @return the commit id
*/
public String getCommitId() {
return commit_id;
}
/**
* Gets commit url.
*
* @return the commit url
*/
public String getCommitUrl() {
return commit_url;
}
/**
* Gets created at.
*
* @return the created at
*/
public Date getCreatedAt() {
return GitHubClient.parseDate(created_at);
}
/**
* Gets issue.
*
* @return the issue
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHIssue getIssue() {
return issue;
}
/**
* Get the {@link GHMilestone} that this issue was added to or removed from. Only present for events "milestoned"
* and "demilestoned", <code>null</code> otherwise.
*
* @return the milestone
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHMilestone getMilestone() {
return milestone;
}
/**
* Get the {@link GHLabel} that was added to or removed from the issue. Only present for events "labeled" and
* "unlabeled", <code>null</code> otherwise.
*
* @return the label
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHLabel getLabel() {
return label;
}
/**
* Get the {@link GHUser} that was assigned or unassigned from the issue. Only present for events "assigned" and
* "unassigned", <code>null</code> otherwise.
*
* @return the user
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHUser getAssignee() {
return assignee;
}
/**
* Get the {@link GHIssueRename} that contains information about issue old and new name. Only present for event
* "renamed", <code>null</code> otherwise.
*
* @return the GHIssueRename
*/
public GHIssueRename getRename() {
return this.rename;
}
/**
*
* Get the {@link GHUser} person who requested a review. Only present for events "review_requested",
* "review_request_removed", <code>null</code> otherwise.
*
* @return the GHUser
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types#review_requested">review_requested</a>
* and <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types#review_request_removed">review_request_removed</a>
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHUser getReviewRequester() {
return this.reviewRequester;
}
/**
*
* Get the {@link GHUser} person requested to review the pull request. Only present for events "review_requested",
* "review_request_removed", <code>null</code> otherwise.
*
* @return the GHUser
*
* @see <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types#review_requested">review_requested</a>
* and <a href=
* "https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types#review_request_removed">review_request_removed</a>
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHUser getRequestedReviewer() {
return this.requestedReviewer;
}
GHIssueEvent wrapUp(GHIssue parent) {
this.issue = parent;
return this;
}
@Override
public String toString() {
return String.format("Issue %d was %s by %s on %s",
getIssue().getNumber(),
getEvent(),
getActor().getLogin(),
getCreatedAt().toString());
}
}