-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsubtaskTimeTracking.go
57 lines (53 loc) · 1.63 KB
/
subtaskTimeTracking.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package ganboard
// HasSubtaskTimer https://docs.kanboard.org/en/latest/api/subtask_time_tracking_procedures.html#hassubtasktimer
func (c *Client) HasSubtaskTimer(subtaskID int, userID int) (bool, error) {
query := request{
Client: c,
Method: "hasSubtaskTimer",
Params: map[string]int{
"subtask_id": subtaskID,
"user_id": userID,
},
}
response, err := query.decodeBoolean()
return response, err
}
// SetSubtaskStartTime https://docs.kanboard.org/en/latest/api/subtask_time_tracking_procedures.html#setsubtaskstarttime
func (c *Client) SetSubtaskStartTime(subtaskID int, userID int) (bool, error) {
query := request{
Client: c,
Method: "setSubtaskStartTime",
Params: map[string]int{
"subtask_id": subtaskID,
"user_id": userID,
},
}
response, err := query.decodeBoolean()
return response, err
}
// SetSubtaskEndTime https://docs.kanboard.org/en/latest/api/subtask_time_tracking_procedures.html#setsubtaskendtime
func (c *Client) SetSubtaskEndTime(subtaskID int, userID int) (bool, error) {
query := request{
Client: c,
Method: "setSubtaskEndTime",
Params: map[string]int{
"subtask_id": subtaskID,
"user_id": userID,
},
}
response, err := query.decodeBoolean()
return response, err
}
// GetSubtaskTimeSpent https://docs.kanboard.org/en/latest/api/subtask_time_tracking_procedures.html#getsubtasktimespent
func (c *Client) GetSubtaskTimeSpent(subtaskID int, userID int) (float64, error) {
query := request{
Client: c,
Method: "getSubtaskTimeSpent",
Params: map[string]int{
"subtask_id": subtaskID,
"user_id": userID,
},
}
response, err := query.decodeFloat64()
return response, err
}