forked from joefitzgerald/forecast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmilestone.go
More file actions
30 lines (25 loc) · 747 Bytes
/
milestone.go
File metadata and controls
30 lines (25 loc) · 747 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 forecast
import "time"
type milestonesContainer struct {
Milestones Milestones `json:"milestones"`
}
// Milestones is a list of milestones
type Milestones []Milestone
// Milestone is a Forecast milestone
type Milestone struct {
ID int `json:"id"`
Name string `json:"name"`
Date string `json:"date"`
UpdatedAt time.Time `json:"updated_at"`
UpdatedByID int `json:"updated_by_id"`
ProjectID int `json:"project_id"`
}
// Milestones returns all milestones in the Forecast account
func (api *API) Milestones() (Milestones, error) {
var container milestonesContainer
err := api.do("milestones", &container)
if err != nil {
return nil, err
}
return container.Milestones, nil
}