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
133e6e17
Commit
133e6e17
authored
Aug 20, 2017
by
Greg Messner
Browse files
Added methods to get and delete a single project issue.
parent
67043cce
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
133e6e17
...
@@ -1236,4 +1236,33 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -1236,4 +1236,33 @@ public class ProjectApi extends AbstractApi implements Constants {
public
Pager
<
Issue
>
getIssues
(
Integer
projectId
,
int
itemsPerPage
)
throws
GitLabApiException
{
public
Pager
<
Issue
>
getIssues
(
Integer
projectId
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Issue
>(
this
,
Issue
.
class
,
itemsPerPage
,
null
,
"projects"
,
projectId
,
"issues"
));
return
(
new
Pager
<
Issue
>(
this
,
Issue
.
class
,
itemsPerPage
,
null
,
"projects"
,
projectId
,
"issues"
));
}
}
/**
* Get a single project issues.
*
* GET /projects/:id/issues/:issue_iid
*
* @param projectId the project ID to get the issue for
* @param issueId the internal ID of a project's issue
* @return the specified Issue instance
* @throws GitLabApiException if any exception occurs
*/
public
Issue
getIssue
(
Integer
projectId
,
Integer
issueId
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
projectId
,
"issues"
,
issueId
);
return
(
response
.
readEntity
(
Issue
.
class
));
}
/**
* Delete a project issue.
*
* DELETE /projects/:id/issues/:issue_iid
*
* @param projectId the project ID to delete the issue from
* @param issueId the internal ID of a project's issue
* @throws GitLabApiException if any exception occurs
*/
public
void
deleteIssue
(
Integer
projectId
,
Integer
issueId
)
throws
GitLabApiException
{
Response
.
Status
expectedStatus
=
(
isApiVersion
(
ApiVersion
.
V3
)
?
Response
.
Status
.
OK
:
Response
.
Status
.
NO_CONTENT
);
delete
(
expectedStatus
,
getDefaultPerPageParam
(),
"projects"
,
projectId
,
"issues"
,
issueId
);
}
}
}
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