1111
1212import org .gitlab4j .api .models .Epic ;
1313import org .gitlab4j .api .models .EpicIssue ;
14+ import org .gitlab4j .api .models .EpicIssueLink ;
1415
1516/**
1617 * This class implements the client side API for the GitLab Epics and Epic Issues API calls.
@@ -347,10 +348,10 @@ public void deleteEpic(Object groupIdOrPath, Long epicIid) throws GitLabApiExcep
347348 *
348349 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
349350 * @param epicIid the IID of the epic to get issues for
350- * @return a list of all epic issues belonging to the specified epic
351+ * @return a list of all issues belonging to the specified epic
351352 * @throws GitLabApiException if any exception occurs
352353 */
353- public List <Epic > getEpicIssues (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
354+ public List <EpicIssue > getEpicIssues (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
354355 return (getEpicIssues (groupIdOrPath , epicIid , getDefaultPerPage ()).all ());
355356 }
356357
@@ -364,12 +365,12 @@ public List<Epic> getEpicIssues(Object groupIdOrPath, Long epicIid) throws GitLa
364365 * @param epicIid the IID of the epic to get issues for
365366 * @param page the page to get
366367 * @param perPage the number of issues per page
367- * @return a list of all epic issues belonging to the specified epic in the specified range
368+ * @return a list of all issues belonging to the specified epic in the specified range
368369 * @throws GitLabApiException if any exception occurs
369370 */
370- public List <Epic > getEpicIssues (Object groupIdOrPath , Long epicIid , int page , int perPage ) throws GitLabApiException {
371+ public List <EpicIssue > getEpicIssues (Object groupIdOrPath , Long epicIid , int page , int perPage ) throws GitLabApiException {
371372 Response response = get (Response .Status .OK , getPageQueryParams (page , perPage ), "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" );
372- return (response .readEntity (new GenericType <List <Epic >>() { }));
373+ return (response .readEntity (new GenericType <List <EpicIssue >>() { }));
373374 }
374375
375376 /**
@@ -380,11 +381,11 @@ public List<Epic> getEpicIssues(Object groupIdOrPath, Long epicIid, int page, in
380381 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
381382 * @param epicIid the IID of the epic to get issues for
382383 * @param itemsPerPage the number of issues per page
383- * @return the Pager of all epic issues belonging to the specified epic
384+ * @return the Pager of all issues belonging to the specified epic
384385 * @throws GitLabApiException if any exception occurs
385386 */
386- public Pager <Epic > getEpicIssues (Object groupIdOrPath , Long epicIid , int itemsPerPage ) throws GitLabApiException {
387- return (new Pager <Epic >(this , Epic .class , itemsPerPage , null , "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" ));
387+ public Pager <EpicIssue > getEpicIssues (Object groupIdOrPath , Long epicIid , int itemsPerPage ) throws GitLabApiException {
388+ return (new Pager <EpicIssue >(this , EpicIssue .class , itemsPerPage , null , "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" ));
388389 }
389390
390391 /**
@@ -394,10 +395,10 @@ public Pager<Epic> getEpicIssues(Object groupIdOrPath, Long epicIid, int itemsPe
394395 *
395396 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
396397 * @param epicIid the IID of the epic to get issues for
397- * @return a Stream of all epic issues belonging to the specified epic
398+ * @return a Stream of all issues belonging to the specified epic
398399 * @throws GitLabApiException if any exception occurs
399400 */
400- public Stream <Epic > getEpicIssuesStream (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
401+ public Stream <EpicIssue > getEpicIssuesStream (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
401402 return (getEpicIssues (groupIdOrPath , epicIid , getDefaultPerPage ()).stream ());
402403 }
403404
@@ -409,52 +410,52 @@ public Stream<Epic> getEpicIssuesStream(Object groupIdOrPath, Long epicIid) thro
409410 *
410411 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
411412 * @param epicIid the Epic IID to assign the issue to
412- * @param issueIid the issue IID of the issue to assign to the epic
413+ * @param issueId the issue ID of the issue to assign to the epic
413414 * @return an EpicIssue instance containing info on the newly assigned epic issue
414415 * @throws GitLabApiException if any exception occurs
415416 */
416- public EpicIssue assignIssue (Object groupIdOrPath , Long epicIid , Long issueIid ) throws GitLabApiException {
417+ public EpicIssue assignIssue (Object groupIdOrPath , Long epicIid , Long issueId ) throws GitLabApiException {
417418 Response response = post (Response .Status .CREATED , (Form )null ,
418- "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , issueIid );
419+ "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , issueId );
419420 return (response .readEntity (EpicIssue .class ));
420421 }
421422
422423 /**
423424 * Remove an epic - issue association.
424425 *
425- * <pre><code>GitLab Endpoint: DELETE /groups/:id/epics/:epic_iid/issues/:issue_id </code></pre>
426+ * <pre><code>GitLab Endpoint: DELETE /groups/:id/epics/:epic_iid/issues/:epic_issue_id </code></pre>
426427 *
427428 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
428429 * @param epicIid the Epic IID to remove the issue from
429- * @param issueIid the issue IID of the issue to remove from the epic
430- * @return an EpicIssue instance containing info on the removed issue
430+ * @param epicIssueId the ID of the " issue - epic" association of the issue to remove from the epic
431+ * @return an EpicIssueLink instance containing info on the removed issue
431432 * @throws GitLabApiException if any exception occurs
432433 */
433- public EpicIssue removeIssue (Object groupIdOrPath , Long epicIid , Long issueIid ) throws GitLabApiException {
434+ public EpicIssueLink removeIssue (Object groupIdOrPath , Long epicIid , Long epicIssueId ) throws GitLabApiException {
434435 Response response = delete (Response .Status .OK , null ,
435- "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , issueIid );
436- return (response .readEntity (EpicIssue .class ));
436+ "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , epicIssueId );
437+ return (response .readEntity (EpicIssueLink .class ));
437438 }
438439
439440 /**
440441 * Updates an epic - issue association.
441442 *
442- * <pre><code>GitLab Endpoint: PUT /groups/:id/epics/:epic_iid/issues/:issue_id </code></pre>
443+ * <pre><code>GitLab Endpoint: PUT /groups/:id/epics/:epic_iid/issues/:epic_issue_id </code></pre>
443444 *
444445 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
445446 * @param epicIid the Epic IID that the issue is assigned to
446- * @param issueIid the issue IID to update
447- * @param moveBeforeId the ID of the issue - epic association that should be placed before the link in the question (optional)
448- * @param moveAfterId the ID of the issue - epic association that should be placed after the link in the question (optional)
449- * @return an EpicIssue instance containing info on the newly assigned epic issue
447+ * @param epicIssueId the ID of the " issue - epic" association
448+ * @param moveBeforeId the ID of the " issue - epic" association that should be placed before the link in the question (optional)
449+ * @param moveAfterId the ID of the " issue - epic" association that should be placed after the link in the question (optional)
450+ * @return a list of all issues belonging to the specified epic
450451 * @throws GitLabApiException if any exception occurs
451452 */
452- public EpicIssue updateIssue (Object groupIdOrPath , Long epicIid , Long issueIid , Long moveBeforeId , Long moveAfterId ) throws GitLabApiException {
453+ public List < EpicIssue > updateIssue (Object groupIdOrPath , Long epicIid , Long epicIssueId , Long moveBeforeId , Long moveAfterId ) throws GitLabApiException {
453454 GitLabApiForm form = new GitLabApiForm ()
454455 .withParam ("move_before_id" , moveBeforeId )
455456 .withParam ("move_after_id" , moveAfterId );
456- Response response = post (Response .Status .OK , form ,
457- "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , issueIid );
458- return ( response .readEntity (EpicIssue . class ) );
457+ Response response = put (Response .Status .OK , form ,
458+ "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , epicIssueId );
459+ return response .readEntity (new GenericType < List < EpicIssue >>() {} );
459460 }
460461}
0 commit comments