-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmoveTask.go
More file actions
54 lines (45 loc) · 1.09 KB
/
Copy pathmoveTask.go
File metadata and controls
54 lines (45 loc) · 1.09 KB
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
package kanbanize
import "fmt"
type moveTask struct {
Boardid string `json:"boardid,omitempty"`
Taskid string `json:"taskid,omitempty"`
Column string `json:"column,omitempty"`
Lane string `json:"lane,omitempty"`
Position string `json:"position,omitempty"`
client *Client
}
func (c *Client) MoveTask(TaskID string) *moveTask {
return &moveTask{
Taskid: TaskID,
client: c,
}
}
func (t *moveTask) ToBoard(BoardID string) *moveTask {
t.Boardid = BoardID
return t
}
func (t *moveTask) ToColumn(colName string) *moveTask {
t.Column = colName
return t
}
func (t *moveTask) ToLane(laneName string) *moveTask {
t.Lane = laneName
return t
}
func (t *moveTask) ToPos(pos string) *moveTask {
t.Position = pos
return t
}
//GetBoardStructure returns the structure of all boards
func (t *moveTask) Move() error {
url := t.client.APIURL + "move_task"
res, err := t.client.getRequest().
SetBody(t).
Post(url)
fmt.Printf("Move returned %s\n", res.String())
if err != nil {
//handle read response error
return err
}
return nil
}