aspose_html 1.0.0

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.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +12 -0
  3. data/Gemfile.lock +92 -0
  4. data/LICENSE +21 -0
  5. data/README.md +181 -0
  6. data/Rakefile +8 -0
  7. data/aspose_html.gemspec +58 -0
  8. data/docs/ConversionApi.md +837 -0
  9. data/docs/DocumentApi.md +386 -0
  10. data/docs/OcrApi.md +128 -0
  11. data/docs/SummarizationApi.md +111 -0
  12. data/docs/TranslationApi.md +126 -0
  13. data/docs/storage/DiscUsage.md +9 -0
  14. data/docs/storage/DiscUsageResponse.md +10 -0
  15. data/docs/storage/FileApi.md +240 -0
  16. data/docs/storage/FileDetail.md +13 -0
  17. data/docs/storage/FileDetailsResponse.md +10 -0
  18. data/docs/storage/FileExist.md +9 -0
  19. data/docs/storage/FileExistResponse.md +10 -0
  20. data/docs/storage/FileVersion.md +15 -0
  21. data/docs/storage/FileVersionsResponse.md +10 -0
  22. data/docs/storage/FolderApi.md +229 -0
  23. data/docs/storage/MessageResponse.md +9 -0
  24. data/docs/storage/MoveFileResponse.md +9 -0
  25. data/docs/storage/MoveFolderResponse.md +9 -0
  26. data/docs/storage/RemoveFileResponse.md +9 -0
  27. data/docs/storage/RemoveFolderResponse.md +9 -0
  28. data/docs/storage/StorageApi.md +217 -0
  29. data/docs/storage/StorageExistResponse.md +10 -0
  30. data/lib/aspose_html.rb +68 -0
  31. data/lib/aspose_html/api/html_api.rb +1900 -0
  32. data/lib/aspose_html/api/storage_api.rb +774 -0
  33. data/lib/aspose_html/api_client.rb +386 -0
  34. data/lib/aspose_html/api_error.rb +54 -0
  35. data/lib/aspose_html/configuration.rb +175 -0
  36. data/lib/aspose_html/models/disc_usage.rb +223 -0
  37. data/lib/aspose_html/models/disc_usage_response.rb +260 -0
  38. data/lib/aspose_html/models/file_detail.rb +254 -0
  39. data/lib/aspose_html/models/file_details_response.rb +262 -0
  40. data/lib/aspose_html/models/file_exist.rb +223 -0
  41. data/lib/aspose_html/models/file_exist_response.rb +274 -0
  42. data/lib/aspose_html/models/file_version.rb +273 -0
  43. data/lib/aspose_html/models/file_versions_response.rb +262 -0
  44. data/lib/aspose_html/models/message_response.rb +251 -0
  45. data/lib/aspose_html/models/move_file_response.rb +251 -0
  46. data/lib/aspose_html/models/move_folder_response.rb +251 -0
  47. data/lib/aspose_html/models/remove_file_response.rb +251 -0
  48. data/lib/aspose_html/models/remove_folder_response.rb +251 -0
  49. data/lib/aspose_html/models/storage_exist_response.rb +260 -0
  50. data/lib/aspose_html/version.rb +31 -0
  51. data/spec/api/html_api_spec.rb +971 -0
  52. data/spec/api/model_spec.rb +622 -0
  53. data/spec/api/storage_api_spec.rb +596 -0
  54. data/spec/spec_helper.rb +169 -0
  55. data/testdata/test.txt +1 -0
  56. data/testdata/test1.html +19 -0
  57. data/testdata/test1.html.zip +0 -0
  58. data/testdata/test2.html +46 -0
  59. data/testdata/test2.html.zip +0 -0
  60. data/testdata/test3.html.zip +0 -0
  61. data/testdata/test4.html.zip +0 -0
  62. data/testdata/test_download.jpg +0 -0
  63. data/testdata/test_en.html +46 -0
  64. data/testdata/test_for_delete.html +46 -0
  65. data/testdata/test_for_move.html +46 -0
  66. data/testdata/test_get_doc.zip +0 -0
  67. data/testdata/test_ocr.jpg +0 -0
  68. data/testdata/test_ocr.png +0 -0
  69. data/testdata/test_put_create.html +19 -0
  70. data/testdata/test_put_create.jpg +0 -0
  71. data/testresult/Convert_html.bmp +0 -0
  72. data/testresult/Convert_html.pdf +0 -0
  73. data/testresult/Convert_html.xps +0 -0
  74. data/testresult/Convert_url.pdf +0 -0
  75. data/testresult/Convert_url.png +0 -0
  76. data/testresult/Convert_url.xps +0 -0
  77. data/testresult/Get_document.zip +0 -0
  78. data/testresult/Get_fragment_css_by_url.html +447 -0
  79. data/testresult/Get_fragment_doc.html +9 -0
  80. data/testresult/Get_fragment_doc_css.html +9 -0
  81. data/testresult/Get_fragment_xpath_by_url.html +38 -0
  82. data/testresult/Get_images_doc.zip +0 -0
  83. data/testresult/Get_images_from_url.zip +0 -0
  84. data/testresult/Keyword_by_doc.json +1 -0
  85. data/testresult/Keyword_by_url.json +1 -0
  86. data/testresult/Recognize_en_png.html +10 -0
  87. data/testresult/Translate_url_en_fr.zip +0 -0
  88. data/testresult/putTest.pdf +0 -0
  89. data/testresult/putTest.png +0 -0
  90. data/testresult/putTest.xps +0 -0
  91. data/testresult/putTestDoc.pdf +0 -0
  92. data/testresult/putTestDoc.tiff +0 -0
  93. data/testresult/putTestDoc.xps +0 -0
  94. data/testresult/test_download.jpg +0 -0
  95. metadata +320 -0
@@ -0,0 +1,774 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ --------------------------------------------------------------------------------------------------------------------
4
+ <copyright company="Aspose" file="storage_api.rb">
5
+ </copyright>
6
+ Copyright (c) 2018 Aspose.HTML for Cloud
7
+ <summary>
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+ </summary>
26
+ --------------------------------------------------------------------------------------------------------------------
27
+ =end
28
+
29
+ require "uri"
30
+
31
+ module AsposeHtml
32
+ class StorageApi
33
+ attr_accessor :api_client
34
+
35
+ def initialize(args)
36
+ @api_client = AsposeHtml::ApiClient.default(args)
37
+ end
38
+
39
+
40
+ ################################################################################
41
+ # Storage Api
42
+ ################################################################################
43
+
44
+
45
+ # Check the disk usage of the current account
46
+ #
47
+ # @param [Hash] opts the optional parameters
48
+ # @option opts [String] :storage User&#39;s storage name
49
+ # @return [DiscUsageResponse]
50
+ def get_disc_usage(opts = {})
51
+ data, _status_code, _headers = get_disc_usage_with_http_info(opts)
52
+ data
53
+ end
54
+
55
+ # Check the disk usage of the current account
56
+ #
57
+ # @param [Hash] opts the optional parameters
58
+ # @option opts [String] :storage User&#39;s storage name
59
+ # @return [Array<(DiscUsageResponse, Fixnum, Hash)>] DiscUsageResponse data, response status code and response headers
60
+ def get_disc_usage_with_http_info(opts = {})
61
+ if @api_client.config.debug
62
+ @api_client.config.logger.debug "Calling API: StorageApi.get_disc_usage ..."
63
+ end
64
+ # resource path
65
+ local_var_path = "/storage/disc"
66
+
67
+ # query parameters
68
+ query_params = {}
69
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
70
+
71
+ # header parameters
72
+ header_params = {}
73
+ # HTTP header 'Accept' (if needed)
74
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
75
+ # HTTP header 'Content-Type'
76
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
77
+
78
+ # form parameters
79
+ form_params = {}
80
+
81
+ # http body (model)
82
+ post_body = nil
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :return_type => 'DiscUsageResponse')
89
+ if @api_client.config.debug
90
+ @api_client.config.logger.debug "API called: StorageApi#get_disc_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Check if a specific file or folder exists
96
+ #
97
+ # @param path File or folder path e.g. /file.ext or /Folder1
98
+ # @param [Hash] opts the optional parameters
99
+ # @option opts [String] :version_id File&#39;s version
100
+ # @option opts [String] :storage User&#39;s storage name
101
+ # @return [FileExistResponse]
102
+ def get_is_exist(path, opts = {})
103
+ data, _status_code, _headers = get_is_exist_with_http_info(path, opts)
104
+ data
105
+ end
106
+
107
+ # Check if a specific file or folder exists
108
+ #
109
+ # @param path File or folder path e.g. /file.ext or /Folder1
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [String] :version_id File&#39;s version
112
+ # @option opts [String] :storage User&#39;s storage name
113
+ # @return [Array<(FileExistResponse, Fixnum, Hash)>] FileExistResponse data, response status code and response headers
114
+ def get_is_exist_with_http_info(path, opts = {})
115
+ if @api_client.config.debug
116
+ @api_client.config.logger.debug "Calling API: StorageApi.get_is_exist ..."
117
+ end
118
+ # verify the required parameter 'path' is set
119
+ if @api_client.config.client_side_validation && path.nil?
120
+ fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.get_is_exist"
121
+ end
122
+ # resource path
123
+ local_var_path = "/storage/exist"
124
+
125
+ # query parameters
126
+ query_params = {}
127
+ query_params[:'path'] = path
128
+ query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
129
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
130
+
131
+ # header parameters
132
+ header_params = {}
133
+ # HTTP header 'Accept' (if needed)
134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
135
+ # HTTP header 'Content-Type'
136
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
137
+
138
+ # form parameters
139
+ form_params = {}
140
+
141
+ # http body (model)
142
+ post_body = nil
143
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :return_type => 'FileExistResponse')
149
+ if @api_client.config.debug
150
+ @api_client.config.logger.debug "API called: StorageApi#get_is_exist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # Check if storage exists
156
+ #
157
+ # @param name Storage name
158
+ # @return [StorageExistResponse]
159
+ def get_is_storage_exist(name)
160
+ data, _status_code, _headers = get_is_storage_exist_with_http_info(name)
161
+ data
162
+ end
163
+
164
+ # Check if storage exists
165
+ #
166
+ # @param name Storage name
167
+ # @return [Array<(StorageExistResponse, Fixnum, Hash)>] StorageExistResponse data, response status code and response headers
168
+ def get_is_storage_exist_with_http_info(name)
169
+ if @api_client.config.debug
170
+ @api_client.config.logger.debug "Calling API: StorageApi.get_is_storage_exist ..."
171
+ end
172
+ # verify the required parameter 'name' is set
173
+ if @api_client.config.client_side_validation && name.nil?
174
+ fail ArgumentError, "Missing the required parameter 'name' when calling StorageApi.get_is_storage_exist"
175
+ end
176
+ # resource path
177
+ local_var_path = "/storage/{name}/exist".sub('{' + 'name' + '}', name.to_s)
178
+
179
+ # query parameters
180
+ query_params = {}
181
+
182
+ # header parameters
183
+ header_params = {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
186
+ # HTTP header 'Content-Type'
187
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
188
+
189
+ # form parameters
190
+ form_params = {}
191
+
192
+ # http body (model)
193
+ post_body = nil
194
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :return_type => 'StorageExistResponse')
200
+ if @api_client.config.debug
201
+ @api_client.config.logger.debug "API called: StorageApi#get_is_storage_exist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
202
+ end
203
+ return data, status_code, headers
204
+ end
205
+
206
+ # Get the file's versions list
207
+ #
208
+ # @param path File path e.g. /file.ext or /Folder1/file.ext
209
+ # @param [Hash] opts the optional parameters
210
+ # @option opts [String] :storage User&#39;s storage name
211
+ # @return [FileVersionsResponse]
212
+ def get_list_file_versions(path, opts = {})
213
+ data, _status_code, _headers = get_list_file_versions_with_http_info(path, opts)
214
+ data
215
+ end
216
+
217
+ # Get the file&#39;s versions list
218
+ #
219
+ # @param path File path e.g. /file.ext or /Folder1/file.ext
220
+ # @param [Hash] opts the optional parameters
221
+ # @option opts [String] :storage User&#39;s storage name
222
+ # @return [Array<(FileVersionsResponse, Fixnum, Hash)>] FileVersionsResponse data, response status code and response headers
223
+ def get_list_file_versions_with_http_info(path, opts = {})
224
+ if @api_client.config.debug
225
+ @api_client.config.logger.debug "Calling API: StorageApi.get_list_file_versions ..."
226
+ end
227
+ # verify the required parameter 'path' is set
228
+ if @api_client.config.client_side_validation && path.nil?
229
+ fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.get_list_file_versions"
230
+ end
231
+ # resource path
232
+ local_var_path = "/storage/version"
233
+
234
+ # query parameters
235
+ query_params = {}
236
+ query_params[:'path'] = path
237
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
238
+
239
+ # header parameters
240
+ header_params = {}
241
+ # HTTP header 'Accept' (if needed)
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
243
+ # HTTP header 'Content-Type'
244
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
245
+
246
+ # form parameters
247
+ form_params = {}
248
+
249
+ # http body (model)
250
+ post_body = nil
251
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
252
+ :header_params => header_params,
253
+ :query_params => query_params,
254
+ :form_params => form_params,
255
+ :body => post_body,
256
+ :return_type => 'FileVersionsResponse')
257
+ if @api_client.config.debug
258
+ @api_client.config.logger.debug "API called: StorageApi#get_list_file_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
259
+ end
260
+ return data, status_code, headers
261
+ end
262
+
263
+
264
+ ################################################################################
265
+ # File Api
266
+ ################################################################################
267
+
268
+
269
+ # Remove a specific file
270
+ #
271
+ # @param path Path of the file including file name and extension e.g. /Folder1/file.ext
272
+ # @param [Hash] opts the optional parameters
273
+ # @option opts [String] :version_id File&#39;s version
274
+ # @option opts [String] :storage User&#39;s storage name
275
+ # @return [RemoveFileResponse]
276
+ def delete_file(path, opts = {})
277
+ data, _status_code, _headers = delete_file_with_http_info(path, opts)
278
+ data
279
+ end
280
+
281
+ # Remove a specific file
282
+ #
283
+ # @param path Path of the file including file name and extension e.g. /Folder1/file.ext
284
+ # @param [Hash] opts the optional parameters
285
+ # @option opts [String] :version_id File&#39;s version
286
+ # @option opts [String] :storage User&#39;s storage name
287
+ # @return [Array<(RemoveFileResponse, Fixnum, Hash)>] RemoveFileResponse data, response status code and response headers
288
+ def delete_file_with_http_info(path, opts = {})
289
+ if @api_client.config.debug
290
+ @api_client.config.logger.debug "Calling API: FileApi.delete_file ..."
291
+ end
292
+ # verify the required parameter 'path' is set
293
+ if @api_client.config.client_side_validation && path.nil?
294
+ fail ArgumentError, "Missing the required parameter 'path' when calling FileApi.delete_file"
295
+ end
296
+ # resource path
297
+ local_var_path = "/storage/file"
298
+
299
+ # query parameters
300
+ query_params = {}
301
+ query_params[:'path'] = path
302
+ query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
303
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
304
+
305
+ # header parameters
306
+ header_params = {}
307
+ # HTTP header 'Accept' (if needed)
308
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
309
+ # HTTP header 'Content-Type'
310
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
311
+
312
+ # form parameters
313
+ form_params = {}
314
+
315
+ # http body (model)
316
+ post_body = nil
317
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
318
+ :header_params => header_params,
319
+ :query_params => query_params,
320
+ :form_params => form_params,
321
+ :body => post_body,
322
+ :return_type => 'RemoveFileResponse')
323
+ if @api_client.config.debug
324
+ @api_client.config.logger.debug "API called: FileApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
325
+ end
326
+ return data, status_code, headers
327
+ end
328
+
329
+ # Download a specific file
330
+ #
331
+ # @param path Path of the file including the file name and extension e.g. /file.ext
332
+ # @param [Hash] opts the optional parameters
333
+ # @option opts [String] :version_id File&#39;s version
334
+ # @option opts [String] :storage User&#39;s storage name
335
+ # @return [File]
336
+ def get_download(path, opts = {})
337
+ data, _status_code, _headers = get_download_with_http_info(path, opts)
338
+ status = _status_code == 200 ? "OK" : "Error"
339
+ {file: data, code: _status_code, status: status}
340
+ end
341
+
342
+ # Download a specific file
343
+ #
344
+ # @param path Path of the file including the file name and extension e.g. /file.ext
345
+ # @param [Hash] opts the optional parameters
346
+ # @option opts [String] :version_id File&#39;s version
347
+ # @option opts [String] :storage User&#39;s storage name
348
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
349
+ def get_download_with_http_info(path, opts = {})
350
+ if @api_client.config.debug
351
+ @api_client.config.logger.debug "Calling API: FileApi.get_download ..."
352
+ end
353
+ # verify the required parameter 'path' is set
354
+ if @api_client.config.client_side_validation && path.nil?
355
+ fail ArgumentError, "Missing the required parameter 'path' when calling FileApi.get_download"
356
+ end
357
+ # resource path
358
+ local_var_path = "/storage/file"
359
+
360
+ # query parameters
361
+ query_params = {}
362
+ query_params[:'path'] = path
363
+ query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
364
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
365
+
366
+ # header parameters
367
+ header_params = {}
368
+ # HTTP header 'Accept' (if needed)
369
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
370
+ # HTTP header 'Content-Type'
371
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
372
+
373
+ # form parameters
374
+ form_params = {}
375
+
376
+ # http body (model)
377
+ post_body = nil
378
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
379
+ :header_params => header_params,
380
+ :query_params => query_params,
381
+ :form_params => form_params,
382
+ :body => post_body,
383
+ :return_type => 'File')
384
+ if @api_client.config.debug
385
+ @api_client.config.logger.debug "API called: FileApi#get_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
386
+ end
387
+ return data, status_code, headers
388
+ end
389
+
390
+ # Move a specific file
391
+ #
392
+ # @param src Source file path e.g. /fileSource.ext
393
+ # @param dest Destination file path e.g. /fileDestination.ext
394
+ # @param [Hash] opts the optional parameters
395
+ # @option opts [String] :version_id Source file&#39;s version,
396
+ # @option opts [String] :storage User&#39;s source storage name
397
+ # @option opts [String] :dest_storage User&#39;s destination storage name
398
+ # @return [MoveFileResponse]
399
+ def post_move_file(src, dest, opts = {})
400
+ data, _status_code, _headers = post_move_file_with_http_info(src, dest, opts)
401
+ data
402
+ end
403
+
404
+ # Move a specific file
405
+ #
406
+ # @param src Source file path e.g. /fileSource.ext
407
+ # @param dest Destination file path e.g. /fileDestination.ext
408
+ # @param [Hash] opts the optional parameters
409
+ # @option opts [String] :version_id Source file&#39;s version,
410
+ # @option opts [String] :storage User&#39;s source storage name
411
+ # @option opts [String] :dest_storage User&#39;s destination storage name
412
+ # @return [Array<(MoveFileResponse, Fixnum, Hash)>] MoveFileResponse data, response status code and response headers
413
+ def post_move_file_with_http_info(src, dest, opts = {})
414
+ if @api_client.config.debug
415
+ @api_client.config.logger.debug "Calling API: FileApi.post_move_file ..."
416
+ end
417
+ # verify the required parameter 'src' is set
418
+ if @api_client.config.client_side_validation && src.nil?
419
+ fail ArgumentError, "Missing the required parameter 'src' when calling FileApi.post_move_file"
420
+ end
421
+ # verify the required parameter 'dest' is set
422
+ if @api_client.config.client_side_validation && dest.nil?
423
+ fail ArgumentError, "Missing the required parameter 'dest' when calling FileApi.post_move_file"
424
+ end
425
+ # resource path
426
+ local_var_path = "/storage/file"
427
+
428
+ # query parameters
429
+ query_params = {}
430
+ query_params[:'src'] = src
431
+ query_params[:'dest'] = dest
432
+ query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
433
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
434
+ query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].nil?
435
+
436
+ # header parameters
437
+ header_params = {}
438
+ # HTTP header 'Accept' (if needed)
439
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
440
+ # HTTP header 'Content-Type'
441
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
442
+
443
+ # form parameters
444
+ form_params = {}
445
+
446
+ # http body (model)
447
+ post_body = nil
448
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
449
+ :header_params => header_params,
450
+ :query_params => query_params,
451
+ :form_params => form_params,
452
+ :body => post_body,
453
+ :return_type => 'MoveFileResponse')
454
+ if @api_client.config.debug
455
+ @api_client.config.logger.debug "API called: FileApi#post_move_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
456
+ end
457
+ return data, status_code, headers
458
+ end
459
+
460
+ # Upload a specific file
461
+ #
462
+ # @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext
463
+ # @param file File to upload
464
+ # @param [Hash] opts the optional parameters
465
+ # @option opts [String] :version_id Source file&#39;s version
466
+ # @option opts [String] :storage User&#39;s storage name
467
+ # @return [MessageResponse]
468
+ def put_create(path, file, opts = {})
469
+ data, _status_code, _headers = put_create_with_http_info(path, file, opts)
470
+ data
471
+ end
472
+
473
+ # Upload a specific file
474
+ #
475
+ # @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext
476
+ # @param file File to upload
477
+ # @param [Hash] opts the optional parameters
478
+ # @option opts [String] :version_id Source file&#39;s version
479
+ # @option opts [String] :storage User&#39;s storage name
480
+ # @return [Array<(MessageResponse, Fixnum, Hash)>] MessageResponse, response status code and response headers
481
+ def put_create_with_http_info(path, file, opts = {})
482
+ if @api_client.config.debug
483
+ @api_client.config.logger.debug "Calling API: FileApi.put_create ..."
484
+ end
485
+ # verify the required parameter 'path' is set
486
+ if @api_client.config.client_side_validation && path.nil?
487
+ fail ArgumentError, "Missing the required parameter 'path' when calling FileApi.put_create"
488
+ end
489
+ # verify the required parameter 'file' is set
490
+ if @api_client.config.client_side_validation && file.nil?
491
+ fail ArgumentError, "Missing the required parameter 'file' when calling FileApi.put_create"
492
+ end
493
+ # resource path
494
+ local_var_path = "/storage/file"
495
+
496
+ # query parameters
497
+ query_params = {}
498
+ query_params[:'path'] = path
499
+ query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
500
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
501
+
502
+ # header parameters
503
+ header_params = {}
504
+ # HTTP header 'Accept' (if needed)
505
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
506
+ # HTTP header 'Content-Type'
507
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
508
+
509
+ # form parameters
510
+ form_params = {}
511
+
512
+ # http body (model)
513
+ post_body = ::File.open(file,"rb").read
514
+
515
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
516
+ :header_params => header_params,
517
+ :query_params => query_params,
518
+ :form_params => form_params,
519
+ :body => post_body,
520
+ :return_type => 'MessageResponse')
521
+ if @api_client.config.debug
522
+ @api_client.config.logger.debug "API called: FileApi#put_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
523
+ end
524
+ return data, status_code, headers
525
+ end
526
+
527
+
528
+ ################################################################################
529
+ # Folder Api
530
+ ################################################################################
531
+
532
+
533
+ # Remove a specific folder
534
+ #
535
+ # @param path Folder path e.g. /Folder1
536
+ # @param [Hash] opts the optional parameters
537
+ # @option opts [String] :storage User&#39;s storage name
538
+ # @option opts [BOOLEAN] :recursive Remove recursivelly inner folder/files. If false and folder contains data than exception is raised. (default to false)
539
+ # @return [RemoveFolderResponse]
540
+ def delete_folder(path, opts = {})
541
+ data, _status_code, _headers = delete_folder_with_http_info(path, opts)
542
+ data
543
+ end
544
+
545
+ # Remove a specific folder
546
+ #
547
+ # @param path Folder path e.g. /Folder1
548
+ # @param [Hash] opts the optional parameters
549
+ # @option opts [String] :storage User&#39;s storage name
550
+ # @option opts [BOOLEAN] :recursive Remove recursivelly inner folder/files. If false and folder contains data than exception is raised.
551
+ # @return [Array<(RemoveFolderResponse, Fixnum, Hash)>] RemoveFolderResponse data, response status code and response headers
552
+ def delete_folder_with_http_info(path, opts = {})
553
+ if @api_client.config.debug
554
+ @api_client.config.logger.debug "Calling API: FolderApi.delete_folder ..."
555
+ end
556
+ # verify the required parameter 'path' is set
557
+ if @api_client.config.client_side_validation && path.nil?
558
+ fail ArgumentError, "Missing the required parameter 'path' when calling FolderApi.delete_folder"
559
+ end
560
+ # resource path
561
+ local_var_path = "/storage/folder"
562
+
563
+ # query parameters
564
+ query_params = {}
565
+ query_params[:'path'] = path
566
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
567
+ query_params[:'recursive'] = opts[:'recursive'] if !opts[:'recursive'].nil?
568
+
569
+ # header parameters
570
+ header_params = {}
571
+ # HTTP header 'Accept' (if needed)
572
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
573
+ # HTTP header 'Content-Type'
574
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
575
+
576
+ # form parameters
577
+ form_params = {}
578
+
579
+ # http body (model)
580
+ post_body = nil
581
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
582
+ :header_params => header_params,
583
+ :query_params => query_params,
584
+ :form_params => form_params,
585
+ :body => post_body,
586
+ :return_type => 'RemoveFolderResponse')
587
+ if @api_client.config.debug
588
+ @api_client.config.logger.debug "API called: FolderApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
589
+ end
590
+ return data, status_code, headers
591
+ end
592
+
593
+ # Get the file listing of a specific folder
594
+ #
595
+ # @param [Hash] opts the optional parameters
596
+ # @option opts [String] :path Start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39; (default to /)
597
+ # @option opts [String] :storage User&#39;s storage name
598
+ # @return [FileDetailsResponse]
599
+ def get_list_files(opts = {})
600
+ data, _status_code, _headers = get_list_files_with_http_info(opts)
601
+ data
602
+ end
603
+
604
+ # Get the file listing of a specific folder
605
+ #
606
+ # @param [Hash] opts the optional parameters
607
+ # @option opts [String] :path Start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39;
608
+ # @option opts [String] :storage User&#39;s storage name
609
+ # @return [Array<(FileDetailsResponse, Fixnum, Hash)>] File data, response status code and response headers
610
+ def get_list_files_with_http_info(opts = {})
611
+ if @api_client.config.debug
612
+ @api_client.config.logger.debug "Calling API: FolderApi.get_list_files ..."
613
+ end
614
+ # resource path
615
+ local_var_path = "/storage/folder"
616
+
617
+ # query parameters
618
+ query_params = {}
619
+ query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
620
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
621
+
622
+ # header parameters
623
+ header_params = {}
624
+ # HTTP header 'Accept' (if needed)
625
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
626
+ # HTTP header 'Content-Type'
627
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
628
+
629
+ # form parameters
630
+ form_params = {}
631
+
632
+ # http body (model)
633
+ post_body = nil
634
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
635
+ :header_params => header_params,
636
+ :query_params => query_params,
637
+ :form_params => form_params,
638
+ :body => post_body,
639
+ :return_type => 'FileDetailsResponse')
640
+ if @api_client.config.debug
641
+ @api_client.config.logger.debug "API called: FolderApi#get_list_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
642
+ end
643
+ return data, status_code, headers
644
+ end
645
+
646
+ # Move a specific folder
647
+ #
648
+ # @param src Source folder path e.g. /Folder1
649
+ # @param dest Destination folder path e.g. /Folder2
650
+ # @param [Hash] opts the optional parameters
651
+ # @option opts [String] :storage User&#39;s source storage name
652
+ # @option opts [String] :dest_storage User&#39;s destination storage name
653
+ # @return [MoveFolderResponse]
654
+ def post_move_folder(src, dest, opts = {})
655
+ data, _status_code, _headers = post_move_folder_with_http_info(src, dest, opts)
656
+ data
657
+ end
658
+
659
+ # Move a specific folder
660
+ #
661
+ # @param src Source folder path e.g. /Folder1
662
+ # @param dest Destination folder path e.g. /Folder2
663
+ # @param [Hash] opts the optional parameters
664
+ # @option opts [String] :storage User&#39;s source storage name
665
+ # @option opts [String] :dest_storage User&#39;s destination storage name
666
+ # @return [Array<(MoveFolderResponse, Fixnum, Hash)>] MoveFolderResponse data, response status code and response headers
667
+ def post_move_folder_with_http_info(src, dest, opts = {})
668
+ if @api_client.config.debug
669
+ @api_client.config.logger.debug "Calling API: FolderApi.post_move_folder ..."
670
+ end
671
+ # verify the required parameter 'src' is set
672
+ if @api_client.config.client_side_validation && src.nil?
673
+ fail ArgumentError, "Missing the required parameter 'src' when calling FolderApi.post_move_folder"
674
+ end
675
+ # verify the required parameter 'dest' is set
676
+ if @api_client.config.client_side_validation && dest.nil?
677
+ fail ArgumentError, "Missing the required parameter 'dest' when calling FolderApi.post_move_folder"
678
+ end
679
+ # resource path
680
+ local_var_path = "/storage/folder"
681
+
682
+ # query parameters
683
+ query_params = {}
684
+ query_params[:'src'] = src
685
+ query_params[:'dest'] = dest
686
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
687
+ query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].nil?
688
+
689
+ # header parameters
690
+ header_params = {}
691
+ # HTTP header 'Accept' (if needed)
692
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
693
+ # HTTP header 'Content-Type'
694
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
695
+
696
+ # form parameters
697
+ form_params = {}
698
+
699
+ # http body (model)
700
+ post_body = nil
701
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
702
+ :header_params => header_params,
703
+ :query_params => query_params,
704
+ :form_params => form_params,
705
+ :body => post_body,
706
+ :return_type => 'MoveFolderResponse')
707
+ if @api_client.config.debug
708
+ @api_client.config.logger.debug "API called: FolderApi#post_move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
709
+ end
710
+ return data, status_code, headers
711
+ end
712
+
713
+ # Create the folder
714
+ #
715
+ # @param path [String] Target folder path e.g. Folder1/Folder2/. The folders will be created recursively
716
+ # @param [Hash] opts the optional parameters
717
+ # @option opts [String] :storage User&#39;s source storage name
718
+ # @option opts [String] :dest_storage User&#39;s destination storage name
719
+ # @return [MessageResponse]
720
+ def put_create_folder(path, opts = {})
721
+ data, _status_code, _headers = put_create_folder_with_http_info(path, opts)
722
+ data
723
+ end
724
+
725
+ # Create the folder
726
+ #
727
+ # @param path Target folder&#39;s path e.g. Folder1/Folder2/. The folders will be created recursively
728
+ # @param [Hash] opts the optional parameters
729
+ # @option opts [String] :storage User&#39;s source storage name
730
+ # @option opts [String] :dest_storage User&#39;s destination storage name
731
+ # @return [Array<(MessageResponse, Fixnum, Hash)>] MessageResponse, response status code and response headers
732
+ def put_create_folder_with_http_info(path, opts = {})
733
+ if @api_client.config.debug
734
+ @api_client.config.logger.debug "Calling API: FolderApi.put_create_folder ..."
735
+ end
736
+ # verify the required parameter 'path' is set
737
+ if @api_client.config.client_side_validation && path.nil?
738
+ fail ArgumentError, "Missing the required parameter 'path' when calling FolderApi.put_create_folder"
739
+ end
740
+ # resource path
741
+ local_var_path = "/storage/folder"
742
+
743
+ # query parameters
744
+ query_params = {}
745
+ query_params[:'path'] = path
746
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
747
+ query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].nil?
748
+
749
+ # header parameters
750
+ header_params = {}
751
+ # HTTP header 'Accept' (if needed)
752
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
753
+ # HTTP header 'Content-Type'
754
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
755
+
756
+ # form parameters
757
+ form_params = {}
758
+
759
+ # http body (model)
760
+ post_body = nil
761
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
762
+ :header_params => header_params,
763
+ :query_params => query_params,
764
+ :form_params => form_params,
765
+ :body => post_body,
766
+ :return_type => 'MessageResponse')
767
+ if @api_client.config.debug
768
+ @api_client.config.logger.debug "API called: FolderApi#put_create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
769
+ end
770
+ return data, status_code, headers
771
+ end
772
+
773
+ end
774
+ end