@@ -22,20 +22,18 @@ import (
22
22
"time"
23
23
)
24
24
25
- // IterationsAPI handles communication with the iterations related methods
26
- // of the GitLab API
25
+ // IterationsAPI handles communication with the project iterations related
26
+ // methods of the GitLab API
27
27
//
28
28
// GitLab API docs: https://docs.gitlab.com/ee/api/iterations.html
29
-
30
29
type ProjectIterationsService struct {
31
30
client * Client
32
31
}
33
32
34
- // Iteration represents a GitLab iteration
33
+ // ProjectIteration represents a GitLab project iteration.
35
34
//
36
35
// GitLab API docs: https://docs.gitlab.com/ee/api/iterations.html
37
- // CAVEAT: GitLab docu currently misses `sequence` key.
38
- type Iteration struct {
36
+ type ProjectIteration struct {
39
37
ID int `json:"id"`
40
38
IID int `json:"iid"`
41
39
Sequence int `json:"sequence"`
@@ -50,26 +48,27 @@ type Iteration struct {
50
48
WebURL string `json:"web_url"`
51
49
}
52
50
53
- func (i Iteration ) String () string {
51
+ func (i ProjectIteration ) String () string {
54
52
return Stringify (i )
55
53
}
56
54
57
- // ListGroupIterationsOptions contains the available
58
- // ListGroupIterations() options
55
+ // ListProjectIterationsOptions contains the available ListProjectIterations()
56
+ // options
59
57
//
60
- // GitLab API docs: https://docs.gitlab.com/ee/api/group_iterations.html#list-project-iterations
58
+ // GitLab API docs:
59
+ // https://docs.gitlab.com/ee/api/group_iterations.html#list-project-iterations
61
60
type ListProjectIterationsOptions struct {
62
61
ListOptions
63
62
State * string `url:"state,omitempty" json:"state,omitempty"`
64
63
Search * string `url:"search,omitempty" json:"search,omitempty"`
65
64
IncludeAncestors * bool `url:"include_ancestors,omitempty" json:"include_ancestors,omitempty"`
66
65
}
67
66
68
- //ListProjectIterations lists all iterations of the projects ancestor groups .
69
- //As of GitLab 13.5, there are no direct project-level iterations.
70
-
71
- // GitLab API docs: https://docs.gitlab.com/ee/api/iterations .html
72
- func (i * ProjectIterationsService ) ListProjectIterations (pid interface {}, opt * ListProjectIterationsOptions , options ... RequestOptionFunc ) ([]* Iteration , * Response , error ) {
67
+ // ListProjectIterations returns a list of projects iterations .
68
+ //
69
+ // GitLab API docs:
70
+ // https://docs.gitlab.com/ee/api/group_iterations .html#list-project-iterations
71
+ func (i * ProjectIterationsService ) ListProjectIterations (pid interface {}, opt * ListProjectIterationsOptions , options ... RequestOptionFunc ) ([]* ProjectIteration , * Response , error ) {
73
72
project , err := parseID (pid )
74
73
if err != nil {
75
74
return nil , nil , err
@@ -81,11 +80,11 @@ func (i *ProjectIterationsService) ListProjectIterations(pid interface{}, opt *L
81
80
return nil , nil , err
82
81
}
83
82
84
- var it []* Iteration
85
- resp , err := i .client .Do (req , & it )
83
+ var pis []* ProjectIteration
84
+ resp , err := i .client .Do (req , & pis )
86
85
if err != nil {
87
86
return nil , resp , err
88
87
}
89
88
90
- return it , resp , err
89
+ return pis , resp , err
91
90
}
0 commit comments