9
9
10
10
/**
11
11
* This class implements the client side API for the GitLab Award Emoji API calls.
12
- *
12
+ *
13
13
* @see <a href="https://docs.gitlab.com/ce/api/award_emoji.html">GitLab Award Emoji API Documentaion</a>
14
14
* @since v4.8.31
15
15
*/
@@ -68,7 +68,7 @@ public List<AwardEmoji> getSnippetAwardEmojis(Object projectIdOrPath, Integer sn
68
68
}
69
69
70
70
/**
71
- * Get a list of award emoji for the specified note.
71
+ * Get a list of award emoji for the specified issue note.
72
72
*
73
73
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji</code></pre>
74
74
*
@@ -78,9 +78,26 @@ public List<AwardEmoji> getSnippetAwardEmojis(Object projectIdOrPath, Integer sn
78
78
* @return a list of AwardEmoji for the specified note
79
79
* @throws GitLabApiException if any exception occurs
80
80
*/
81
- public List <AwardEmoji > getNoteAwardEmojis (Object projectIdOrPath , Integer issueIid , Integer noteId ) throws GitLabApiException {
81
+ public List <AwardEmoji > getIssueNoteAwardEmojis (Object projectIdOrPath , Integer issueIid , Integer noteId ) throws GitLabApiException {
82
82
Response response = get (Response .Status .OK , getPageQueryParams (1 , getDefaultPerPage ()),
83
- "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" );
83
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" );
84
+ return response .readEntity (new GenericType <List <AwardEmoji >>() {});
85
+ }
86
+
87
+ /**
88
+ * Get a list of award emoji for the specified merge request note.
89
+ *
90
+ * <pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji</code></pre>
91
+ *
92
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
93
+ * @param mergeRequestIid the merge request IID of the merge request that owns the note
94
+ * @param noteId the note ID to get the award emojis for
95
+ * @return a list of AwardEmoji for the specified note
96
+ * @throws GitLabApiException if any exception occurs
97
+ */
98
+ public List <AwardEmoji > getMergeRequestNoteAwardEmojis (Object projectIdOrPath , Integer mergeRequestIid , Integer noteId ) throws GitLabApiException {
99
+ Response response = get (Response .Status .OK , getPageQueryParams (1 , getDefaultPerPage ()),
100
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "merge_requests" , mergeRequestIid , "notes" , noteId , "award_emoji" );
84
101
return response .readEntity (new GenericType <List <AwardEmoji >>() {});
85
102
}
86
103
@@ -92,7 +109,7 @@ public List<AwardEmoji> getNoteAwardEmojis(Object projectIdOrPath, Integer issue
92
109
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
93
110
* @param issueIid the issue IID to get the award emoji for
94
111
* @param awardId the ID of the award emoji to get
95
- * @return an AwardEmoji instance for the specified award emoji
112
+ * @return an AwardEmoji instance for the specified award emoji
96
113
* @throws GitLabApiException if any exception occurs
97
114
*/
98
115
public AwardEmoji getIssueAwardEmoji (Object projectIdOrPath , Integer issueIid , Integer awardId ) throws GitLabApiException {
@@ -109,7 +126,7 @@ public AwardEmoji getIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, I
109
126
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
110
127
* @param mergeRequestIid the merge request IID to get the award emoji for
111
128
* @param awardId the ID of the award emoji to get
112
- * @return an AwardEmoji instance for the specified award emoji
129
+ * @return an AwardEmoji instance for the specified award emoji
113
130
* @throws GitLabApiException if any exception occurs
114
131
*/
115
132
public AwardEmoji getMergeRequestAwardEmoji (Object projectIdOrPath , Integer mergeRequestIid , Integer awardId ) throws GitLabApiException {
@@ -126,7 +143,7 @@ public AwardEmoji getMergeRequestAwardEmoji(Object projectIdOrPath, Integer merg
126
143
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
127
144
* @param snippetId the snippet ID to get the award emoji for
128
145
* @param awardId the ID of the award emoji to get
129
- * @return an AwardEmoji instance for the specified award emoji
146
+ * @return an AwardEmoji instance for the specified award emoji
130
147
* @throws GitLabApiException if any exception occurs
131
148
*/
132
149
public AwardEmoji getSnippetAwardEmoji (Object projectIdOrPath , Integer snippetId , Integer awardId ) throws GitLabApiException {
@@ -136,20 +153,38 @@ public AwardEmoji getSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId
136
153
}
137
154
138
155
/**
139
- * Get the specified award emoji for the specified note.
156
+ * Get the specified award emoji for the specified issue note.
140
157
*
141
158
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
142
159
*
143
160
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
144
161
* @param issueIid the issue IID of the issue that owns the note
145
162
* @param noteId the note ID to get the award emoji from
146
163
* @param awardId the ID of the award emoji to get
147
- * @return an AwardEmoji instance for the specified award emoji
164
+ * @return an AwardEmoji instance for the specified award emoji
148
165
* @throws GitLabApiException if any exception occurs
149
166
*/
150
- public AwardEmoji getNoteAwardEmoji (Object projectIdOrPath , Integer issueIid , Integer noteId , Integer awardId ) throws GitLabApiException {
167
+ public AwardEmoji getIssueNoteAwardEmoji (Object projectIdOrPath , Integer issueIid , Integer noteId , Integer awardId ) throws GitLabApiException {
151
168
Response response = get (Response .Status .OK , getPageQueryParams (1 , getDefaultPerPage ()),
152
- "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" , awardId );
169
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" , awardId );
170
+ return (response .readEntity (AwardEmoji .class ));
171
+ }
172
+
173
+ /**
174
+ * Get the specified award emoji for the specified merge request note.
175
+ *
176
+ * <pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id</code></pre>
177
+ *
178
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
179
+ * @param mergeRequestIid the merge request IID of the merge request that owns the note
180
+ * @param noteId the note ID to get the award emoji from
181
+ * @param awardId the ID of the award emoji to get
182
+ * @return an AwardEmoji instance for the specified award emoji
183
+ * @throws GitLabApiException if any exception occurs
184
+ */
185
+ public AwardEmoji getMergeRequestNoteAwardEmoji (Object projectIdOrPath , Integer mergeRequestIid , Integer noteId , Integer awardId ) throws GitLabApiException {
186
+ Response response = get (Response .Status .OK , getPageQueryParams (1 , getDefaultPerPage ()),
187
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "merge_requests" , mergeRequestIid , "notes" , noteId , "award_emoji" , awardId );
153
188
return (response .readEntity (AwardEmoji .class ));
154
189
}
155
190
@@ -161,7 +196,7 @@ public AwardEmoji getNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, In
161
196
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
162
197
* @param issueIid the issue IID to add the award emoji to
163
198
* @param name the name of the award emoji to add
164
- * @return an AwardEmoji instance for the added award emoji
199
+ * @return an AwardEmoji instance for the added award emoji
165
200
* @throws GitLabApiException if any exception occurs
166
201
*/
167
202
public AwardEmoji addIssueAwardEmoji (Object projectIdOrPath , Integer issueIid , String name ) throws GitLabApiException {
@@ -179,7 +214,7 @@ public AwardEmoji addIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, S
179
214
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
180
215
* @param mergeRequestIid the merge request IID to add the award emoji to
181
216
* @param name the name of the award emoji to add
182
- * @return an AwardEmoji instance for the added award emoji
217
+ * @return an AwardEmoji instance for the added award emoji
183
218
* @throws GitLabApiException if any exception occurs
184
219
*/
185
220
public AwardEmoji addMergeRequestAwardEmoji (Object projectIdOrPath , Integer mergeRequestIid , String name ) throws GitLabApiException {
@@ -197,7 +232,7 @@ public AwardEmoji addMergeRequestAwardEmoji(Object projectIdOrPath, Integer merg
197
232
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
198
233
* @param snippetId the snippet ID to add the award emoji to
199
234
* @param name the name of the award emoji to add
200
- * @return an AwardEmoji instance for the added award emoji
235
+ * @return an AwardEmoji instance for the added award emoji
201
236
* @throws GitLabApiException if any exception occurs
202
237
*/
203
238
public AwardEmoji addSnippetAwardEmoji (Object projectIdOrPath , Integer snippetId , String name ) throws GitLabApiException {
@@ -208,21 +243,40 @@ public AwardEmoji addSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId
208
243
}
209
244
210
245
/**
211
- * Add an award emoji for the specified note.
246
+ * Add an award emoji for the specified issue note.
212
247
*
213
248
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/notes/:noteId/award_emoji</code></pre>
214
249
*
215
250
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
216
251
* @param issueIid the issue IID of the issue that owns the note
217
252
* @param noteId the note ID to add the award emoji to
218
253
* @param name the name of the award emoji to add
219
- * @return an AwardEmoji instance for the added award emoji
254
+ * @return an AwardEmoji instance for the added award emoji
220
255
* @throws GitLabApiException if any exception occurs
221
256
*/
222
- public AwardEmoji addNoteAwardEmoji (Object projectIdOrPath , Integer issueIid , Integer noteId , String name ) throws GitLabApiException {
257
+ public AwardEmoji addIssueNoteAwardEmoji (Object projectIdOrPath , Integer issueIid , Integer noteId , String name ) throws GitLabApiException {
223
258
GitLabApiForm form = new GitLabApiForm ().withParam ("name" , name , true );
224
259
Response response = post (Response .Status .CREATED , form .asMap (),
225
- "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" );
260
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" );
261
+ return (response .readEntity (AwardEmoji .class ));
262
+ }
263
+
264
+ /**
265
+ * Add an award emoji for the specified merge request note.
266
+ *
267
+ * <pre><code>GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/notes/:noteId/award_emoji</code></pre>
268
+ *
269
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
270
+ * @param mergeRequestIid the merge request IID of the merge request that owns the note
271
+ * @param noteId the note ID to add the award emoji to
272
+ * @param name the name of the award emoji to add
273
+ * @return an AwardEmoji instance for the added award emoji
274
+ * @throws GitLabApiException if any exception occurs
275
+ */
276
+ public AwardEmoji addNoteAwardEmoji (Object projectIdOrPath , Integer mergeRequestIid , Integer noteId , String name ) throws GitLabApiException {
277
+ GitLabApiForm form = new GitLabApiForm ().withParam ("name" , name , true );
278
+ Response response = post (Response .Status .CREATED , form .asMap (),
279
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "merge_requests" , mergeRequestIid , "notes" , noteId , "award_emoji" );
226
280
return (response .readEntity (AwardEmoji .class ));
227
281
}
228
282
@@ -269,10 +323,10 @@ public void deleteMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRe
269
323
public void deleteSnippetAwardEmoji (Object projectIdOrPath , Integer snippetId , Integer awardId ) throws GitLabApiException {
270
324
delete (Response .Status .NO_CONTENT , null ,
271
325
"projects" , getProjectIdOrPath (projectIdOrPath ), "snippets" , snippetId , "award_emoji" , awardId );
272
- }
326
+ }
273
327
274
328
/**
275
- * Delete an award emoji from the specified note.
329
+ * Delete an award emoji from the specified issue note.
276
330
*
277
331
* <pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
278
332
*
@@ -284,6 +338,22 @@ public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, I
284
338
*/
285
339
public void deleteNoteAwardEmoji (Object projectIdOrPath , Integer issueIid , Integer noteId , Integer awardId ) throws GitLabApiException {
286
340
delete (Response .Status .NO_CONTENT , null ,
287
- "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" , awardId );
341
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "notes" , noteId , "award_emoji" , awardId );
342
+ }
343
+
344
+ /**
345
+ * Delete an award emoji from the specified merge request note.
346
+ *
347
+ * <pre><code>GitLab Endpoint: DELETE /projects/:id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id</code></pre>
348
+ *
349
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
350
+ * @param mergeRequestIid the merge request IID of the merge request that owns the note
351
+ * @param noteId the note ID of the note to delete the award emoji from
352
+ * @param awardId the ID of the award emoji to delete
353
+ * @throws GitLabApiException if any exception occurs
354
+ */
355
+ public void deleteNoteAwardEmoji (Object projectIdOrPath , Integer mergeRequestIid , Integer noteId , Integer awardId ) throws GitLabApiException {
356
+ delete (Response .Status .NO_CONTENT , null ,
357
+ "projects" , getProjectIdOrPath (projectIdOrPath ), "merge_requests" , mergeRequestIid , "notes" , noteId , "award_emoji" , awardId );
288
358
}
289
359
}
0 commit comments