@@ -22,20 +22,18 @@ import (
2222 "time"
2323)
2424
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
2727//
2828// GitLab API docs: https://docs.gitlab.com/ee/api/iterations.html
29-
3029type ProjectIterationsService struct {
3130 client * Client
3231}
3332
34- // Iteration represents a GitLab iteration
33+ // ProjectIteration represents a GitLab project iteration.
3534//
3635// 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 {
3937 ID int `json:"id"`
4038 IID int `json:"iid"`
4139 Sequence int `json:"sequence"`
@@ -50,26 +48,27 @@ type Iteration struct {
5048 WebURL string `json:"web_url"`
5149}
5250
53- func (i Iteration ) String () string {
51+ func (i ProjectIteration ) String () string {
5452 return Stringify (i )
5553}
5654
57- // ListGroupIterationsOptions contains the available
58- // ListGroupIterations() options
55+ // ListProjectIterationsOptions contains the available ListProjectIterations()
56+ // options
5957//
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
6160type ListProjectIterationsOptions struct {
6261 ListOptions
6362 State * string `url:"state,omitempty" json:"state,omitempty"`
6463 Search * string `url:"search,omitempty" json:"search,omitempty"`
6564 IncludeAncestors * bool `url:"include_ancestors,omitempty" json:"include_ancestors,omitempty"`
6665}
6766
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 ) {
7372 project , err := parseID (pid )
7473 if err != nil {
7574 return nil , nil , err
@@ -81,11 +80,11 @@ func (i *ProjectIterationsService) ListProjectIterations(pid interface{}, opt *L
8180 return nil , nil , err
8281 }
8382
84- var it []* Iteration
85- resp , err := i .client .Do (req , & it )
83+ var pis []* ProjectIteration
84+ resp , err := i .client .Do (req , & pis )
8685 if err != nil {
8786 return nil , resp , err
8887 }
8988
90- return it , resp , err
89+ return pis , resp , err
9190}
0 commit comments