-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditTask.go
More file actions
86 lines (72 loc) · 1.87 KB
/
Copy patheditTask.go
File metadata and controls
86 lines (72 loc) · 1.87 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package kanbanize
import "fmt"
type editTask struct {
Boardid string `json:"boardid,omitempty"`
Taskid string `json:"taskid,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Priority string `json:"priority,omitempty"`
Assignee string `json:"assignee,omitempty"`
Size string `json:"size,omitempty"`
Tags string `json:"tags,omitempty"`
Deadline string `json:"deadline,omitempty"`
Extlink string `json:"extlink,omitempty"`
Type string `json:"type,omitempty"`
client *Client
}
func (c *Client) EditTask(BoardID, TaskID string) *editTask {
return &editTask{
Taskid: TaskID,
Boardid: BoardID,
client: c,
}
}
func (t *editTask) SetTitle(Title string) *editTask {
t.Title = Title
return t
}
func (t *editTask) SetDescription(desc string) *editTask {
t.Description = desc
return t
}
func (t *editTask) SetPriority(prio string) *editTask {
t.Priority = prio
return t
}
func (t *editTask) SetAssignee(assignee string) *editTask {
t.Assignee = assignee
return t
}
func (t *editTask) SetSize(size string) *editTask {
t.Size = size
return t
}
func (t *editTask) SetTags(tags string) *editTask {
t.Tags = tags
return t
}
func (t *editTask) SetDeadline(dead string) *editTask {
t.Deadline = dead
return t
}
func (t *editTask) SetExtLink(link string) *editTask {
t.Extlink = link
return t
}
func (t *editTask) SetType(typ string) *editTask {
t.Type = typ
return t
}
//GetBoardStructure returns the structure of all boards
func (t *editTask) Edit() error {
url := t.client.APIURL + "edit_task"
res, err := t.client.getRequest().
SetBody(t).
Post(url)
fmt.Printf("Edit Task returned %s\n", res.String())
if err != nil {
//handle read response error
return err
}
return nil
}