-
Notifications
You must be signed in to change notification settings - Fork 14
/
common.go
55 lines (48 loc) · 1.97 KB
/
common.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
package box
// TODO(ttacon): go through and clean up pointer vs non-pointer
// TODO(ttacon): go through and see where omitempty is appropriate
type AccessEmail struct {
// TODO(ttacon): these may change...
Access string `json:"access,omitempty"`
Email string `json:"email,omitempty"`
}
type Order struct {
By string `json:"by"`
Direction string `json:"direction"`
}
type ItemCollection struct {
TotalCount int `json:"total_count,omitempty"`
Entries []*Item `json:"entries,omitempty"` // this is probably items... TODO(ttacon): double check
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
Order []*Order `json:"order"`
}
type PathCollection struct {
TotalCount int `json:"total_count"`
Entries []*Item `json:"entries"`
}
type Item struct {
Type string `json:"type,omitempty"` // TODO(ttacon): make this an enum eventually
ID string `json:"id,omitempty"`
SequenceId string `json:"sequence_id,omitempty"` // no idea what this is supposed to be
ETag *string `json:"etag,omitempty"` // again, not sure what this type is supposed to be
Name string `json:"name,omitempty"`
Login string `json:"login,omitempty"`
SHA1 string `json:"sha"`
}
// TODO(ttacon): leave plurality?
type Permissions struct {
CanDownload bool `json:"can_download"`
CanPreview bool `json:"can_preview"`
}
type Link struct {
Url string `json:"url"`
DownloadUrl *string `json:"download_url"`
VanityUrl *string `json:"vanity_url"`
IsPasswordEnabled bool `json:"is_password_enabled"`
UnsharedAt *string `json:"unshared_at"` // TODO(ttacon): change to time.Time
DownloadCount int `json:"download_count"`
PreviewCount int `json:"preview_count"`
Access string `json:"access"` // TODO(ttacon): consider enums for these types of values?
Permissions *Permissions `json:"permissions"`
}