Unverified Commit 7c9c8c6f authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze
Browse files

Fix backward compatibility on AwardEmojiApi

parent 1ff23e5d
......@@ -84,6 +84,21 @@ public class AwardEmojiApi extends AbstractApi {
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
}
/**
* Get a list of award emoji for the specified issue note.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji</code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the issue IID of the issue that owns the note
* @param noteId the note ID to get the award emojis for
* @return a list of AwardEmoji for the specified note
* @throws GitLabApiException if any exception occurs
*/
public List<AwardEmoji> getNoteAwardEmojis(Object projectIdOrPath, Integer issueIid, Integer noteId) throws GitLabApiException {
return getIssueNoteAwardEmojis(projectIdOrPath, issueIid, noteId);
}
/**
* Get a list of award emoji for the specified merge request note.
*
......@@ -170,6 +185,24 @@ public class AwardEmojiApi extends AbstractApi {
return (response.readEntity(AwardEmoji.class));
}
/**
* Get the specified award emoji for the specified issue note.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the issue IID of the issue that owns the note
* @param noteId the note ID to get the award emoji from
* @param awardId the ID of the award emoji to get
* @return an AwardEmoji instance for the specified award emoji
* @throws GitLabApiException if any exception occurs
* @deprecated use {@link #getIssueNoteAwardEmoji(Object, Integer, Integer, Integer)} instead
*/
@Deprecated
public AwardEmoji getNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
return getIssueNoteAwardEmoji(projectIdOrPath, issueIid, noteId, awardId);
}
/**
* Get the specified award emoji for the specified merge request note.
*
......@@ -261,6 +294,24 @@ public class AwardEmojiApi extends AbstractApi {
return (response.readEntity(AwardEmoji.class));
}
/**
* Add an award emoji for the specified issue note.
*
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/notes/:noteId/award_emoji</code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the issue IID of the issue that owns the note
* @param noteId the note ID to add the award emoji to
* @param name the name of the award emoji to add
* @return an AwardEmoji instance for the added award emoji
* @throws GitLabApiException if any exception occurs
* @deprecated use {@link #addIssueNoteAwardEmoji(Object, Integer, Integer, String)}
*/
@Deprecated
public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, String name) throws GitLabApiException {
return addIssueNoteAwardEmoji(projectIdOrPath, issueIid, noteId, name);
}
/**
* Add an award emoji for the specified merge request note.
*
......@@ -273,7 +324,7 @@ public class AwardEmojiApi extends AbstractApi {
* @return an AwardEmoji instance for the added award emoji
* @throws GitLabApiException if any exception occurs
*/
public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, String name) throws GitLabApiException {
public AwardEmoji addMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, String name) throws GitLabApiException {
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
Response response = post(Response.Status.CREATED, form.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "notes", noteId, "award_emoji");
......@@ -336,11 +387,28 @@ public class AwardEmojiApi extends AbstractApi {
* @param awardId the ID of the award emoji to delete
* @throws GitLabApiException if any exception occurs
*/
public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
public void deleteIssueNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji", awardId);
}
/**
* Delete an award emoji from the specified issue note.
*
* <pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the issue IID that owns the note
* @param noteId the note ID of the note to delete the award emoji from
* @param awardId the ID of the award emoji to delete
* @throws GitLabApiException if any exception occurs
* @deprecated use {@link #deleteIssueNoteAwardEmoji(Object, Integer, Integer, Integer)} instead
*/
@Deprecated
public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, Integer awardId) throws GitLabApiException {
deleteIssueNoteAwardEmoji(projectIdOrPath, issueIid, noteId, awardId);
}
/**
* Delete an award emoji from the specified merge request note.
*
......@@ -352,7 +420,7 @@ public class AwardEmojiApi extends AbstractApi {
* @param awardId the ID of the award emoji to delete
* @throws GitLabApiException if any exception occurs
*/
public void deleteNoteAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, Integer awardId) throws GitLabApiException {
public void deleteMergeRequestNoteAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "notes", noteId, "award_emoji", awardId);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment