...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package gitlab
18
19 import (
20 "fmt"
21 "net/http"
22 "time"
23 )
24
25
26
27
28
29 type GroupIterationsService struct {
30 client *Client
31 }
32
33
34
35
36 type GroupIteration struct {
37 ID int `json:"id"`
38 IID int `json:"iid"`
39 Sequence int `json:"sequence"`
40 GroupID int `json:"group_id"`
41 Title string `json:"title"`
42 Description string `json:"description"`
43 State int `json:"state"`
44 CreatedAt *time.Time `json:"created_at"`
45 UpdatedAt *time.Time `json:"updated_at"`
46 DueDate *ISOTime `json:"due_date"`
47 StartDate *ISOTime `json:"start_date"`
48 WebURL string `json:"web_url"`
49 }
50
51 func (i GroupIteration) String() string {
52 return Stringify(i)
53 }
54
55
56
57
58
59
60 type ListGroupIterationsOptions struct {
61 ListOptions
62 State *string `url:"state,omitempty" json:"state,omitempty"`
63 Search *string `url:"search,omitempty" json:"search,omitempty"`
64 IncludeAncestors *bool `url:"include_ancestors,omitempty" json:"include_ancestors,omitempty"`
65 }
66
67
68
69
70
71 func (s *GroupIterationsService) ListGroupIterations(gid interface{}, opt *ListGroupIterationsOptions, options ...RequestOptionFunc) ([]*GroupIteration, *Response, error) {
72 group, err := parseID(gid)
73 if err != nil {
74 return nil, nil, err
75 }
76 u := fmt.Sprintf("groups/%s/iterations", PathEscape(group))
77
78 req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
79 if err != nil {
80 return nil, nil, err
81 }
82
83 var gis []*GroupIteration
84 resp, err := s.client.Do(req, &gis)
85 if err != nil {
86 return nil, nil, err
87 }
88
89 return gis, resp, nil
90 }
91
View as plain text