files.com 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTORS +4 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +82 -0
- data/LICENSE +21 -0
- data/README.md +119 -0
- data/Rakefile +12 -0
- data/SECURITY.md +24 -0
- data/_VERSION +1 -0
- data/bin/files +8 -0
- data/bin/files-console +16 -0
- data/docs/account_line_item.md +41 -0
- data/docs/action.md +37 -0
- data/docs/api_key.md +202 -0
- data/docs/app.md +59 -0
- data/docs/as2_key.md +133 -0
- data/docs/auto.md +11 -0
- data/docs/automation.md +190 -0
- data/docs/behavior.md +208 -0
- data/docs/bundle.md +252 -0
- data/docs/bundle_download.md +35 -0
- data/docs/clickwrap.md +143 -0
- data/docs/dns_record.md +35 -0
- data/docs/errors.md +17 -0
- data/docs/file.md +204 -0
- data/docs/file_action.md +126 -0
- data/docs/file_comment.md +116 -0
- data/docs/file_comment_reaction.md +62 -0
- data/docs/file_part_upload.md +37 -0
- data/docs/file_utils.md +4 -0
- data/docs/folder.md +90 -0
- data/docs/group.md +153 -0
- data/docs/group_user.md +124 -0
- data/docs/history.md +171 -0
- data/docs/history_export.md +174 -0
- data/docs/image.md +13 -0
- data/docs/invoice.md +72 -0
- data/docs/invoice_line_item.md +27 -0
- data/docs/ip_address.md +55 -0
- data/docs/lock.md +98 -0
- data/docs/message.md +147 -0
- data/docs/message_comment.md +132 -0
- data/docs/message_comment_reaction.md +94 -0
- data/docs/message_reaction.md +94 -0
- data/docs/notification.md +177 -0
- data/docs/payment.md +72 -0
- data/docs/payment_line_item.md +19 -0
- data/docs/permission.md +95 -0
- data/docs/preview.md +19 -0
- data/docs/project.md +121 -0
- data/docs/public_ip_address.md +13 -0
- data/docs/public_key.md +133 -0
- data/docs/remote_server.md +356 -0
- data/docs/request.md +100 -0
- data/docs/session.md +78 -0
- data/docs/site.md +448 -0
- data/docs/sso_strategy.md +114 -0
- data/docs/status.md +21 -0
- data/docs/style.md +93 -0
- data/docs/usage_daily_snapshot.md +45 -0
- data/docs/usage_snapshot.md +53 -0
- data/docs/user.md +535 -0
- data/docs/user_cipher_use.md +41 -0
- data/docs/user_request.md +93 -0
- data/files.com.gemspec +22 -0
- data/lib/files.com.rb +184 -0
- data/lib/files.com/api.rb +38 -0
- data/lib/files.com/api_client.rb +340 -0
- data/lib/files.com/errors.rb +41 -0
- data/lib/files.com/list.rb +95 -0
- data/lib/files.com/models/account_line_item.rb +82 -0
- data/lib/files.com/models/action.rb +77 -0
- data/lib/files.com/models/api_key.rb +270 -0
- data/lib/files.com/models/app.rb +106 -0
- data/lib/files.com/models/as2_key.rb +179 -0
- data/lib/files.com/models/auto.rb +17 -0
- data/lib/files.com/models/automation.rb +304 -0
- data/lib/files.com/models/behavior.rb +266 -0
- data/lib/files.com/models/bundle.rb +371 -0
- data/lib/files.com/models/bundle_download.rb +49 -0
- data/lib/files.com/models/clickwrap.rb +197 -0
- data/lib/files.com/models/dir.rb +3 -0
- data/lib/files.com/models/dns_record.rb +51 -0
- data/lib/files.com/models/errors.rb +22 -0
- data/lib/files.com/models/file.rb +968 -0
- data/lib/files.com/models/file_action.rb +126 -0
- data/lib/files.com/models/file_comment.rb +146 -0
- data/lib/files.com/models/file_comment_reaction.rb +100 -0
- data/lib/files.com/models/file_part_upload.rb +82 -0
- data/lib/files.com/models/file_utils.rb +118 -0
- data/lib/files.com/models/folder.rb +357 -0
- data/lib/files.com/models/group.rb +208 -0
- data/lib/files.com/models/group_user.rb +171 -0
- data/lib/files.com/models/history.rb +228 -0
- data/lib/files.com/models/history_export.rb +353 -0
- data/lib/files.com/models/image.rb +22 -0
- data/lib/files.com/models/invoice.rb +117 -0
- data/lib/files.com/models/invoice_line_item.rb +57 -0
- data/lib/files.com/models/ip_address.rb +66 -0
- data/lib/files.com/models/lock.rb +173 -0
- data/lib/files.com/models/message.rb +201 -0
- data/lib/files.com/models/message_comment.rb +165 -0
- data/lib/files.com/models/message_comment_reaction.rb +128 -0
- data/lib/files.com/models/message_reaction.rb +128 -0
- data/lib/files.com/models/notification.rb +263 -0
- data/lib/files.com/models/payment.rb +117 -0
- data/lib/files.com/models/payment_line_item.rb +37 -0
- data/lib/files.com/models/permission.rb +172 -0
- data/lib/files.com/models/preview.rb +37 -0
- data/lib/files.com/models/project.rb +140 -0
- data/lib/files.com/models/public_ip_address.rb +22 -0
- data/lib/files.com/models/public_key.rb +179 -0
- data/lib/files.com/models/remote_server.rb +680 -0
- data/lib/files.com/models/request.rb +179 -0
- data/lib/files.com/models/session.rb +247 -0
- data/lib/files.com/models/site.rb +733 -0
- data/lib/files.com/models/sso_strategy.rb +227 -0
- data/lib/files.com/models/status.rb +37 -0
- data/lib/files.com/models/style.rb +131 -0
- data/lib/files.com/models/usage_daily_snapshot.rb +66 -0
- data/lib/files.com/models/usage_snapshot.rb +96 -0
- data/lib/files.com/models/user.rb +876 -0
- data/lib/files.com/models/user_cipher_use.rb +63 -0
- data/lib/files.com/models/user_request.rb +127 -0
- data/lib/files.com/response.rb +25 -0
- data/lib/files.com/sizable_io.rb +32 -0
- data/lib/files.com/system_profiler.rb +56 -0
- data/lib/files.com/util.rb +106 -0
- data/lib/files.com/version.rb +5 -0
- data/spec/list_spec.rb +214 -0
- data/spec/models/file_spec.rb +68 -0
- data/spec/models/folder_spec.rb +40 -0
- data/spec/spec_helper.rb +36 -0
- data/test.sh +8 -0
- data/test/test.rb +75 -0
- metadata +235 -0
@@ -0,0 +1,118 @@
|
|
1
|
+
module Files
|
2
|
+
class FileUtils
|
3
|
+
def self.cd(_dir, _options)
|
4
|
+
raise NotImplementedError
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.chmod(_mode, _list, _options = {})
|
8
|
+
raise NotImplementedError
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.chmod_R(_mode, _list, _options = {}) # rubocop:disable Naming/MethodName
|
12
|
+
raise NotImplementedError
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.chown(_user, _group, _list, _options = {})
|
16
|
+
raise NotImplementedError
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.chown_R(_user, _group, _list, _options = {}) # rubocop:disable Naming/MethodName
|
20
|
+
raise NotImplementedError
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.cp(src, dest, options = {})
|
24
|
+
src = [ src ] if src.is_a? String
|
25
|
+
src.each do |path|
|
26
|
+
return false if File.directory?(path, options)
|
27
|
+
end
|
28
|
+
cp_r(src, dest, options)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.cp_r(src, dest, options = {})
|
32
|
+
src = [ src ] if src.is_a? String
|
33
|
+
src.each do |path|
|
34
|
+
FileAction.copy(path, { destination: dest }, options)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.install(src, dest, options = {})
|
39
|
+
cp_r(src, dest, options)
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.ln(_target, _link, _options = {})
|
43
|
+
raise NotImplementedError
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.ln_s(_targets, _dir, _options = {})
|
47
|
+
raise NotImplementedError
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.ln_sf(_target, _link, _options = {})
|
51
|
+
raise NotImplementedError
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.mkdir(list, params = {}, options = {})
|
55
|
+
list = [ list ] if list.is_a? String
|
56
|
+
list.each do |path|
|
57
|
+
Folder.mkdir(path, params, options) unless File.exist?(path, options)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.mkdir_p(list, options = {})
|
62
|
+
list = [ list ] if list.is_a? String
|
63
|
+
|
64
|
+
to_create = list.map do |fname|
|
65
|
+
split = fname.split("/")
|
66
|
+
accum = ""
|
67
|
+
split.map do |piece|
|
68
|
+
accum = [ accum, piece ].join("/")
|
69
|
+
end
|
70
|
+
end.flatten
|
71
|
+
|
72
|
+
mkdir(to_create, options)
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.mv(list, dir, options = {})
|
76
|
+
list = [ list ] if list.is_a? String
|
77
|
+
list.each do |path|
|
78
|
+
FileAction.move(path, { destination: dir }, options)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.pwd
|
83
|
+
raise NotImplementedError
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.rm(list, options = {})
|
87
|
+
list = [ list ] if list.is_a? String
|
88
|
+
list.each do |fname|
|
89
|
+
raise Errno::EPERM.new(fname) if File.directory?(fname, options)
|
90
|
+
end
|
91
|
+
list.each do |fname|
|
92
|
+
File.delete(fname, {}, options)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.rm_r(list, options = {})
|
97
|
+
list = [ list ] if list.is_a? String
|
98
|
+
list.each do |path|
|
99
|
+
File.delete(path, { recursive: true }, options)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.rm_rf(list, options = {})
|
104
|
+
rm_r(list, options)
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.rmdir(list, options = {})
|
108
|
+
list = [ list ] if list.is_a? String
|
109
|
+
list.each do |path|
|
110
|
+
File.delete(path, {}, options) if File.directory?(path, options)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.touch(_list, _options = {})
|
115
|
+
raise NotImplementedError
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,357 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class Folder
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def self.[](*_)
|
8
|
+
raise NotImplementedError
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.chdir(path, &block)
|
12
|
+
raise Errno::ENOENT.new(path) if exist? path
|
13
|
+
|
14
|
+
if block
|
15
|
+
yield path
|
16
|
+
else
|
17
|
+
@@path ||= path
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.children(path, _encoding = "")
|
22
|
+
Folder.new(path).contents.map(&:path)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.chroot(*args); end
|
26
|
+
|
27
|
+
def self.delete(path, params = {}, options = {})
|
28
|
+
File.delete(path, params, options)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.destroy(path, params = {}, options = {})
|
32
|
+
File.destroy(path, params, options)
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.each_child(path, _encoding = "", &block)
|
36
|
+
Folder.new(path).each(&block)
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.empty?(*_args)
|
40
|
+
Folder.new(path).contents.empty?
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.entries(path)
|
44
|
+
list(path)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.exist?(*args)
|
48
|
+
File.exist?(*args)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.find(path, params = {}, options = {})
|
52
|
+
File.find(path, params, options)
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.get(path, params = {}, options = {})
|
56
|
+
File.get(path, params, options)
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.foreach(path, _encoding = "", params = {}, options = {})
|
60
|
+
list_for(path, params, options).each { |x| yield x }
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.getwd(*_args)
|
64
|
+
pwd
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.glob(*_)
|
68
|
+
raise NotImplementedError
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.home(*_args)
|
72
|
+
""
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.mkdir(path, params = {}, options = {})
|
76
|
+
create(path, params, options)
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.open(*args, &block)
|
80
|
+
if block.nil?
|
81
|
+
new *args
|
82
|
+
else
|
83
|
+
yield new *args
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def self.pwd(*_args)
|
88
|
+
@@path ||= ""
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.rmdir(path)
|
92
|
+
delete(path)
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.unlink(path)
|
96
|
+
delete(path)
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.update(path, params = {}, options = {})
|
100
|
+
File.update(path, params, options)
|
101
|
+
end
|
102
|
+
|
103
|
+
def initialize(*args)
|
104
|
+
@attributes = (args[0].is_a?(Hash) && args[0]) || {}
|
105
|
+
@options = (args[1].is_a?(Hash) && args[1]) || {}
|
106
|
+
@attributes['path'] = args[0] if args[0].is_a?(String)
|
107
|
+
end
|
108
|
+
|
109
|
+
def close(*args); end
|
110
|
+
|
111
|
+
def each
|
112
|
+
contents.each { |x| yield x }
|
113
|
+
end
|
114
|
+
|
115
|
+
def fileno
|
116
|
+
stats.id
|
117
|
+
end
|
118
|
+
|
119
|
+
def contents
|
120
|
+
@contents ||= Folder.list(path, {}, @options)
|
121
|
+
end
|
122
|
+
|
123
|
+
def stats
|
124
|
+
@stats ||= File.download(@filename, { "action": "stat" }, @options)
|
125
|
+
end
|
126
|
+
|
127
|
+
def pos
|
128
|
+
@pos ||= 0
|
129
|
+
end
|
130
|
+
|
131
|
+
attr_writer :pos
|
132
|
+
|
133
|
+
def read(*_args)
|
134
|
+
contents[@pos]
|
135
|
+
end
|
136
|
+
|
137
|
+
def rewind
|
138
|
+
@pos = 0
|
139
|
+
end
|
140
|
+
|
141
|
+
def seek(pos)
|
142
|
+
@pos = pos
|
143
|
+
end
|
144
|
+
|
145
|
+
def tell
|
146
|
+
@pos
|
147
|
+
end
|
148
|
+
|
149
|
+
def to_path
|
150
|
+
path
|
151
|
+
end
|
152
|
+
|
153
|
+
# int64 - File/Folder ID
|
154
|
+
def id
|
155
|
+
@attributes[:id]
|
156
|
+
end
|
157
|
+
|
158
|
+
def id=(value)
|
159
|
+
@attributes[:id] = value
|
160
|
+
end
|
161
|
+
|
162
|
+
# string - File/Folder path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
163
|
+
def path
|
164
|
+
@attributes[:path]
|
165
|
+
end
|
166
|
+
|
167
|
+
def path=(value)
|
168
|
+
@attributes[:path] = value
|
169
|
+
end
|
170
|
+
|
171
|
+
# string - File/Folder display name
|
172
|
+
def display_name
|
173
|
+
@attributes[:display_name]
|
174
|
+
end
|
175
|
+
|
176
|
+
def display_name=(value)
|
177
|
+
@attributes[:display_name] = value
|
178
|
+
end
|
179
|
+
|
180
|
+
# string - Type: `directory` or `file`.
|
181
|
+
def type
|
182
|
+
@attributes[:type]
|
183
|
+
end
|
184
|
+
|
185
|
+
def type=(value)
|
186
|
+
@attributes[:type] = value
|
187
|
+
end
|
188
|
+
|
189
|
+
# int64 - File/Folder size
|
190
|
+
def size
|
191
|
+
@attributes[:size]
|
192
|
+
end
|
193
|
+
|
194
|
+
def size=(value)
|
195
|
+
@attributes[:size] = value
|
196
|
+
end
|
197
|
+
|
198
|
+
# date-time - File last modified date/time, according to the server. This is the timestamp of the last Files.com operation of the file, regardless of what modified timestamp was sent.
|
199
|
+
def mtime
|
200
|
+
@attributes[:mtime]
|
201
|
+
end
|
202
|
+
|
203
|
+
def mtime=(value)
|
204
|
+
@attributes[:mtime] = value
|
205
|
+
end
|
206
|
+
|
207
|
+
# date-time - File last modified date/time, according to the client who set it. Files.com allows desktop, FTP, SFTP, and WebDAV clients to set modified at times. This allows Desktop<->Cloud syncing to preserve modified at times.
|
208
|
+
def provided_mtime
|
209
|
+
@attributes[:provided_mtime]
|
210
|
+
end
|
211
|
+
|
212
|
+
def provided_mtime=(value)
|
213
|
+
@attributes[:provided_mtime] = value
|
214
|
+
end
|
215
|
+
|
216
|
+
# string - File CRC32 checksum. This is sometimes delayed, so if you get a blank response, wait and try again.
|
217
|
+
def crc32
|
218
|
+
@attributes[:crc32]
|
219
|
+
end
|
220
|
+
|
221
|
+
def crc32=(value)
|
222
|
+
@attributes[:crc32] = value
|
223
|
+
end
|
224
|
+
|
225
|
+
# string - File MD5 checksum. This is sometimes delayed, so if you get a blank response, wait and try again.
|
226
|
+
def md5
|
227
|
+
@attributes[:md5]
|
228
|
+
end
|
229
|
+
|
230
|
+
def md5=(value)
|
231
|
+
@attributes[:md5] = value
|
232
|
+
end
|
233
|
+
|
234
|
+
# string - MIME Type. This is determined by the filename extension and is not stored separately internally.
|
235
|
+
def mime_type
|
236
|
+
@attributes[:mime_type]
|
237
|
+
end
|
238
|
+
|
239
|
+
def mime_type=(value)
|
240
|
+
@attributes[:mime_type] = value
|
241
|
+
end
|
242
|
+
|
243
|
+
# string - Region location
|
244
|
+
def region
|
245
|
+
@attributes[:region]
|
246
|
+
end
|
247
|
+
|
248
|
+
def region=(value)
|
249
|
+
@attributes[:region] = value
|
250
|
+
end
|
251
|
+
|
252
|
+
# string - A short string representing the current user's permissions. Can be `r`,`w`,`p`, or any combination
|
253
|
+
def permissions
|
254
|
+
@attributes[:permissions]
|
255
|
+
end
|
256
|
+
|
257
|
+
def permissions=(value)
|
258
|
+
@attributes[:permissions] = value
|
259
|
+
end
|
260
|
+
|
261
|
+
# boolean - Are subfolders locked and unable to be modified?
|
262
|
+
def subfolders_locked?
|
263
|
+
@attributes[:subfolders_locked?]
|
264
|
+
end
|
265
|
+
|
266
|
+
def subfolders_locked=(value)
|
267
|
+
@attributes[:subfolders_locked?] = value
|
268
|
+
end
|
269
|
+
|
270
|
+
# string - Link to download file. Provided only in response to a download request.
|
271
|
+
def download_uri
|
272
|
+
@attributes[:download_uri]
|
273
|
+
end
|
274
|
+
|
275
|
+
def download_uri=(value)
|
276
|
+
@attributes[:download_uri] = value
|
277
|
+
end
|
278
|
+
|
279
|
+
# string - Bookmark/priority color of file/folder
|
280
|
+
def priority_color
|
281
|
+
@attributes[:priority_color]
|
282
|
+
end
|
283
|
+
|
284
|
+
def priority_color=(value)
|
285
|
+
@attributes[:priority_color] = value
|
286
|
+
end
|
287
|
+
|
288
|
+
# int64 - File preview ID
|
289
|
+
def preview_id
|
290
|
+
@attributes[:preview_id]
|
291
|
+
end
|
292
|
+
|
293
|
+
def preview_id=(value)
|
294
|
+
@attributes[:preview_id] = value
|
295
|
+
end
|
296
|
+
|
297
|
+
# File preview
|
298
|
+
def preview
|
299
|
+
@attributes[:preview]
|
300
|
+
end
|
301
|
+
|
302
|
+
def preview=(value)
|
303
|
+
@attributes[:preview] = value
|
304
|
+
end
|
305
|
+
|
306
|
+
def save
|
307
|
+
if @attributes[:path]
|
308
|
+
raise NotImplementedError.new("The Folder object doesn't support updates.")
|
309
|
+
else
|
310
|
+
new_obj = Folder.create(@attributes, @options)
|
311
|
+
@attributes = new_obj.attributes
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
# Parameters:
|
316
|
+
# page - int64 - Current page number.
|
317
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
318
|
+
# action - string - Action to take. Can be `count`, `count_nrs` (non recursive), `size`, `permissions`, or blank.
|
319
|
+
# path (required) - string - Path to operate on.
|
320
|
+
# cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor header.
|
321
|
+
# filter - string - If specified, will to filter folders/files list by this string. Wildcards of `*` and `?` are acceptable here.
|
322
|
+
# preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
|
323
|
+
# search - string - If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
|
324
|
+
# search_all - boolean - Search entire site?
|
325
|
+
# with_previews - boolean - Include file previews?
|
326
|
+
# with_priority_color - boolean - Include file priority color information?
|
327
|
+
def self.list_for(path, params = {}, options = {})
|
328
|
+
params ||= {}
|
329
|
+
params[:path] = path
|
330
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
331
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
332
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
333
|
+
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
334
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
|
335
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an String") if params.dig(:filter) and !params.dig(:filter).is_a?(String)
|
336
|
+
raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params.dig(:preview_size) and !params.dig(:preview_size).is_a?(String)
|
337
|
+
raise InvalidParameterError.new("Bad parameter: search must be an String") if params.dig(:search) and !params.dig(:search).is_a?(String)
|
338
|
+
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
339
|
+
|
340
|
+
List.new(File, params) do
|
341
|
+
Api.send_request("/folders/#{params[:path]}", :get, params, options)
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
# Parameters:
|
346
|
+
# path (required) - string - Path to operate on.
|
347
|
+
def self.create(path, params = {}, options = {})
|
348
|
+
params ||= {}
|
349
|
+
params[:path] = path
|
350
|
+
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
351
|
+
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
352
|
+
|
353
|
+
response, options = Api.send_request("/folders/#{params[:path]}", :post, params, options)
|
354
|
+
File.new(response.data, options)
|
355
|
+
end
|
356
|
+
end
|
357
|
+
end
|