aspose_storage_cloud 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1370bb8fe65f96fb1bf2220def3d6244d9ca15a6
4
+ data.tar.gz: 8adf9c834ea8776b199b3751321aabd773164a17
5
+ SHA512:
6
+ metadata.gz: a5188dede0e04a142d190cd15aeead7a93fe7551fce86f66b6d5ed4789b258b267827651c3e769fdf5ee538d73e9533ff351470979138e134a4f2fccee8f33d0
7
+ data.tar.gz: 545ced0308f92075fc8b9b72f04ac3493c8a2a96e83d90d184695a6d43f1031561950667b82a96701efeb00c65cf4fa917336f9176ca6d133bd191e039b1c21f
data/.gitignore ADDED
@@ -0,0 +1,36 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ ## Specific to RubyMotion:
14
+ .dat*
15
+ .repl_history
16
+ build/
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalization:
25
+ /.bundle/
26
+ /vendor/bundle
27
+ /lib/bundler/man/
28
+
29
+ # for a library or gem, you might want to ignore these files since the code is
30
+ # intended to run in multiple environments; otherwise, check them in:
31
+ # Gemfile.lock
32
+ .ruby-version
33
+ .ruby-gemset
34
+
35
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
36
+ .rvmrc
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2001-2014 Aspose Pty Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Aspose.Storage Cloud SDK For Ruby
2
+ This SDK lets you use [Aspose Cloud Storage APIs](http://api.aspose.com/v1.1/swagger/ui/index) in your web apps.
3
+
4
+ ## Installing
5
+ You can simply install AsposeStorageCloud with gem:
6
+
7
+ `gem install aspose_storage_cloud`
8
+
9
+ ## Usage
10
+ APIs of this SDK can be called as follows:
11
+
12
+ ```ruby
13
+ require 'aspose_storage_cloud'
14
+
15
+ class Storage
16
+
17
+ include AsposeStorageCloud
18
+
19
+ def initialize
20
+ #Get App key and App SID from https://cloud.aspose.com
21
+ AsposeApp.app_key_and_sid("APP_KEY", "APP_SID")
22
+ @storage_api = StorageApi.new
23
+ end
24
+
25
+ def get_aspose_disc_usage
26
+ #Check the disk usage of the current account.
27
+ disc_usage_response = @storage_api.get_disc_usage()
28
+ puts "Used Size: #{disc_usage_response.disc_usage.used_size} Total Size: #{disc_usage_response.disc_usage.total_size}"
29
+ end
30
+
31
+ end
32
+ ```
33
+ ## Unit Tests
34
+ Aspose Storage SDK includes a suite of unit tests within the [test](https://github.com/asposetotal/Aspose_Total_Cloud/blob/master/SDKs/Aspose.Storage_Cloud_SDK_For_Ruby/test/storage_tests.rb) subdirectory. These Unit Tests also serves as examples of how to use the Aspose Storage SDK.
35
+
36
+ ## Contact
37
+ Your feedback is very important to us. Please email us all your queries and feedback at marketplace@aspose.com.
38
+
39
+ ## License
40
+ Aspose Storage SDK is available under the MIT license. See the [LICENSE](https://github.com/asposetotal/Aspose_Total_Cloud/blob/master/SDKs/Aspose.Storage_Cloud_SDK_For_Ruby/LICENSE) file for more info.
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "aspose_storage_cloud/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "aspose_storage_cloud"
7
+ s.version = AsposeStorageCloud::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["M. Sohail Ismail"]
10
+ s.email = ["muhammad.sohail@aspose.com"]
11
+ s.homepage = "http://www.aspose.com/cloud/total-api.aspx"
12
+ s.summary = %q{A powerful API for web apps that work with files.}
13
+ s.description = %q{This SDK allows you to perform storage operations like download a specific file, upload a specific file, remove a specific file, move a specific file, get the file listing of a specific folder etc. on Aspose Cloud Storage.}
14
+ s.license = "MIT"
15
+
16
+ s.add_runtime_dependency 'typhoeus', '~> 0.8'
17
+ s.add_runtime_dependency 'json', '~> 1.7'
18
+
19
+ s.add_development_dependency 'minitest', '~> 5.8'
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- test/*`.split("\n")
23
+ s.executables = []
24
+ s.require_paths = ["lib"]
25
+ end
@@ -0,0 +1,41 @@
1
+
2
+ # Common files
3
+ require_relative 'aspose_storage_cloud/api_client'
4
+ require_relative 'aspose_storage_cloud/api_error'
5
+ require_relative 'aspose_storage_cloud/aspose_app'
6
+ require_relative 'aspose_storage_cloud/version'
7
+ require_relative 'aspose_storage_cloud/configuration'
8
+
9
+ # Models
10
+ require_relative 'aspose_storage_cloud/models/base_object'
11
+ require_relative 'aspose_storage_cloud/models/storage_exist_response'
12
+ require_relative 'aspose_storage_cloud/models/folder_response'
13
+ require_relative 'aspose_storage_cloud/models/file_response'
14
+ require_relative 'aspose_storage_cloud/models/base_response'
15
+ require_relative 'aspose_storage_cloud/models/file_exist_response'
16
+ require_relative 'aspose_storage_cloud/models/file_exist'
17
+ require_relative 'aspose_storage_cloud/models/disc_usage_response'
18
+ require_relative 'aspose_storage_cloud/models/disc_usage'
19
+ require_relative 'aspose_storage_cloud/models/file_versions_response'
20
+ require_relative 'aspose_storage_cloud/models/file_version'
21
+
22
+ # APIs
23
+ require_relative 'aspose_storage_cloud/api/storage_api'
24
+
25
+ module AsposeStorageCloud
26
+ class << self
27
+ # Configure sdk using block.
28
+ # AsposeStorageCloud.configure do |config|
29
+ # config.username = "xxx"
30
+ # config.password = "xxx"
31
+ # end
32
+ # If no block given, return the configuration singleton instance.
33
+ def configure
34
+ if block_given?
35
+ yield Configuration.instance
36
+ else
37
+ Configuration.instance
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,800 @@
1
+ require "uri"
2
+
3
+ module AsposeStorageCloud
4
+ class StorageApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = nil)
8
+ @api_client = api_client || Configuration.api_client
9
+ end
10
+
11
+ # Check the disk usage of the current account. Parameters: storage - user&#39;s storage name.
12
+ #
13
+ # @param [Hash] opts the optional parameters
14
+ # @option opts [String] :storage
15
+ # @return [DiscUsageResponse]
16
+ def get_disc_usage(opts = {})
17
+ if Configuration.debugging
18
+ Configuration.logger.debug "Calling API: StorageApi#get_disc_usage ..."
19
+ end
20
+
21
+ # resource path
22
+ path = "/storage/disc".sub('{format}','json')
23
+
24
+ # query parameters
25
+ query_params = {}
26
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
27
+
28
+ # header parameters
29
+ header_params = {}
30
+
31
+ # HTTP header 'Accept' (if needed)
32
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
33
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
34
+
35
+ # HTTP header 'Content-Type'
36
+ _header_content_type = []
37
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
38
+
39
+ # form parameters
40
+ form_params = {}
41
+
42
+ # http body (model)
43
+ post_body = nil
44
+
45
+
46
+ auth_names = []
47
+ result = @api_client.call_api(:GET, path,
48
+ :header_params => header_params,
49
+ :query_params => query_params,
50
+ :form_params => form_params,
51
+ :body => post_body,
52
+ :auth_names => auth_names,
53
+ :return_type => 'DiscUsageResponse')
54
+ if Configuration.debugging
55
+ Configuration.logger.debug "API called: StorageApi#get_disc_usage. Result: #{result.inspect}"
56
+ end
57
+ return result
58
+ end
59
+
60
+ # Check if a specific file or folder exists. Parameters: path - file or folder path e.g. /file.ext or /Folder1, versionID - file&#39;s version, storage - user&#39;s storage name.
61
+ #
62
+ # @param path
63
+ # @param [Hash] opts the optional parameters
64
+ # @option opts [String] :version_id
65
+ # @option opts [String] :storage
66
+ # @return [FileExistResponse]
67
+ def get_is_exist(path, opts = {})
68
+ if Configuration.debugging
69
+ Configuration.logger.debug "Calling API: StorageApi#get_is_exist ..."
70
+ end
71
+
72
+ # verify the required parameter 'path' is set
73
+ fail "Missing the required parameter 'path' when calling get_is_exist" if path.nil?
74
+
75
+ # resource path
76
+ path = "/storage/exist/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
77
+
78
+ # query parameters
79
+ query_params = {}
80
+ query_params[:'versionId'] = opts[:'version_id'] if opts[:'version_id']
81
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
82
+
83
+ # header parameters
84
+ header_params = {}
85
+
86
+ # HTTP header 'Accept' (if needed)
87
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
88
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
89
+
90
+ # HTTP header 'Content-Type'
91
+ _header_content_type = []
92
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
93
+
94
+ # form parameters
95
+ form_params = {}
96
+
97
+ # http body (model)
98
+ post_body = nil
99
+
100
+
101
+ auth_names = []
102
+ result = @api_client.call_api(:GET, path,
103
+ :header_params => header_params,
104
+ :query_params => query_params,
105
+ :form_params => form_params,
106
+ :body => post_body,
107
+ :auth_names => auth_names,
108
+ :return_type => 'FileExistResponse')
109
+ if Configuration.debugging
110
+ Configuration.logger.debug "API called: StorageApi#get_is_exist. Result: #{result.inspect}"
111
+ end
112
+ return result
113
+ end
114
+
115
+ # Download a specific file. Parameters: path - file path e.g. /file.ext, versionID - file&#39;s version, storage - user&#39;s storage name.
116
+ #
117
+ # @param path
118
+ # @param [Hash] opts the optional parameters
119
+ # @option opts [String] :version_id
120
+ # @option opts [String] :storage
121
+ # @return [File]
122
+ def get_download(path, opts = {})
123
+ if Configuration.debugging
124
+ Configuration.logger.debug "Calling API: StorageApi#get_download ..."
125
+ end
126
+
127
+ # verify the required parameter 'path' is set
128
+ fail "Missing the required parameter 'path' when calling get_download" if path.nil?
129
+
130
+ # resource path
131
+ path = "/storage/file/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
132
+
133
+ # query parameters
134
+ query_params = {}
135
+ query_params[:'versionId'] = opts[:'version_id'] if opts[:'version_id']
136
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
137
+
138
+ # header parameters
139
+ header_params = {}
140
+
141
+ # HTTP header 'Accept' (if needed)
142
+ _header_accept = ['multipart/form-data']
143
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
144
+
145
+ # HTTP header 'Content-Type'
146
+ _header_content_type = []
147
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
148
+
149
+ # form parameters
150
+ form_params = {}
151
+
152
+ # http body (model)
153
+ post_body = nil
154
+
155
+
156
+ auth_names = []
157
+ result = @api_client.call_api(:GET, path,
158
+ :header_params => header_params,
159
+ :query_params => query_params,
160
+ :form_params => form_params,
161
+ :body => post_body,
162
+ :auth_names => auth_names,
163
+ :return_type => 'File')
164
+ if Configuration.debugging
165
+ Configuration.logger.debug "API called: StorageApi#get_download. Result: #{result.inspect}"
166
+ end
167
+ return result
168
+ end
169
+
170
+ # Upload a specific file. Parameters: path - source file path e.g. /file.ext, versionID - source file&#39;s version, storage - user&#39;s source storage name, newdest - destination file path, destStorage - user&#39;s destination storage name.
171
+ #
172
+ # @param path
173
+ # @param file file to upload
174
+ # @param [Hash] opts the optional parameters
175
+ # @option opts [String] :version_id
176
+ # @option opts [String] :storage
177
+ # @return [BaseResponse]
178
+ def put_create(path, file, opts = {})
179
+ if Configuration.debugging
180
+ Configuration.logger.debug "Calling API: StorageApi#put_create ..."
181
+ end
182
+
183
+ # verify the required parameter 'path' is set
184
+ fail "Missing the required parameter 'path' when calling put_create" if path.nil?
185
+
186
+ # verify the required parameter 'file' is set
187
+ fail "Missing the required parameter 'file' when calling put_create" if file.nil?
188
+
189
+ # resource path
190
+ path = "/storage/file/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
191
+
192
+ # query parameters
193
+ query_params = {}
194
+ query_params[:'versionId'] = opts[:'version_id'] if opts[:'version_id']
195
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
196
+
197
+ # header parameters
198
+ header_params = {}
199
+
200
+ # HTTP header 'Accept' (if needed)
201
+ _header_accept = ['application/json', 'text/json', 'text/javascript']
202
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
203
+
204
+ # HTTP header 'Content-Type'
205
+ _header_content_type = ['multipart/form-data']
206
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
207
+
208
+ # form parameters
209
+ form_params = {}
210
+ form_params["file"] = file
211
+
212
+ # http body (model)
213
+ post_body = nil
214
+
215
+ auth_names = []
216
+ result = @api_client.call_api(:PUT, path,
217
+ :header_params => header_params,
218
+ :query_params => query_params,
219
+ :form_params => form_params,
220
+ :body => post_body,
221
+ :auth_names => auth_names,
222
+ :return_type => 'BaseResponse')
223
+ if Configuration.debugging
224
+ Configuration.logger.debug "API called: StorageApi#put_create. Result: #{result.inspect}"
225
+ end
226
+ return result
227
+ end
228
+
229
+ # Create the folder. Parameters: path - source folder path e.g. /Folder1, storage - user&#39;s source storage name, newdest - destination folder path e.g. /Folder2, destStorage - user&#39;s destination storage name.
230
+ #
231
+ # @param path
232
+ # @param [Hash] opts the optional parameters
233
+ # @option opts [String] :storage
234
+ # @option opts [String] :dest_storage
235
+ # @return [BaseResponse]
236
+ def put_create_folder(path, opts = {})
237
+ if Configuration.debugging
238
+ Configuration.logger.debug "Calling API: StorageApi#put_create_folder ..."
239
+ end
240
+
241
+ # verify the required parameter 'path' is set
242
+ fail "Missing the required parameter 'path' when calling put_create_folder" if path.nil?
243
+
244
+ # resource path
245
+ path = "/storage/folder/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
246
+
247
+ # query parameters
248
+ query_params = {}
249
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
250
+ query_params[:'destStorage'] = opts[:'dest_storage'] if opts[:'dest_storage']
251
+
252
+ # header parameters
253
+ header_params = {}
254
+
255
+ # HTTP header 'Accept' (if needed)
256
+ _header_accept = ['application/json', 'text/json', 'text/javascript']
257
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
258
+
259
+ # HTTP header 'Content-Type'
260
+ _header_content_type = []
261
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
262
+
263
+ # form parameters
264
+ form_params = {}
265
+
266
+ # http body (model)
267
+ post_body = nil
268
+
269
+
270
+ auth_names = []
271
+ result = @api_client.call_api(:PUT, path,
272
+ :header_params => header_params,
273
+ :query_params => query_params,
274
+ :form_params => form_params,
275
+ :body => post_body,
276
+ :auth_names => auth_names,
277
+ :return_type => 'BaseResponse')
278
+ if Configuration.debugging
279
+ Configuration.logger.debug "API called: StorageApi#put_create_folder. Result: #{result.inspect}"
280
+ end
281
+ return result
282
+ end
283
+
284
+ # Copy a specific file. Parameters: path - source file path e.g. /file.ext, versionID - source file&#39;s version, storage - user&#39;s source storage name, newdest - destination file path, destStorage - user&#39;s destination storage name.
285
+ #
286
+ # @param path
287
+ # @param newdest
288
+ # @param [Hash] opts the optional parameters
289
+ # @option opts [String] :version_id
290
+ # @option opts [String] :storage
291
+ # @option opts [String] :dest_storage
292
+ # @option opts [File] :file
293
+ # @return [BaseResponse]
294
+ def put_copy(path, newdest, opts = {})
295
+ if Configuration.debugging
296
+ Configuration.logger.debug "Calling API: StorageApi#put_copy ..."
297
+ end
298
+
299
+ # verify the required parameter 'path' is set
300
+ fail "Missing the required parameter 'path' when calling put_copy" if path.nil?
301
+
302
+ # verify the required parameter 'newdest' is set
303
+ fail "Missing the required parameter 'newdest' when calling put_copy" if newdest.nil?
304
+
305
+ # resource path
306
+ path = "/storage/file/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
307
+
308
+ # query parameters
309
+ query_params = {}
310
+ query_params[:'newdest'] = newdest
311
+ query_params[:'versionId'] = opts[:'version_id'] if opts[:'version_id']
312
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
313
+ query_params[:'destStorage'] = opts[:'dest_storage'] if opts[:'dest_storage']
314
+
315
+ # header parameters
316
+ header_params = {}
317
+
318
+ # HTTP header 'Accept' (if needed)
319
+ _header_accept = ['application/json', 'text/json', 'text/javascript']
320
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
321
+
322
+ # HTTP header 'Content-Type'
323
+ _header_content_type = []
324
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
325
+
326
+ # form parameters
327
+ form_params = {}
328
+ form_params["file"] = opts[:'file'] if opts[:'file']
329
+
330
+ # http body (model)
331
+ post_body = nil
332
+
333
+
334
+ auth_names = []
335
+ result = @api_client.call_api(:PUT, path,
336
+ :header_params => header_params,
337
+ :query_params => query_params,
338
+ :form_params => form_params,
339
+ :body => post_body,
340
+ :auth_names => auth_names,
341
+ :return_type => 'BaseResponse')
342
+ if Configuration.debugging
343
+ Configuration.logger.debug "API called: StorageApi#put_copy. Result: #{result.inspect}"
344
+ end
345
+ return result
346
+ end
347
+
348
+ # Remove a specific file. Parameters: path - file path e.g. /file.ext, versionID - file&#39;s version, storage - user&#39;s storage name.
349
+ #
350
+ # @param path
351
+ # @param [Hash] opts the optional parameters
352
+ # @option opts [String] :version_id
353
+ # @option opts [String] :storage
354
+ # @return [BaseResponse]
355
+ def delete_file(path, opts = {})
356
+ if Configuration.debugging
357
+ Configuration.logger.debug "Calling API: StorageApi#delete_file ..."
358
+ end
359
+
360
+ # verify the required parameter 'path' is set
361
+ fail "Missing the required parameter 'path' when calling delete_file" if path.nil?
362
+
363
+ # resource path
364
+ path = "/storage/file/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
365
+
366
+ # query parameters
367
+ query_params = {}
368
+ query_params[:'versionId'] = opts[:'version_id'] if opts[:'version_id']
369
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
370
+
371
+ # header parameters
372
+ header_params = {}
373
+
374
+ # HTTP header 'Accept' (if needed)
375
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
376
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
377
+
378
+ # HTTP header 'Content-Type'
379
+ _header_content_type = []
380
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
381
+
382
+ # form parameters
383
+ form_params = {}
384
+
385
+ # http body (model)
386
+ post_body = nil
387
+
388
+
389
+ auth_names = []
390
+ result = @api_client.call_api(:DELETE, path,
391
+ :header_params => header_params,
392
+ :query_params => query_params,
393
+ :form_params => form_params,
394
+ :body => post_body,
395
+ :auth_names => auth_names,
396
+ :return_type => 'BaseResponse')
397
+ if Configuration.debugging
398
+ Configuration.logger.debug "API called: StorageApi#delete_file. Result: #{result.inspect}"
399
+ end
400
+ return result
401
+ end
402
+
403
+ # Move a specific file.
404
+ #
405
+ # @param src source file path e.g. /file.ext
406
+ # @param dest
407
+ # @param [Hash] opts the optional parameters
408
+ # @option opts [String] :version_id source file&#39;s version,
409
+ # @option opts [String] :storage user&#39;s source storage name
410
+ # @option opts [String] :dest_storage user&#39;s destination storage name
411
+ # @return [BaseResponse]
412
+ def post_move_file(src, dest, opts = {})
413
+ if Configuration.debugging
414
+ Configuration.logger.debug "Calling API: StorageApi#post_move_file ..."
415
+ end
416
+
417
+ # verify the required parameter 'src' is set
418
+ fail "Missing the required parameter 'src' when calling post_move_file" if src.nil?
419
+
420
+ # verify the required parameter 'dest' is set
421
+ fail "Missing the required parameter 'dest' when calling post_move_file" if dest.nil?
422
+
423
+ # resource path
424
+ path = "/storage/file/{src}".sub('{format}','json').sub('{' + 'src' + '}', src.to_s)
425
+
426
+ # query parameters
427
+ query_params = {}
428
+ query_params[:'dest'] = dest
429
+ query_params[:'versionId'] = opts[:'version_id'] if opts[:'version_id']
430
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
431
+ query_params[:'destStorage'] = opts[:'dest_storage'] if opts[:'dest_storage']
432
+
433
+ # header parameters
434
+ header_params = {}
435
+
436
+ # HTTP header 'Accept' (if needed)
437
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
438
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
439
+
440
+ # HTTP header 'Content-Type'
441
+ _header_content_type = []
442
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
443
+
444
+ # form parameters
445
+ form_params = {}
446
+
447
+ # http body (model)
448
+ post_body = nil
449
+
450
+ auth_names = []
451
+ result = @api_client.call_api(:POST, path,
452
+ :header_params => header_params,
453
+ :query_params => query_params,
454
+ :form_params => form_params,
455
+ :body => post_body,
456
+ :auth_names => auth_names,
457
+ :return_type => 'BaseResponse')
458
+ if Configuration.debugging
459
+ Configuration.logger.debug "API called: StorageApi#post_move_file. Result: #{result.inspect}"
460
+ end
461
+ return result
462
+ end
463
+
464
+ # Get the file listing of a specific folder. Parametres: path - start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39;, storage - user&#39;s storage name.
465
+ #
466
+ # @param path
467
+ # @param [Hash] opts the optional parameters
468
+ # @option opts [String] :storage
469
+ # @return [FolderResponse]
470
+ def get_list_files(path, opts = {})
471
+ if Configuration.debugging
472
+ Configuration.logger.debug "Calling API: StorageApi#get_list_files ..."
473
+ end
474
+
475
+ # verify the required parameter 'path' is set
476
+ fail "Missing the required parameter 'path' when calling get_list_files" if path.nil?
477
+
478
+ # resource path
479
+ path = "/storage/folder/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
480
+
481
+ # query parameters
482
+ query_params = {}
483
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
484
+
485
+ # header parameters
486
+ header_params = {}
487
+
488
+ # HTTP header 'Accept' (if needed)
489
+ _header_accept = ['application/json', 'text/json', 'text/javascript']
490
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
491
+
492
+ # HTTP header 'Content-Type'
493
+ _header_content_type = []
494
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
495
+
496
+ # form parameters
497
+ form_params = {}
498
+
499
+ # http body (model)
500
+ post_body = nil
501
+
502
+
503
+ auth_names = []
504
+ result = @api_client.call_api(:GET, path,
505
+ :header_params => header_params,
506
+ :query_params => query_params,
507
+ :form_params => form_params,
508
+ :body => post_body,
509
+ :auth_names => auth_names,
510
+ :return_type => 'FolderResponse')
511
+ if Configuration.debugging
512
+ Configuration.logger.debug "API called: StorageApi#get_list_files. Result: #{result.inspect}"
513
+ end
514
+ return result
515
+ end
516
+
517
+ # Copy a folder. Parameters: path - source folder path e.g. /Folder1, storage - user&#39;s source storage name, newdest - destination folder path e.g. /Folder2, destStorage - user&#39;s destination storage name.
518
+ #
519
+ # @param path
520
+ # @param newdest
521
+ # @param [Hash] opts the optional parameters
522
+ # @option opts [String] :storage
523
+ # @option opts [String] :dest_storage
524
+ # @return [BaseResponse]
525
+ def put_copy_folder(path, newdest, opts = {})
526
+ if Configuration.debugging
527
+ Configuration.logger.debug "Calling API: StorageApi#put_copy_folder ..."
528
+ end
529
+
530
+ # verify the required parameter 'path' is set
531
+ fail "Missing the required parameter 'path' when calling put_copy_folder" if path.nil?
532
+
533
+ # verify the required parameter 'newdest' is set
534
+ fail "Missing the required parameter 'newdest' when calling put_copy_folder" if newdest.nil?
535
+
536
+ # resource path
537
+ path = "/storage/folder/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
538
+
539
+ # query parameters
540
+ query_params = {}
541
+ query_params[:'newdest'] = newdest
542
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
543
+ query_params[:'destStorage'] = opts[:'dest_storage'] if opts[:'dest_storage']
544
+
545
+ # header parameters
546
+ header_params = {}
547
+
548
+ # HTTP header 'Accept' (if needed)
549
+ _header_accept = ['application/json']
550
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
551
+
552
+ # HTTP header 'Content-Type'
553
+ _header_content_type = ['application/json']
554
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
555
+
556
+ # form parameters
557
+ form_params = {}
558
+
559
+ # http body (model)
560
+ post_body = nil
561
+
562
+
563
+ auth_names = []
564
+ result = @api_client.call_api(:PUT, path,
565
+ :header_params => header_params,
566
+ :query_params => query_params,
567
+ :form_params => form_params,
568
+ :body => post_body,
569
+ :auth_names => auth_names,
570
+ :return_type => 'BaseResponse')
571
+ if Configuration.debugging
572
+ Configuration.logger.debug "API called: StorageApi#put_copy_folder. Result: #{result.inspect}"
573
+ end
574
+ return result
575
+ end
576
+
577
+ # Remove a specific folder. Parameters: path - folder path e.g. /Folder1, storage - user&#39;s storage name, recursive - is subfolders and files must be deleted for specified path.
578
+ #
579
+ # @param path
580
+ # @param [Hash] opts the optional parameters
581
+ # @option opts [String] :storage
582
+ # @option opts [BOOLEAN] :recursive
583
+ # @return [BaseResponse]
584
+ def delete_folder(path, opts = {})
585
+ if Configuration.debugging
586
+ Configuration.logger.debug "Calling API: StorageApi#delete_folder ..."
587
+ end
588
+
589
+ # verify the required parameter 'path' is set
590
+ fail "Missing the required parameter 'path' when calling delete_folder" if path.nil?
591
+
592
+ # resource path
593
+ path = "/storage/folder/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
594
+
595
+ # query parameters
596
+ query_params = {}
597
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
598
+ query_params[:'recursive'] = opts[:'recursive'] if opts[:'recursive']
599
+
600
+ # header parameters
601
+ header_params = {}
602
+
603
+ # HTTP header 'Accept' (if needed)
604
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
605
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
606
+
607
+ # HTTP header 'Content-Type'
608
+ _header_content_type = []
609
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
610
+
611
+ # form parameters
612
+ form_params = {}
613
+
614
+ # http body (model)
615
+ post_body = nil
616
+
617
+
618
+ auth_names = []
619
+ result = @api_client.call_api(:DELETE, path,
620
+ :header_params => header_params,
621
+ :query_params => query_params,
622
+ :form_params => form_params,
623
+ :body => post_body,
624
+ :auth_names => auth_names,
625
+ :return_type => 'BaseResponse')
626
+ if Configuration.debugging
627
+ Configuration.logger.debug "API called: StorageApi#delete_folder. Result: #{result.inspect}"
628
+ end
629
+ return result
630
+ end
631
+
632
+ # Move a specific folder. Parameters: src - source folder path e.g. /Folder1, storage - user&#39;s source storage name, dest - destination folder path e.g. /Folder2, destStorage - user&#39;s destination storage name.
633
+ #
634
+ # @param src
635
+ # @param dest
636
+ # @param [Hash] opts the optional parameters
637
+ # @option opts [String] :storage
638
+ # @option opts [String] :dest_storage
639
+ # @return [BaseResponse]
640
+ def post_move_folder(src, dest, opts = {})
641
+ if Configuration.debugging
642
+ Configuration.logger.debug "Calling API: StorageApi#post_move_folder ..."
643
+ end
644
+
645
+ # verify the required parameter 'src' is set
646
+ fail "Missing the required parameter 'src' when calling post_move_folder" if src.nil?
647
+
648
+ # verify the required parameter 'dest' is set
649
+ fail "Missing the required parameter 'dest' when calling post_move_folder" if dest.nil?
650
+
651
+ # resource path
652
+ path = "/storage/folder/{src}".sub('{format}','json').sub('{' + 'src' + '}', src.to_s)
653
+
654
+ # query parameters
655
+ query_params = {}
656
+ query_params[:'dest'] = dest
657
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
658
+ query_params[:'destStorage'] = opts[:'dest_storage'] if opts[:'dest_storage']
659
+
660
+ # header parameters
661
+ header_params = {}
662
+
663
+ # HTTP header 'Accept' (if needed)
664
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
665
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
666
+
667
+ # HTTP header 'Content-Type'
668
+ _header_content_type = []
669
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
670
+
671
+ # form parameters
672
+ form_params = {}
673
+
674
+ # http body (model)
675
+ post_body = nil
676
+
677
+
678
+ auth_names = []
679
+ result = @api_client.call_api(:POST, path,
680
+ :header_params => header_params,
681
+ :query_params => query_params,
682
+ :form_params => form_params,
683
+ :body => post_body,
684
+ :auth_names => auth_names,
685
+ :return_type => 'BaseResponse')
686
+ if Configuration.debugging
687
+ Configuration.logger.debug "API called: StorageApi#post_move_folder. Result: #{result.inspect}"
688
+ end
689
+ return result
690
+ end
691
+
692
+ # Get the file&#39;s versions list. Parameters: path - file path e.g. /file.ext or /Folder1/file.ext, storage - user&#39;s storage name.
693
+ #
694
+ # @param path
695
+ # @param [Hash] opts the optional parameters
696
+ # @option opts [String] :storage
697
+ # @return [FileVersionsResponse]
698
+ def get_list_file_versions(path, opts = {})
699
+ if Configuration.debugging
700
+ Configuration.logger.debug "Calling API: StorageApi#get_list_file_versions ..."
701
+ end
702
+
703
+ # verify the required parameter 'path' is set
704
+ fail "Missing the required parameter 'path' when calling get_list_file_versions" if path.nil?
705
+
706
+ # resource path
707
+ path = "/storage/version/{path}".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)
708
+
709
+ # query parameters
710
+ query_params = {}
711
+ query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
712
+
713
+ # header parameters
714
+ header_params = {}
715
+
716
+ # HTTP header 'Accept' (if needed)
717
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
718
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
719
+
720
+ # HTTP header 'Content-Type'
721
+ _header_content_type = []
722
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
723
+
724
+ # form parameters
725
+ form_params = {}
726
+
727
+ # http body (model)
728
+ post_body = nil
729
+
730
+
731
+ auth_names = []
732
+ result = @api_client.call_api(:GET, path,
733
+ :header_params => header_params,
734
+ :query_params => query_params,
735
+ :form_params => form_params,
736
+ :body => post_body,
737
+ :auth_names => auth_names,
738
+ :return_type => 'FileVersionsResponse')
739
+ if Configuration.debugging
740
+ Configuration.logger.debug "API called: StorageApi#get_list_file_versions. Result: #{result.inspect}"
741
+ end
742
+ return result
743
+ end
744
+
745
+ # Check if a specific storage exists.
746
+ #
747
+ # @param name Storage name
748
+ # @param [Hash] opts the optional parameters
749
+ # @return [StorageExistResponse]
750
+ def get_is_storage_exist(name, opts = {})
751
+ if Configuration.debugging
752
+ Configuration.logger.debug "Calling API: StorageApi#get_is_storage_exist ..."
753
+ end
754
+
755
+ # verify the required parameter 'name' is set
756
+ fail "Missing the required parameter 'name' when calling get_is_storage_exist" if name.nil?
757
+
758
+ # resource path
759
+ path = "/storage/{name}/exist".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
760
+
761
+ # query parameters
762
+ query_params = {}
763
+
764
+ # header parameters
765
+ header_params = {}
766
+
767
+ # HTTP header 'Accept' (if needed)
768
+ _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
769
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
770
+
771
+ # HTTP header 'Content-Type'
772
+ _header_content_type = []
773
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
774
+
775
+ # form parameters
776
+ form_params = {}
777
+
778
+ # http body (model)
779
+ post_body = nil
780
+
781
+
782
+ auth_names = []
783
+ result = @api_client.call_api(:GET, path,
784
+ :header_params => header_params,
785
+ :query_params => query_params,
786
+ :form_params => form_params,
787
+ :body => post_body,
788
+ :auth_names => auth_names,
789
+ :return_type => 'StorageExistResponse')
790
+ if Configuration.debugging
791
+ Configuration.logger.debug "API called: StorageApi#get_is_storage_exist. Result: #{result.inspect}"
792
+ end
793
+ return result
794
+ end
795
+ end
796
+ end
797
+
798
+
799
+
800
+