This repository was archived by the owner on Feb 13, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathObjects.go
More file actions
160 lines (146 loc) · 6.84 KB
/
Copy pathObjects.go
File metadata and controls
160 lines (146 loc) · 6.84 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package box
// Item is the base structure of a Box object.
type Item struct {
Type string `json:"type"`
ID string `json:"id"`
FileVersion *FileVersion `json:"file_version,omitempty"`
SequenceID string `json:"sequence_id,omitempty"`
Etag string `json:"etag,omitempty"`
Sha1 string `json:"sha1,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Size int `json:"size"`
PathCollection *PathCollection `json:"path_collection,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ModifiedAt string `json:"modified_at,omitempty"`
CreatedBy *User `json:"created_by,omitempty"`
ModifiedBy *User `json:"modified_by,omitempty"`
OwnedBy *User `json:"owned_by,omitempty"`
SharedLink *SharedLink `json:"shared_link,omitempty"`
Parent *Parent `json:"parent,omitempty"`
ItemStatus string `json:"item_status,omitempty"`
}
// FileObject : File information describe file objects in Box, with attributes
// like who created the file, when it was last modified, and other information.
// The actual content of the file itself is accessible through the
// /files/{id}/content endpoint. Italicized attributes are not returned by
// default and must be retrieved through the fields parameter.
type FileObject struct {
Item
}
// FolderObject : A Box Folder object.
type FolderObject struct {
Item
ItemCollection *ItemCollection `json:"item_collection,omitempty"`
Tags []string `json:"tags,omitempty"`
}
// FileVersion : Contains version information of a FileObject.
type FileVersion struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
Sha1 string `json:"sha1,omitempty"`
Name string `json:"name,omitempty"`
Size int `json:"size,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ModifiedAt string `json:"modified_at,omitempty"`
ModifiedBy *User `json:"modified_by,omitempty"`
TrashedAt string `json:"trashed_at,omitempty"`
PurgedAt string `json:"purged_at,omitempty"`
}
// Entries : A more in-depth response containing more information about box objects.
type Entries struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
SequenceID struct{} `json:"sequence_id,omitempty"`
Etag string `json:"etag,omitempty"`
Name string `json:"name,omitempty"`
Sha1 string `json:"sha1,omitempty"`
Description string `json:"description,omitempty"`
Size int `json:"size,omitempty"`
PathCollection *PathCollection `json:"path_collection,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ModifiedAt string `json:"modified_at,omitempty"`
TrashedAt struct{} `json:"trashed_at,omitempty"`
PurgedAt struct{} `json:"purged_at,omitempty"`
ContentCreatedAt string `json:"content_created_at,omitempty"`
ContentModifiedAt string `json:"content_modified_at,omitempty"`
CreatedBy *User `json:"created_by,omitempty"`
ModifiedBy *User `json:"modified_by,omitempty"`
OwnedBy *User `json:"owned_by,omitempty"`
SharedLink *SharedLink `json:"shared_link,omitempty"`
Parent *Parent `json:"parent,omitempty"`
ItemStatus string `json:"item_status,omitempty"`
}
// PathCollection : The total amount of entries in a given path, as well as the entries themselves.
type PathCollection struct {
TotalCount int `json:"total_count,omitempty"`
Entries []*Entries `json:"entries,omitempty"`
}
// User : Contains information about a Box user.
type User struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Login string `json:"login,omitempty"`
}
// Permissions : Flags for downloaded files.
type Permissions struct {
CanDelete bool `json:"can_delete,omitempty"`
CanDownload bool `json:"can_download,omitempty"`
CanInviteCollaborator bool `json:"can_invite_collaborator,omitempty"`
CanRename bool `json:"can_rename,omitempty"`
CanSetShareAccess bool `json:"can_set_share_access,omitempty"`
CanShare bool `json:"can_share,omitempty"`
CanAnnotate bool `json:"can_annotate,omitempty"`
CanComment bool `json:"can_comment,omitempty"`
CanPreview bool `json:"can_preview,omitempty"`
CanUpload bool `json:"can_upload,omitempty"`
CanViewAnnotationsAll bool `json:"can_view_annotations_all,omitempty"`
CanViewAnnotationsSelf bool `json:"can_view_annotations_self,omitempty"`
}
// SharedLink : A shared link to a downloadable file.
type SharedLink struct {
URL string `json:"url,omitempty"`
DownloadURL struct{} `json:"download_url,omitempty"`
VanityURL struct{} `json:"vanity_url,omitempty"`
IsPasswordEnabled bool `json:"is_password_enabled,omitempty"`
UnsharedAt struct{} `json:"unshared_at,omitempty"`
DownloadCount int `json:"download_count,omitempty"`
PreviewCount int `json:"preview_count,omitempty"`
Access string `json:"access,omitempty"`
Permissions *Permissions `json:"permissions,omitempty"`
}
// FolderUploadEmail : Access level and email address of upload folder.
type FolderUploadEmail struct {
Access string `json:"access,omitempty"`
Email string `json:"email,omitempty"`
}
// Parent : Parent folder of a returned box object.
type Parent struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
SequenceID struct{} `json:"sequence_id,omitempty"`
Etag struct{} `json:"etag,omitempty"`
Name string `json:"name,omitempty"`
}
// ItemCollection : Total count up to the limit of the number of entries in a folder, as well as the entries themselves.
type ItemCollection struct {
TotalCount int `json:"total_count,omitempty"`
Entries []*Entries `json:"entries,omitempty"`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
}
// Order : Defines how to sort objects.
type Order struct {
By string `json:"by,omitempty"`
Direction string `json:"direction,omitempty"`
}
// EmbeddedFile : An HTML embeddable file.
type EmbeddedFile struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
Etag string `json:"etag,omitempty"`
ExpiringEmbedLink struct {
URL string `json:"url,omitempty"`
} `json:"expiring_embed_link,omitempty"`
}