boxr 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -10
- data/lib/boxr/comments.rb +2 -1
- data/lib/boxr/files.rb +2 -1
- data/lib/boxr/folders.rb +10 -9
- data/lib/boxr/groups.rb +2 -2
- data/lib/boxr/tasks.rb +2 -1
- data/lib/boxr/users.rb +2 -2
- data/lib/boxr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aa4abe4312f4c46511db9986e8ad93b35b8cfe8
|
4
|
+
data.tar.gz: 47fb80ce3be0012b8690957bcc0e284d86e9c1c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53efb9140c1c6b83d14d83a825aad2541423f98508cb659b9946d093a5455ad675dc8abd9d71a19d8252c4b7e0ff4ce9d4c4d1330de132743a46d83c2244a26b
|
7
|
+
data.tar.gz: 7b93b21a33d06744eb47aa6af0c6352b54a358da83a5c7663b91163830e7a92117e122627cec995c3c7df2eb9e9dcca3f69578c98c214554d3467ed7295cbff6
|
data/README.md
CHANGED
@@ -92,6 +92,9 @@ puts "Shared Link: #{file.shared_link.url}"
|
|
92
92
|
#### [Folders](https://developers.box.com/docs/#folders)
|
93
93
|
```ruby
|
94
94
|
folder_from_path(path)
|
95
|
+
|
96
|
+
folder_from_id(folder_id, fields: [])
|
97
|
+
alias :folder :folder_from_id
|
95
98
|
|
96
99
|
folder_items(folder, fields: [], offset: 0, limit: FOLDER_ITEMS_LIMIT)
|
97
100
|
|
@@ -99,8 +102,6 @@ root_folder_items(fields: [], offset: 0, limit: FOLDER_ITEMS_LIMIT)
|
|
99
102
|
|
100
103
|
create_folder(name, parent)
|
101
104
|
|
102
|
-
folder(folder_id, fields: [])
|
103
|
-
|
104
105
|
update_folder(folder, name: nil, description: nil, parent_id: nil, shared_link: nil,
|
105
106
|
folder_upload_email_access: nil, owned_by_id: nil, sync_state: nil, tags: nil,
|
106
107
|
can_non_owners_invite: nil, if_match: nil)
|
@@ -125,7 +126,8 @@ restore_trashed_folder(folder, name: nil, parent_id: nil)
|
|
125
126
|
```ruby
|
126
127
|
file_from_path(path)
|
127
128
|
|
128
|
-
|
129
|
+
file_from_id(file_id, fields: [])
|
130
|
+
alias :file :file_from_id
|
129
131
|
|
130
132
|
update_file(file, name: nil, description: nil, parent_id: nil, shared_link: nil, tags: nil, if_match: nil)
|
131
133
|
|
@@ -171,7 +173,8 @@ reply_to_comment(comment_id, message: nil, tagged_message: nil)
|
|
171
173
|
|
172
174
|
change_comment(comment, message)
|
173
175
|
|
174
|
-
|
176
|
+
comment_from_id(comment_id, fields: [])
|
177
|
+
alias :comment :comment_from_id
|
175
178
|
|
176
179
|
delete_comment(comment)
|
177
180
|
```
|
@@ -185,7 +188,8 @@ edit_collaboration(collaboration, role: nil, status: nil)
|
|
185
188
|
|
186
189
|
remove_collaboration(collaboration)
|
187
190
|
|
188
|
-
|
191
|
+
collaboration_from_id(collaboration_id, fields: [], status: nil)
|
192
|
+
alias :collaboration :collaboration_from_id
|
189
193
|
|
190
194
|
pending_collaborations()
|
191
195
|
```
|
@@ -208,10 +212,10 @@ search(query, scope: nil, file_extensions: nil, created_at_range: nil, updated_a
|
|
208
212
|
#### [Users](https://developers.box.com/docs/#users)
|
209
213
|
```ruby
|
210
214
|
current_user(fields: [])
|
211
|
-
|
212
215
|
alias :me :current_user
|
213
216
|
|
214
|
-
|
217
|
+
user_from_id(user_id, fields: [])
|
218
|
+
alias :user :user_from_id
|
215
219
|
|
216
220
|
all_users(filter_term: nil, fields: [], offset: 0, limit: DEFAULT_LIMIT)
|
217
221
|
|
@@ -235,7 +239,6 @@ groups(fields: [], offset: 0, limit: DEFAULT_LIMIT)
|
|
235
239
|
create_group(name)
|
236
240
|
|
237
241
|
update_group(group, name)
|
238
|
-
|
239
242
|
alias :rename_group :update_group
|
240
243
|
|
241
244
|
delete_group(group)
|
@@ -246,7 +249,8 @@ group_memberships_for_user(user, offset: 0, limit: DEFAULT_LIMIT)
|
|
246
249
|
|
247
250
|
group_memberships_for_me(offset: 0, limit: DEFAULT_LIMIT)
|
248
251
|
|
249
|
-
|
252
|
+
group_membership_from_id(membership_id)
|
253
|
+
alias :group_membership :group_membership_from_id
|
250
254
|
|
251
255
|
add_user_to_group(user, group, role: nil)
|
252
256
|
|
@@ -262,7 +266,8 @@ file_tasks(file, fields: [])
|
|
262
266
|
|
263
267
|
create_task(file, action: :review, message: nil, due_at: nil)
|
264
268
|
|
265
|
-
|
269
|
+
task_from_id(task_id)
|
270
|
+
alias :task :task_from_id
|
266
271
|
|
267
272
|
update_task(task, action: :review, message: nil, due_at: nil)
|
268
273
|
|
data/lib/boxr/comments.rb
CHANGED
@@ -27,12 +27,13 @@ module Boxr
|
|
27
27
|
updated_comment
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def comment_from_id(comment_id, fields: [])
|
31
31
|
comment_id = ensure_id(comment_id)
|
32
32
|
uri ="#{COMMENTS_URI}/#{comment_id}"
|
33
33
|
comment, response = get(uri)
|
34
34
|
comment
|
35
35
|
end
|
36
|
+
alias :comment :comment_from_id
|
36
37
|
|
37
38
|
def delete_comment(comment)
|
38
39
|
comment_id = ensure_id(comment)
|
data/lib/boxr/files.rb
CHANGED
@@ -17,13 +17,14 @@ module Boxr
|
|
17
17
|
file
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def file_from_id(file_id, fields: [])
|
21
21
|
file_id = ensure_id(file_id)
|
22
22
|
uri = "#{FILES_URI}/#{file_id}"
|
23
23
|
query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
|
24
24
|
file, response = get(uri, query: query)
|
25
25
|
file
|
26
26
|
end
|
27
|
+
alias :file :file_from_id
|
27
28
|
|
28
29
|
def update_file(file, name: nil, description: nil, parent_id: nil, shared_link: nil, tags: nil, if_match: nil)
|
29
30
|
file_id = ensure_id(file)
|
data/lib/boxr/folders.rb
CHANGED
@@ -16,6 +16,16 @@ module Boxr
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
def folder_from_id(folder_id, fields: [])
|
20
|
+
folder_id = ensure_id(folder_id)
|
21
|
+
query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
|
22
|
+
uri = "#{FOLDERS_URI}/#{folder_id}"
|
23
|
+
|
24
|
+
folder, response = get(uri, query: query)
|
25
|
+
folder
|
26
|
+
end
|
27
|
+
alias :folder :folder_from_id
|
28
|
+
|
19
29
|
def folder_items(folder, fields: [], offset: nil, limit: nil)
|
20
30
|
folder_id = ensure_id(folder)
|
21
31
|
query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
|
@@ -44,15 +54,6 @@ module Boxr
|
|
44
54
|
created_folder
|
45
55
|
end
|
46
56
|
|
47
|
-
def folder(folder_id, fields: [])
|
48
|
-
folder_id = ensure_id(folder_id)
|
49
|
-
query = build_fields_query(fields, FOLDER_AND_FILE_FIELDS_QUERY)
|
50
|
-
uri = "#{FOLDERS_URI}/#{folder_id}"
|
51
|
-
|
52
|
-
folder, response = get(uri, query: query)
|
53
|
-
folder
|
54
|
-
end
|
55
|
-
|
56
57
|
def update_folder(folder, name: nil, description: nil, parent_id: nil, shared_link: nil,
|
57
58
|
folder_upload_email_access: nil, owned_by_id: nil, sync_state: nil, tags: nil,
|
58
59
|
can_non_owners_invite: nil, if_match: nil)
|
data/lib/boxr/groups.rb
CHANGED
@@ -20,7 +20,6 @@ module Boxr
|
|
20
20
|
updated_group, response = put(uri, attributes)
|
21
21
|
updated_group
|
22
22
|
end
|
23
|
-
|
24
23
|
alias :rename_group :update_group
|
25
24
|
|
26
25
|
def delete_group(group)
|
@@ -47,12 +46,13 @@ module Boxr
|
|
47
46
|
memberships = get_all_with_pagination(uri, offset: 0, limit: DEFAULT_LIMIT)
|
48
47
|
end
|
49
48
|
|
50
|
-
def
|
49
|
+
def group_membership_from_id(membership_id)
|
51
50
|
membership_id = ensure_id(membership_id)
|
52
51
|
uri = "#{GROUP_MEMBERSHIPS_URI}/#{membership_id}"
|
53
52
|
membership, response = get(uri)
|
54
53
|
membership
|
55
54
|
end
|
55
|
+
alias :group_membership :group_membership_from_id
|
56
56
|
|
57
57
|
def add_user_to_group(user, group, role: nil)
|
58
58
|
user_id = ensure_id(user)
|
data/lib/boxr/tasks.rb
CHANGED
@@ -21,12 +21,13 @@ module Boxr
|
|
21
21
|
new_task
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def task_from_id(task_id)
|
25
25
|
task_id = ensure_id(task_id)
|
26
26
|
uri = "#{TASKS_URI}/#{task_id}"
|
27
27
|
task, response = get(uri)
|
28
28
|
task
|
29
29
|
end
|
30
|
+
alias :task :task_from_id
|
30
31
|
|
31
32
|
def update_task(task, action: :review, message: nil, due_at: nil)
|
32
33
|
task_id = ensure_id(task)
|
data/lib/boxr/users.rb
CHANGED
@@ -7,16 +7,16 @@ module Boxr
|
|
7
7
|
user, response = get(uri, query: query)
|
8
8
|
user
|
9
9
|
end
|
10
|
-
|
11
10
|
alias :me :current_user
|
12
11
|
|
13
|
-
def
|
12
|
+
def user_from_id(user_id, fields: [])
|
14
13
|
user_id = ensure_id(user_id)
|
15
14
|
uri = "#{USERS_URI}/#{user_id}"
|
16
15
|
query = build_fields_query(fields, USER_FIELDS_QUERY)
|
17
16
|
user, response = get(uri, query: query)
|
18
17
|
user
|
19
18
|
end
|
19
|
+
alias :user :user_from_id
|
20
20
|
|
21
21
|
def all_users(filter_term: nil, fields: [], offset: nil, limit: nil)
|
22
22
|
uri = USERS_URI
|
data/lib/boxr/version.rb
CHANGED