-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpriority.go
More file actions
30 lines (24 loc) · 704 Bytes
/
priority.go
File metadata and controls
30 lines (24 loc) · 704 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"
// Priority : priority
type Priority struct {
ID *int `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
}
// GetPriorities returns the list of priorities
func (c *Client) GetPriorities() ([]*Priority, error) {
return c.GetPrioritiesContext(context.Background())
}
// GetPrioritiesContext returns the list of priorities with context
func (c *Client) GetPrioritiesContext(ctx context.Context) ([]*Priority, error) {
u := "/api/v2/priorities"
req, err := c.NewRequest("GET", u, nil)
if err != nil {
return nil, err
}
var priorities []*Priority
if err := c.Do(ctx, req, &priorities); err != nil {
return nil, err
}
return priorities, nil
}