forked from AkihikoITOH/wrike.go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
attachment.go
38 lines (33 loc) · 1.4 KB
/
attachment.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
package types
import "encoding/json"
type Attachments struct {
Kind string `json:"kind"`
Data []Task `json:"data"`
}
type AttachmentID string
type Attachment struct {
ID AttachmentID `json:"id"`
AuthorId string `json:"authorId"`
Name string `json:"name"`
CreatedDate string `json:"createdDate"`
Version int `json:"version"`
Type string `json:"type"`
ContentType string `json:"contentType"`
Size int `json:"size"`
TaskId string `json:"taskId"`
FolderId string `json:"folderId"`
CommentId string `json:"commentId,omitempty"`
CurrentAttachmentId string `json:"currentAttachmentId,omitempty"`
PreviewUrl string `json:"previewUrl,omitempty"`
Url string `json:"url,omitempty"`
PlaylistUrl string `json:"playlistUrl,omitempty"`
ReviewIds []string `json:"reviewIds,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
}
// NewTasksFromJSON parses the given JSON (as byte sequence) and returns a new Tasks.
func NewAttachmentsFromJSON(data []byte) (*Attachments, error) {
var attachments Attachments
err := json.Unmarshal(data, &attachments)
return &attachments, err
}