Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
1ff23e5d
Commit
1ff23e5d
authored
Oct 05, 2021
by
didacrarbones
Browse files
Fix #767 : Adding merge request note award functions and renaming issue functions
parent
37617ec3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/AwardEmojiApi.java
View file @
1ff23e5d
...
@@ -9,7 +9,7 @@ import org.gitlab4j.api.models.AwardEmoji;
...
@@ -9,7 +9,7 @@ import org.gitlab4j.api.models.AwardEmoji;
/**
/**
* This class implements the client side API for the GitLab Award Emoji API calls.
* This class implements the client side API for the GitLab Award Emoji API calls.
*
*
* @see <a href="https://docs.gitlab.com/ce/api/award_emoji.html">GitLab Award Emoji API Documentaion</a>
* @see <a href="https://docs.gitlab.com/ce/api/award_emoji.html">GitLab Award Emoji API Documentaion</a>
* @since v4.8.31
* @since v4.8.31
*/
*/
...
@@ -68,7 +68,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -68,7 +68,7 @@ public class AwardEmojiApi extends AbstractApi {
}
}
/**
/**
* Get a list of award emoji for the specified note.
* 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>
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji</code></pre>
*
*
...
@@ -78,9 +78,26 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -78,9 +78,26 @@ public class AwardEmojiApi extends AbstractApi {
* @return a list of AwardEmoji for the specified note
* @return a list of AwardEmoji for the specified note
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
List
<
AwardEmoji
>
getNoteAwardEmojis
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
)
throws
GitLabApiException
{
public
List
<
AwardEmoji
>
get
Issue
NoteAwardEmojis
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
1
,
getDefaultPerPage
()),
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
1
,
getDefaultPerPage
()),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
);
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
);
return
response
.
readEntity
(
new
GenericType
<
List
<
AwardEmoji
>>()
{});
}
/**
* Get a list of award emoji for the specified merge request note.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_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 mergeRequestIid the merge request IID of the merge request 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
>
getMergeRequestNoteAwardEmojis
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
Integer
noteId
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
1
,
getDefaultPerPage
()),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"merge_requests"
,
mergeRequestIid
,
"notes"
,
noteId
,
"award_emoji"
);
return
response
.
readEntity
(
new
GenericType
<
List
<
AwardEmoji
>>()
{});
return
response
.
readEntity
(
new
GenericType
<
List
<
AwardEmoji
>>()
{});
}
}
...
@@ -92,7 +109,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -92,7 +109,7 @@ public class AwardEmojiApi extends AbstractApi {
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the issue IID to get the award emoji for
* @param issueIid the issue IID to get the award emoji for
* @param awardId the ID of the award emoji to get
* @param awardId the ID of the award emoji to get
* @return an AwardEmoji instance for the specified award emoji
* @return an AwardEmoji instance for the specified award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
getIssueAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
awardId
)
throws
GitLabApiException
{
public
AwardEmoji
getIssueAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
awardId
)
throws
GitLabApiException
{
...
@@ -109,7 +126,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -109,7 +126,7 @@ public class AwardEmojiApi extends AbstractApi {
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param mergeRequestIid the merge request IID to get the award emoji for
* @param mergeRequestIid the merge request IID to get the award emoji for
* @param awardId the ID of the award emoji to get
* @param awardId the ID of the award emoji to get
* @return an AwardEmoji instance for the specified award emoji
* @return an AwardEmoji instance for the specified award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
getMergeRequestAwardEmoji
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
Integer
awardId
)
throws
GitLabApiException
{
public
AwardEmoji
getMergeRequestAwardEmoji
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
Integer
awardId
)
throws
GitLabApiException
{
...
@@ -126,7 +143,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -126,7 +143,7 @@ public class AwardEmojiApi extends AbstractApi {
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param snippetId the snippet ID to get the award emoji for
* @param snippetId the snippet ID to get the award emoji for
* @param awardId the ID of the award emoji to get
* @param awardId the ID of the award emoji to get
* @return an AwardEmoji instance for the specified award emoji
* @return an AwardEmoji instance for the specified award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
getSnippetAwardEmoji
(
Object
projectIdOrPath
,
Integer
snippetId
,
Integer
awardId
)
throws
GitLabApiException
{
public
AwardEmoji
getSnippetAwardEmoji
(
Object
projectIdOrPath
,
Integer
snippetId
,
Integer
awardId
)
throws
GitLabApiException
{
...
@@ -136,7 +153,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -136,7 +153,7 @@ public class AwardEmojiApi extends AbstractApi {
}
}
/**
/**
* Get the specified award emoji for the specified note.
* 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>
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
*
*
...
@@ -144,12 +161,30 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -144,12 +161,30 @@ public class AwardEmojiApi extends AbstractApi {
* @param issueIid the issue IID of the issue that owns the note
* @param issueIid the issue IID of the issue that owns the note
* @param noteId the note ID to get the award emoji from
* @param noteId the note ID to get the award emoji from
* @param awardId the ID of the award emoji to get
* @param awardId the ID of the award emoji to get
* @return an AwardEmoji instance for the specified award emoji
* @return an AwardEmoji instance for the specified award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
getNoteAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
,
Integer
awardId
)
throws
GitLabApiException
{
public
AwardEmoji
get
Issue
NoteAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
,
Integer
awardId
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
1
,
getDefaultPerPage
()),
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
1
,
getDefaultPerPage
()),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
,
awardId
);
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
,
awardId
);
return
(
response
.
readEntity
(
AwardEmoji
.
class
));
}
/**
* Get the specified award emoji for the specified merge request note.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_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 mergeRequestIid the merge request IID of the merge request 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
*/
public
AwardEmoji
getMergeRequestNoteAwardEmoji
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
Integer
noteId
,
Integer
awardId
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
1
,
getDefaultPerPage
()),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"merge_requests"
,
mergeRequestIid
,
"notes"
,
noteId
,
"award_emoji"
,
awardId
);
return
(
response
.
readEntity
(
AwardEmoji
.
class
));
return
(
response
.
readEntity
(
AwardEmoji
.
class
));
}
}
...
@@ -161,7 +196,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -161,7 +196,7 @@ public class AwardEmojiApi extends AbstractApi {
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the issue IID to add the award emoji to
* @param issueIid the issue IID to add the award emoji to
* @param name the name of the award emoji to add
* @param name the name of the award emoji to add
* @return an AwardEmoji instance for the added award emoji
* @return an AwardEmoji instance for the added award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
addIssueAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
String
name
)
throws
GitLabApiException
{
public
AwardEmoji
addIssueAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
String
name
)
throws
GitLabApiException
{
...
@@ -179,7 +214,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -179,7 +214,7 @@ public class AwardEmojiApi extends AbstractApi {
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param mergeRequestIid the merge request IID to add the award emoji to
* @param mergeRequestIid the merge request IID to add the award emoji to
* @param name the name of the award emoji to add
* @param name the name of the award emoji to add
* @return an AwardEmoji instance for the added award emoji
* @return an AwardEmoji instance for the added award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
addMergeRequestAwardEmoji
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
String
name
)
throws
GitLabApiException
{
public
AwardEmoji
addMergeRequestAwardEmoji
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
String
name
)
throws
GitLabApiException
{
...
@@ -197,7 +232,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -197,7 +232,7 @@ public class AwardEmojiApi extends AbstractApi {
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param snippetId the snippet ID to add the award emoji to
* @param snippetId the snippet ID to add the award emoji to
* @param name the name of the award emoji to add
* @param name the name of the award emoji to add
* @return an AwardEmoji instance for the added award emoji
* @return an AwardEmoji instance for the added award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
addSnippetAwardEmoji
(
Object
projectIdOrPath
,
Integer
snippetId
,
String
name
)
throws
GitLabApiException
{
public
AwardEmoji
addSnippetAwardEmoji
(
Object
projectIdOrPath
,
Integer
snippetId
,
String
name
)
throws
GitLabApiException
{
...
@@ -208,7 +243,7 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -208,7 +243,7 @@ public class AwardEmojiApi extends AbstractApi {
}
}
/**
/**
* Add an award emoji for the specified note.
* 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>
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/notes/:noteId/award_emoji</code></pre>
*
*
...
@@ -216,13 +251,32 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -216,13 +251,32 @@ public class AwardEmojiApi extends AbstractApi {
* @param issueIid the issue IID of the issue that owns the note
* @param issueIid the issue IID of the issue that owns the note
* @param noteId the note ID to add the award emoji to
* @param noteId the note ID to add the award emoji to
* @param name the name of the award emoji to add
* @param name the name of the award emoji to add
* @return an AwardEmoji instance for the added award emoji
* @return an AwardEmoji instance for the added award emoji
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
AwardEmoji
addNoteAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
,
String
name
)
throws
GitLabApiException
{
public
AwardEmoji
add
Issue
NoteAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
,
String
name
)
throws
GitLabApiException
{
GitLabApiForm
form
=
new
GitLabApiForm
().
withParam
(
"name"
,
name
,
true
);
GitLabApiForm
form
=
new
GitLabApiForm
().
withParam
(
"name"
,
name
,
true
);
Response
response
=
post
(
Response
.
Status
.
CREATED
,
form
.
asMap
(),
Response
response
=
post
(
Response
.
Status
.
CREATED
,
form
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
);
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
);
return
(
response
.
readEntity
(
AwardEmoji
.
class
));
}
/**
* Add an award emoji for the specified merge request note.
*
* <pre><code>GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_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 mergeRequestIid the merge request IID of the merge request 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
*/
public
AwardEmoji
addNoteAwardEmoji
(
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"
);
return
(
response
.
readEntity
(
AwardEmoji
.
class
));
return
(
response
.
readEntity
(
AwardEmoji
.
class
));
}
}
...
@@ -269,10 +323,10 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -269,10 +323,10 @@ public class AwardEmojiApi extends AbstractApi {
public
void
deleteSnippetAwardEmoji
(
Object
projectIdOrPath
,
Integer
snippetId
,
Integer
awardId
)
throws
GitLabApiException
{
public
void
deleteSnippetAwardEmoji
(
Object
projectIdOrPath
,
Integer
snippetId
,
Integer
awardId
)
throws
GitLabApiException
{
delete
(
Response
.
Status
.
NO_CONTENT
,
null
,
delete
(
Response
.
Status
.
NO_CONTENT
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"snippets"
,
snippetId
,
"award_emoji"
,
awardId
);
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"snippets"
,
snippetId
,
"award_emoji"
,
awardId
);
}
}
/**
/**
* Delete an award emoji from the specified note.
* 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>
* <pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id</code></pre>
*
*
...
@@ -284,6 +338,22 @@ public class AwardEmojiApi extends AbstractApi {
...
@@ -284,6 +338,22 @@ public class AwardEmojiApi extends AbstractApi {
*/
*/
public
void
deleteNoteAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
,
Integer
awardId
)
throws
GitLabApiException
{
public
void
deleteNoteAwardEmoji
(
Object
projectIdOrPath
,
Integer
issueIid
,
Integer
noteId
,
Integer
awardId
)
throws
GitLabApiException
{
delete
(
Response
.
Status
.
NO_CONTENT
,
null
,
delete
(
Response
.
Status
.
NO_CONTENT
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
,
awardId
);
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
,
noteId
,
"award_emoji"
,
awardId
);
}
/**
* Delete an award emoji from the specified merge request note.
*
* <pre><code>GitLab Endpoint: DELETE /projects/:id/merge_requests/:merge_request_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 mergeRequestIid the merge request IID of the merge request 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
*/
public
void
deleteNoteAwardEmoji
(
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
);
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment