11
11
12
12
import org .gitlab4j .api .models .Epic ;
13
13
import org .gitlab4j .api .models .EpicIssue ;
14
+ import org .gitlab4j .api .models .EpicIssueLink ;
14
15
15
16
/**
16
17
* 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
347
348
*
348
349
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
349
350
* @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
351
352
* @throws GitLabApiException if any exception occurs
352
353
*/
353
- public List <Epic > getEpicIssues (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
354
+ public List <EpicIssue > getEpicIssues (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
354
355
return (getEpicIssues (groupIdOrPath , epicIid , getDefaultPerPage ()).all ());
355
356
}
356
357
@@ -364,12 +365,12 @@ public List<Epic> getEpicIssues(Object groupIdOrPath, Long epicIid) throws GitLa
364
365
* @param epicIid the IID of the epic to get issues for
365
366
* @param page the page to get
366
367
* @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
368
369
* @throws GitLabApiException if any exception occurs
369
370
*/
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 {
371
372
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 >>() { }));
373
374
}
374
375
375
376
/**
@@ -380,11 +381,11 @@ public List<Epic> getEpicIssues(Object groupIdOrPath, Long epicIid, int page, in
380
381
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
381
382
* @param epicIid the IID of the epic to get issues for
382
383
* @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
384
385
* @throws GitLabApiException if any exception occurs
385
386
*/
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" ));
388
389
}
389
390
390
391
/**
@@ -394,10 +395,10 @@ public Pager<Epic> getEpicIssues(Object groupIdOrPath, Long epicIid, int itemsPe
394
395
*
395
396
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
396
397
* @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
398
399
* @throws GitLabApiException if any exception occurs
399
400
*/
400
- public Stream <Epic > getEpicIssuesStream (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
401
+ public Stream <EpicIssue > getEpicIssuesStream (Object groupIdOrPath , Long epicIid ) throws GitLabApiException {
401
402
return (getEpicIssues (groupIdOrPath , epicIid , getDefaultPerPage ()).stream ());
402
403
}
403
404
@@ -409,52 +410,52 @@ public Stream<Epic> getEpicIssuesStream(Object groupIdOrPath, Long epicIid) thro
409
410
*
410
411
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
411
412
* @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
413
414
* @return an EpicIssue instance containing info on the newly assigned epic issue
414
415
* @throws GitLabApiException if any exception occurs
415
416
*/
416
- public EpicIssue assignIssue (Object groupIdOrPath , Long epicIid , Long issueIid ) throws GitLabApiException {
417
+ public EpicIssue assignIssue (Object groupIdOrPath , Long epicIid , Long issueId ) throws GitLabApiException {
417
418
Response response = post (Response .Status .CREATED , (Form )null ,
418
- "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , issueIid );
419
+ "groups" , getGroupIdOrPath (groupIdOrPath ), "epics" , epicIid , "issues" , issueId );
419
420
return (response .readEntity (EpicIssue .class ));
420
421
}
421
422
422
423
/**
423
424
* Remove an epic - issue association.
424
425
*
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>
426
427
*
427
428
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
428
429
* @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
431
432
* @throws GitLabApiException if any exception occurs
432
433
*/
433
- public EpicIssue removeIssue (Object groupIdOrPath , Long epicIid , Long issueIid ) throws GitLabApiException {
434
+ public EpicIssueLink removeIssue (Object groupIdOrPath , Long epicIid , Long epicIssueId ) throws GitLabApiException {
434
435
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 ));
437
438
}
438
439
439
440
/**
440
441
* Updates an epic - issue association.
441
442
*
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>
443
444
*
444
445
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
445
446
* @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
450
451
* @throws GitLabApiException if any exception occurs
451
452
*/
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 {
453
454
GitLabApiForm form = new GitLabApiForm ()
454
455
.withParam ("move_before_id" , moveBeforeId )
455
456
.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 >>() {} );
459
460
}
460
461
}
0 commit comments