Skip to content

Commit 7c9c8c6

Browse files
committed
Fix backward compatibility on AwardEmojiApi
1 parent 1ff23e5 commit 7c9c8c6

File tree

1 file changed

+71
-3
lines changed

1 file changed

+71
-3
lines changed

src/main/java/org/gitlab4j/api/AwardEmojiApi.java

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@ public List<AwardEmoji> getIssueNoteAwardEmojis(Object projectIdOrPath, Integer
8484
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
8585
}
8686

87+
/**
88+
* Get a list of award emoji for the specified issue note.
89+
*
90+
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_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 issueIid the issue IID of the issue 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> getNoteAwardEmojis(Object projectIdOrPath, Integer issueIid, Integer noteId) throws GitLabApiException {
99+
return getIssueNoteAwardEmojis(projectIdOrPath, issueIid, noteId);
100+
}
101+
87102
/**
88103
* Get a list of award emoji for the specified merge request note.
89104
*
@@ -170,6 +185,24 @@ public AwardEmoji getIssueNoteAwardEmoji(Object projectIdOrPath, Integer issueIi
170185
return (response.readEntity(AwardEmoji.class));
171186
}
172187

188+
/**
189+
* Get the specified award emoji for the specified issue note.
190+
*
191+
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
192+
*
193+
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
194+
* @param issueIid the issue IID of the issue that owns the note
195+
* @param noteId the note ID to get the award emoji from
196+
* @param awardId the ID of the award emoji to get
197+
* @return an AwardEmoji instance for the specified award emoji
198+
* @throws GitLabApiException if any exception occurs
199+
* @deprecated use {@link #getIssueNoteAwardEmoji(Object, Integer, Integer, Integer)} instead
200+
*/
201+
@Deprecated
202+
public AwardEmoji getNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
203+
return getIssueNoteAwardEmoji(projectIdOrPath, issueIid, noteId, awardId);
204+
}
205+
173206
/**
174207
* Get the specified award emoji for the specified merge request note.
175208
*
@@ -261,6 +294,24 @@ public AwardEmoji addIssueNoteAwardEmoji(Object projectIdOrPath, Integer issueIi
261294
return (response.readEntity(AwardEmoji.class));
262295
}
263296

297+
/**
298+
* Add an award emoji for the specified issue note.
299+
*
300+
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/notes/:noteId/award_emoji</code></pre>
301+
*
302+
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
303+
* @param issueIid the issue IID of the issue that owns the note
304+
* @param noteId the note ID to add the award emoji to
305+
* @param name the name of the award emoji to add
306+
* @return an AwardEmoji instance for the added award emoji
307+
* @throws GitLabApiException if any exception occurs
308+
* @deprecated use {@link #addIssueNoteAwardEmoji(Object, Integer, Integer, String)}
309+
*/
310+
@Deprecated
311+
public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, String name) throws GitLabApiException {
312+
return addIssueNoteAwardEmoji(projectIdOrPath, issueIid, noteId, name);
313+
}
314+
264315
/**
265316
* Add an award emoji for the specified merge request note.
266317
*
@@ -273,7 +324,7 @@ public AwardEmoji addIssueNoteAwardEmoji(Object projectIdOrPath, Integer issueIi
273324
* @return an AwardEmoji instance for the added award emoji
274325
* @throws GitLabApiException if any exception occurs
275326
*/
276-
public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, String name) throws GitLabApiException {
327+
public AwardEmoji addMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, String name) throws GitLabApiException {
277328
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
278329
Response response = post(Response.Status.CREATED, form.asMap(),
279330
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "notes", noteId, "award_emoji");
@@ -336,11 +387,28 @@ public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, I
336387
* @param awardId the ID of the award emoji to delete
337388
* @throws GitLabApiException if any exception occurs
338389
*/
339-
public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
390+
public void deleteIssueNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
340391
delete(Response.Status.NO_CONTENT, null,
341392
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji", awardId);
342393
}
343394

395+
/**
396+
* Delete an award emoji from the specified issue note.
397+
*
398+
* <pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
399+
*
400+
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
401+
* @param issueIid the issue IID that owns the note
402+
* @param noteId the note ID of the note to delete the award emoji from
403+
* @param awardId the ID of the award emoji to delete
404+
* @throws GitLabApiException if any exception occurs
405+
* @deprecated use {@link #deleteIssueNoteAwardEmoji(Object, Integer, Integer, Integer)} instead
406+
*/
407+
@Deprecated
408+
public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
409+
deleteIssueNoteAwardEmoji(projectIdOrPath, issueIid, noteId, awardId);
410+
}
411+
344412
/**
345413
* Delete an award emoji from the specified merge request note.
346414
*
@@ -352,7 +420,7 @@ public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integ
352420
* @param awardId the ID of the award emoji to delete
353421
* @throws GitLabApiException if any exception occurs
354422
*/
355-
public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, Integer awardId) throws GitLabApiException {
423+
public void deleteMergeRequestNoteAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, Integer awardId) throws GitLabApiException {
356424
delete(Response.Status.NO_CONTENT, null,
357425
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "notes", noteId, "award_emoji", awardId);
358426
}

0 commit comments

Comments
 (0)