-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathresolution.go
More file actions
30 lines (24 loc) · 728 Bytes
/
resolution.go
File metadata and controls
30 lines (24 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package backlog
import "context"
// Resolution : resolutions
type Resolution struct {
ID *int `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
}
// GetResolutions returns the list of resolutions
func (c *Client) GetResolutions() ([]*Resolution, error) {
return c.GetResolutionsContext(context.Background())
}
// GetResolutionsContext returns the list of resolutions with context
func (c *Client) GetResolutionsContext(ctx context.Context) ([]*Resolution, error) {
u := "/api/v2/resolutions"
req, err := c.NewRequest("GET", u, nil)
if err != nil {
return nil, err
}
var resolutions []*Resolution
if err := c.Do(ctx, req, &resolutions); err != nil {
return nil, err
}
return resolutions, nil
}