groupdocs_viewer_cloud 18.11 → 19.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_viewer_cloud.rb +27 -32
  3. data/lib/groupdocs_viewer_cloud/api/file_api.rb +729 -0
  4. data/lib/groupdocs_viewer_cloud/api/folder_api.rb +694 -0
  5. data/lib/groupdocs_viewer_cloud/api/storage_api.rb +541 -0
  6. data/lib/groupdocs_viewer_cloud/api/viewer_api.rb +232 -5069
  7. data/lib/groupdocs_viewer_cloud/api_client.rb +5 -5
  8. data/lib/groupdocs_viewer_cloud/api_error.rb +6 -6
  9. data/lib/groupdocs_viewer_cloud/configuration.rb +4 -4
  10. data/lib/groupdocs_viewer_cloud/models/attachment_info.rb +22 -34
  11. data/lib/groupdocs_viewer_cloud/models/{html_page.rb → attachment_view.rb} +39 -33
  12. data/lib/groupdocs_viewer_cloud/models/cad_options.rb +44 -65
  13. data/lib/groupdocs_viewer_cloud/models/{font_family.rb → delete_view_options.rb} +25 -17
  14. data/lib/groupdocs_viewer_cloud/models/{reorder_options.rb → disc_usage.rb} +42 -34
  15. data/lib/groupdocs_viewer_cloud/models/email_options.rb +23 -25
  16. data/lib/groupdocs_viewer_cloud/models/{image_page_collection.rb → error.rb} +46 -40
  17. data/lib/groupdocs_viewer_cloud/models/{outlook_options.rb → error_details.rb} +40 -17
  18. data/lib/groupdocs_viewer_cloud/models/field_label.rb +20 -12
  19. data/lib/groupdocs_viewer_cloud/models/{transform_options_base.rb → file_info.rb} +49 -21
  20. data/lib/groupdocs_viewer_cloud/models/{html_attachment_page_collection.rb → file_version.rb} +91 -40
  21. data/lib/groupdocs_viewer_cloud/models/{page_info_collection.rb → file_versions.rb} +26 -18
  22. data/lib/groupdocs_viewer_cloud/models/{font_collection.rb → files_list.rb} +26 -18
  23. data/lib/groupdocs_viewer_cloud/models/{image_page.rb → files_upload_result.rb} +36 -24
  24. data/lib/groupdocs_viewer_cloud/models/format.rb +30 -22
  25. data/lib/groupdocs_viewer_cloud/models/{format_collection.rb → formats_result.rb} +19 -11
  26. data/lib/groupdocs_viewer_cloud/models/html_options.rb +108 -209
  27. data/lib/groupdocs_viewer_cloud/models/html_resource.rb +234 -0
  28. data/lib/groupdocs_viewer_cloud/models/image_options.rb +129 -163
  29. data/lib/groupdocs_viewer_cloud/models/{attachment_collection.rb → info_result.rb} +32 -32
  30. data/lib/groupdocs_viewer_cloud/models/{rotate_options.rb → object_exist.rb} +42 -34
  31. data/lib/groupdocs_viewer_cloud/models/page_info.rb +48 -55
  32. data/lib/groupdocs_viewer_cloud/models/{pdf_file_info.rb → page_view.rb} +53 -38
  33. data/lib/groupdocs_viewer_cloud/models/{project_options.rb → project_management_options.rb} +39 -21
  34. data/lib/groupdocs_viewer_cloud/models/render_options.rb +92 -146
  35. data/lib/groupdocs_viewer_cloud/models/resource.rb +30 -22
  36. data/lib/groupdocs_viewer_cloud/models/{row_info.rb → row.rb} +65 -37
  37. data/lib/groupdocs_viewer_cloud/models/{cells_options.rb → spreadsheet_options.rb} +95 -67
  38. data/lib/groupdocs_viewer_cloud/models/{attachment.rb → storage_exist.rb} +30 -27
  39. data/lib/groupdocs_viewer_cloud/models/{image_attachment_page_collection.rb → storage_file.rb} +66 -40
  40. data/lib/groupdocs_viewer_cloud/models/{document_info.rb → view_options.rb} +99 -105
  41. data/lib/groupdocs_viewer_cloud/models/{html_page_collection.rb → view_result.rb} +43 -33
  42. data/lib/groupdocs_viewer_cloud/models/watermark.rb +35 -22
  43. data/lib/groupdocs_viewer_cloud/version.rb +2 -2
  44. metadata +27 -110
  45. data/lib/groupdocs_viewer_cloud/models/document_info_options.rb +0 -358
  46. data/lib/groupdocs_viewer_cloud/models/file_response.rb +0 -196
  47. data/lib/groupdocs_viewer_cloud/models/pdf_file_options.rb +0 -358
  48. data/lib/groupdocs_viewer_cloud/models/pdf_options.rb +0 -236
  49. data/lib/groupdocs_viewer_cloud/models/render_options_base.rb +0 -358
  50. data/lib/groupdocs_viewer_cloud/models/requests/html_create_attachment_pages_cache_request.rb +0 -65
  51. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_content_request.rb +0 -65
  52. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_url_request.rb +0 -65
  53. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_request.rb +0 -61
  54. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_content_request.rb +0 -65
  55. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_url_request.rb +0 -65
  56. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_request.rb +0 -61
  57. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_attachment_pages_cache_request.rb +0 -57
  58. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_pages_cache_request.rb +0 -53
  59. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_request.rb +0 -65
  60. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_with_options_request.rb +0 -61
  61. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_request.rb +0 -109
  62. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_resource_request.rb +0 -65
  63. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_pages_request.rb +0 -113
  64. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_request.rb +0 -61
  65. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachments_request.rb +0 -57
  66. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_content_request.rb +0 -61
  67. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_request.rb +0 -69
  68. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_with_options_request.rb +0 -61
  69. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_request.rb +0 -65
  70. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_with_options_request.rb +0 -57
  71. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_request.rb +0 -101
  72. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_resource_request.rb +0 -61
  73. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_from_url_request.rb +0 -109
  74. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_request.rb +0 -105
  75. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_from_url_request.rb +0 -77
  76. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_request.rb +0 -73
  77. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_attachment_pages_request.rb +0 -113
  78. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_pages_request.rb +0 -105
  79. data/lib/groupdocs_viewer_cloud/models/requests/html_transform_pages_request.rb +0 -57
  80. data/lib/groupdocs_viewer_cloud/models/requests/image_create_attachment_pages_cache_request.rb +0 -65
  81. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_content_request.rb +0 -65
  82. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_url_request.rb +0 -65
  83. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_request.rb +0 -61
  84. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_content_request.rb +0 -65
  85. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_url_request.rb +0 -65
  86. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_request.rb +0 -61
  87. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_attachment_pages_cache_request.rb +0 -57
  88. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_pages_cache_request.rb +0 -53
  89. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_request.rb +0 -69
  90. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_with_options_request.rb +0 -61
  91. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_page_request.rb +0 -105
  92. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_pages_request.rb +0 -109
  93. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_request.rb +0 -61
  94. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachments_request.rb +0 -57
  95. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_content_request.rb +0 -61
  96. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_request.rb +0 -73
  97. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_with_options_request.rb +0 -61
  98. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_request.rb +0 -69
  99. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_with_options_request.rb +0 -57
  100. data/lib/groupdocs_viewer_cloud/models/requests/image_get_page_request.rb +0 -97
  101. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_from_url_request.rb +0 -105
  102. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_request.rb +0 -101
  103. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_from_url_request.rb +0 -77
  104. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_request.rb +0 -73
  105. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_attachment_pages_request.rb +0 -109
  106. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_pages_request.rb +0 -101
  107. data/lib/groupdocs_viewer_cloud/models/requests/image_transform_pages_request.rb +0 -57
  108. data/lib/groupdocs_viewer_cloud/models/resource_url.rb +0 -206
  109. data/lib/groupdocs_viewer_cloud/models/slides_options.rb +0 -206
  110. data/lib/groupdocs_viewer_cloud/models/tile.rb +0 -236
  111. data/lib/groupdocs_viewer_cloud/models/words_options.rb +0 -216
@@ -0,0 +1,694 @@
1
+ # -----------------------------------------------------------------------------------
2
+ # <copyright company="Aspose Pty Ltd" file="folder.rb">
3
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+ # </summary>
24
+ # -----------------------------------------------------------------------------------
25
+
26
+ require 'uri'
27
+ require 'date'
28
+
29
+ module GroupDocsViewerCloud
30
+ #
31
+ # GroupDocs.Viewer Cloud API
32
+ #
33
+ class FolderApi
34
+ attr_accessor :config
35
+
36
+ #make FolderApi.new private
37
+ private_class_method :new
38
+
39
+ # Initializes new instance of FolderApi
40
+ #
41
+ # @param [config] Configuration
42
+ # @return [FolderApi] New instance of FolderApi
43
+ def initialize(config)
44
+ @config = config
45
+ @api_client = ApiClient.new(config)
46
+ @access_token = nil
47
+ end
48
+
49
+ # Initializes new instance of FolderApi
50
+ #
51
+ # @param [app_sid] Application identifier (App SID)
52
+ # @param [app_key] Application private key (App Key)
53
+ # @return [FolderApi] New instance of FolderApi
54
+ def self.from_keys(app_sid, app_key)
55
+ config = Configuration.new(app_sid, app_key)
56
+ return new(config)
57
+ end
58
+
59
+ # Initializes new instance of FolderApi
60
+ #
61
+ # @param [config] Configuration
62
+ # @return [FolderApi] New instance of FolderApi
63
+ def self.from_config(config)
64
+ return new(config)
65
+ end
66
+
67
+ # Copy folder
68
+ #
69
+ # @param request copy_folder_request
70
+ # @return [nil]
71
+ def copy_folder(request)
72
+ copy_folder_with_http_info(request)
73
+ nil
74
+ end
75
+
76
+ # Copy folder
77
+ #
78
+ # @param request copy_folder_request
79
+ # @return [Array<(nil, Fixnum, Hash)>]
80
+ # nil, response status code and response headers
81
+ def copy_folder_with_http_info(request)
82
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? CopyFolderRequest
83
+
84
+ @api_client.config.logger.debug 'Calling API: FolderApi.copy_folder ...' if @api_client.config.debugging
85
+ # verify the required parameter 'src_path' is set
86
+ raise ArgumentError, 'Missing the required parameter src_path when calling FolderApi.copy_folder' if @api_client.config.client_side_validation && request.src_path.nil?
87
+ # verify the required parameter 'dest_path' is set
88
+ raise ArgumentError, 'Missing the required parameter dest_path when calling FolderApi.copy_folder' if @api_client.config.client_side_validation && request.dest_path.nil?
89
+ # resource path
90
+ local_var_path = '/viewer/storage/folder/copy/{srcPath}'
91
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('srcPath') + '}', request.src_path.to_s)
92
+
93
+ # query parameters
94
+ query_params = {}
95
+ query_params[downcase_first_letter('destPath')] = request.dest_path
96
+
97
+ if local_var_path.include? ('{' + downcase_first_letter('srcStorageName') + '}')
98
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('srcStorageName') + '}', request.src_storage_name.to_s)
99
+ else
100
+ query_params[downcase_first_letter('srcStorageName')] = request.src_storage_name unless request.src_storage_name.nil?
101
+ end
102
+ if local_var_path.include? ('{' + downcase_first_letter('destStorageName') + '}')
103
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('destStorageName') + '}', request.dest_storage_name.to_s)
104
+ else
105
+ query_params[downcase_first_letter('destStorageName')] = request.dest_storage_name unless request.dest_storage_name.nil?
106
+ end
107
+
108
+ # header parameters
109
+ header_params = {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
112
+ # HTTP header 'Content-Type'
113
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
114
+
115
+ # form parameters
116
+ form_params = {}
117
+
118
+ # http body (model)
119
+ post_body = nil
120
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
121
+ header_params: header_params,
122
+ query_params: query_params,
123
+ form_params: form_params,
124
+ body: post_body,
125
+ access_token: get_access_token)
126
+ if @api_client.config.debugging
127
+ @api_client.config.logger.debug "API called:
128
+ FolderApi#copy_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
129
+ end
130
+ [data, status_code, headers]
131
+ end
132
+
133
+ # Create the folder
134
+ #
135
+ # @param request create_folder_request
136
+ # @return [nil]
137
+ def create_folder(request)
138
+ create_folder_with_http_info(request)
139
+ nil
140
+ end
141
+
142
+ # Create the folder
143
+ #
144
+ # @param request create_folder_request
145
+ # @return [Array<(nil, Fixnum, Hash)>]
146
+ # nil, response status code and response headers
147
+ def create_folder_with_http_info(request)
148
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? CreateFolderRequest
149
+
150
+ @api_client.config.logger.debug 'Calling API: FolderApi.create_folder ...' if @api_client.config.debugging
151
+ # verify the required parameter 'path' is set
152
+ raise ArgumentError, 'Missing the required parameter path when calling FolderApi.create_folder' if @api_client.config.client_side_validation && request.path.nil?
153
+ # resource path
154
+ local_var_path = '/viewer/storage/folder/{path}'
155
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('path') + '}', request.path.to_s)
156
+
157
+ # query parameters
158
+ query_params = {}
159
+ if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}')
160
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)
161
+ else
162
+ query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil?
163
+ end
164
+
165
+ # header parameters
166
+ header_params = {}
167
+ # HTTP header 'Accept' (if needed)
168
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
169
+ # HTTP header 'Content-Type'
170
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
171
+
172
+ # form parameters
173
+ form_params = {}
174
+
175
+ # http body (model)
176
+ post_body = nil
177
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
178
+ header_params: header_params,
179
+ query_params: query_params,
180
+ form_params: form_params,
181
+ body: post_body,
182
+ access_token: get_access_token)
183
+ if @api_client.config.debugging
184
+ @api_client.config.logger.debug "API called:
185
+ FolderApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
186
+ end
187
+ [data, status_code, headers]
188
+ end
189
+
190
+ # Delete folder
191
+ #
192
+ # @param request delete_folder_request
193
+ # @return [nil]
194
+ def delete_folder(request)
195
+ delete_folder_with_http_info(request)
196
+ nil
197
+ end
198
+
199
+ # Delete folder
200
+ #
201
+ # @param request delete_folder_request
202
+ # @return [Array<(nil, Fixnum, Hash)>]
203
+ # nil, response status code and response headers
204
+ def delete_folder_with_http_info(request)
205
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? DeleteFolderRequest
206
+
207
+ @api_client.config.logger.debug 'Calling API: FolderApi.delete_folder ...' if @api_client.config.debugging
208
+ # verify the required parameter 'path' is set
209
+ raise ArgumentError, 'Missing the required parameter path when calling FolderApi.delete_folder' if @api_client.config.client_side_validation && request.path.nil?
210
+ # resource path
211
+ local_var_path = '/viewer/storage/folder/{path}'
212
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('path') + '}', request.path.to_s)
213
+
214
+ # query parameters
215
+ query_params = {}
216
+ if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}')
217
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)
218
+ else
219
+ query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil?
220
+ end
221
+ if local_var_path.include? ('{' + downcase_first_letter('recursive') + '}')
222
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('recursive') + '}', request.recursive.to_s)
223
+ else
224
+ query_params[downcase_first_letter('recursive')] = request.recursive unless request.recursive.nil?
225
+ end
226
+
227
+ # header parameters
228
+ header_params = {}
229
+ # HTTP header 'Accept' (if needed)
230
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
231
+ # HTTP header 'Content-Type'
232
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
233
+
234
+ # form parameters
235
+ form_params = {}
236
+
237
+ # http body (model)
238
+ post_body = nil
239
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
240
+ header_params: header_params,
241
+ query_params: query_params,
242
+ form_params: form_params,
243
+ body: post_body,
244
+ access_token: get_access_token)
245
+ if @api_client.config.debugging
246
+ @api_client.config.logger.debug "API called:
247
+ FolderApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
+ end
249
+ [data, status_code, headers]
250
+ end
251
+
252
+ # Get all files and folders within a folder
253
+ #
254
+ # @param request get_files_list_request
255
+ # @return [FilesList]
256
+ def get_files_list(request)
257
+ data, _status_code, _headers = get_files_list_with_http_info(request)
258
+ data
259
+ end
260
+
261
+ # Get all files and folders within a folder
262
+ #
263
+ # @param request get_files_list_request
264
+ # @return [Array<(FilesList, Fixnum, Hash)>]
265
+ # FilesList data, response status code and response headers
266
+ def get_files_list_with_http_info(request)
267
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? GetFilesListRequest
268
+
269
+ @api_client.config.logger.debug 'Calling API: FolderApi.get_files_list ...' if @api_client.config.debugging
270
+ # verify the required parameter 'path' is set
271
+ raise ArgumentError, 'Missing the required parameter path when calling FolderApi.get_files_list' if @api_client.config.client_side_validation && request.path.nil?
272
+ # resource path
273
+ local_var_path = '/viewer/storage/folder/{path}'
274
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('path') + '}', request.path.to_s)
275
+
276
+ # query parameters
277
+ query_params = {}
278
+ if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}')
279
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)
280
+ else
281
+ query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil?
282
+ end
283
+
284
+ # header parameters
285
+ header_params = {}
286
+ # HTTP header 'Accept' (if needed)
287
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
288
+ # HTTP header 'Content-Type'
289
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
290
+
291
+ # form parameters
292
+ form_params = {}
293
+
294
+ # http body (model)
295
+ post_body = nil
296
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
297
+ header_params: header_params,
298
+ query_params: query_params,
299
+ form_params: form_params,
300
+ body: post_body,
301
+ access_token: get_access_token,
302
+ return_type: 'FilesList')
303
+ if @api_client.config.debugging
304
+ @api_client.config.logger.debug "API called:
305
+ FolderApi#get_files_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
306
+ end
307
+ [data, status_code, headers]
308
+ end
309
+
310
+ # Move folder
311
+ #
312
+ # @param request move_folder_request
313
+ # @return [nil]
314
+ def move_folder(request)
315
+ move_folder_with_http_info(request)
316
+ nil
317
+ end
318
+
319
+ # Move folder
320
+ #
321
+ # @param request move_folder_request
322
+ # @return [Array<(nil, Fixnum, Hash)>]
323
+ # nil, response status code and response headers
324
+ def move_folder_with_http_info(request)
325
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? MoveFolderRequest
326
+
327
+ @api_client.config.logger.debug 'Calling API: FolderApi.move_folder ...' if @api_client.config.debugging
328
+ # verify the required parameter 'src_path' is set
329
+ raise ArgumentError, 'Missing the required parameter src_path when calling FolderApi.move_folder' if @api_client.config.client_side_validation && request.src_path.nil?
330
+ # verify the required parameter 'dest_path' is set
331
+ raise ArgumentError, 'Missing the required parameter dest_path when calling FolderApi.move_folder' if @api_client.config.client_side_validation && request.dest_path.nil?
332
+ # resource path
333
+ local_var_path = '/viewer/storage/folder/move/{srcPath}'
334
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('srcPath') + '}', request.src_path.to_s)
335
+
336
+ # query parameters
337
+ query_params = {}
338
+ query_params[downcase_first_letter('destPath')] = request.dest_path
339
+
340
+ if local_var_path.include? ('{' + downcase_first_letter('srcStorageName') + '}')
341
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('srcStorageName') + '}', request.src_storage_name.to_s)
342
+ else
343
+ query_params[downcase_first_letter('srcStorageName')] = request.src_storage_name unless request.src_storage_name.nil?
344
+ end
345
+ if local_var_path.include? ('{' + downcase_first_letter('destStorageName') + '}')
346
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('destStorageName') + '}', request.dest_storage_name.to_s)
347
+ else
348
+ query_params[downcase_first_letter('destStorageName')] = request.dest_storage_name unless request.dest_storage_name.nil?
349
+ end
350
+
351
+ # header parameters
352
+ header_params = {}
353
+ # HTTP header 'Accept' (if needed)
354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
355
+ # HTTP header 'Content-Type'
356
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
357
+
358
+ # form parameters
359
+ form_params = {}
360
+
361
+ # http body (model)
362
+ post_body = nil
363
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
364
+ header_params: header_params,
365
+ query_params: query_params,
366
+ form_params: form_params,
367
+ body: post_body,
368
+ access_token: get_access_token)
369
+ if @api_client.config.debugging
370
+ @api_client.config.logger.debug "API called:
371
+ FolderApi#move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
372
+ end
373
+ [data, status_code, headers]
374
+ end
375
+
376
+ #
377
+ # Helper method to convert first letter to downcase
378
+ #
379
+ private def downcase_first_letter(str)
380
+ value = str[0].downcase + str[1..-1]
381
+ value
382
+ end
383
+
384
+ #
385
+ # Retrieves access token
386
+ #
387
+ private def get_access_token
388
+ if @access_token.nil? then
389
+ request_access_token
390
+ end
391
+
392
+ @access_token
393
+ end
394
+
395
+ #
396
+ # Gets a access token from server
397
+ #
398
+ private def request_access_token
399
+ auth_config = Configuration.new(@config.app_sid, @config.app_key)
400
+ auth_config.api_base_url = @config.api_base_url
401
+ auth_config.debugging = @config.debugging
402
+ auth_config.logger = @config.logger
403
+ auth_config.temp_folder_path = @config.temp_folder_path
404
+ auth_config.client_side_validation = @config.client_side_validation
405
+ auth_config.api_version = ''
406
+
407
+ auth_api_client = ApiClient.new(auth_config)
408
+
409
+ request_url = "/connect/token"
410
+ post_data = "grant_type=client_credentials&client_id=#{@config.app_sid}&client_secret=#{@config.app_key}"
411
+
412
+ data, _status_code, _header = auth_api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
413
+
414
+ @access_token = data[:access_token]
415
+
416
+ expires_in_seconds = data[:expires_in].to_i - 5 * 60
417
+ expires_in_days = Rational(expires_in_seconds, 60 * 60 * 24)
418
+ @access_token_expires_at = DateTime.now + expires_in_days
419
+ end
420
+
421
+ # requires all files inside a directory from current dir
422
+ # @param _dir can be relative path like '/lib' or "../lib"
423
+ private def require_all(_dir)
424
+ Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), _dir)) + "/*.rb"].each do |file|
425
+ require file
426
+ end
427
+ end
428
+ end
429
+ end
430
+ #
431
+ # --------------------------------------------------------------------------------------------------------------------
432
+ # <copyright company="Aspose Pty Ltd" file="copy_folder_request.rb">
433
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
434
+ # </copyright>
435
+ # <summary>
436
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
437
+ # of this software and associated documentation files (the "Software"), to deal
438
+ # in the Software without restriction, including without limitation the rights
439
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
440
+ # copies of the Software, and to permit persons to whom the Software is
441
+ # furnished to do so, subject to the following conditions:
442
+ #
443
+ # The above copyright notice and this permission notice shall be included in all
444
+ # copies or substantial portions of the Software.
445
+ #
446
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
447
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
448
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
449
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
450
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
451
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
452
+ # SOFTWARE.
453
+ # </summary>
454
+ # --------------------------------------------------------------------------------------------------------------------
455
+ #
456
+
457
+ module GroupDocsViewerCloud
458
+
459
+ #
460
+ # Request model for copy_folder operation.
461
+ #
462
+ class CopyFolderRequest
463
+
464
+ # Source folder path e.g. '/src'
465
+ attr_accessor :src_path
466
+ # Destination folder path e.g. '/dst'
467
+ attr_accessor :dest_path
468
+ # Source storage name
469
+ attr_accessor :src_storage_name
470
+ # Destination storage name
471
+ attr_accessor :dest_storage_name
472
+
473
+ #
474
+ # Initializes a new instance.
475
+ # @param src_path Source folder path e.g. '/src'
476
+ # @param dest_path Destination folder path e.g. '/dst'
477
+ # @param src_storage_name Source storage name
478
+ # @param dest_storage_name Destination storage name
479
+ def initialize(src_path, dest_path, src_storage_name = nil, dest_storage_name = nil)
480
+ self.src_path = src_path
481
+ self.dest_path = dest_path
482
+ self.src_storage_name = src_storage_name
483
+ self.dest_storage_name = dest_storage_name
484
+ end
485
+ end
486
+ end
487
+ #
488
+ # --------------------------------------------------------------------------------------------------------------------
489
+ # <copyright company="Aspose Pty Ltd" file="create_folder_request.rb">
490
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
491
+ # </copyright>
492
+ # <summary>
493
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
494
+ # of this software and associated documentation files (the "Software"), to deal
495
+ # in the Software without restriction, including without limitation the rights
496
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
497
+ # copies of the Software, and to permit persons to whom the Software is
498
+ # furnished to do so, subject to the following conditions:
499
+ #
500
+ # The above copyright notice and this permission notice shall be included in all
501
+ # copies or substantial portions of the Software.
502
+ #
503
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
504
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
505
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
506
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
507
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
508
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
509
+ # SOFTWARE.
510
+ # </summary>
511
+ # --------------------------------------------------------------------------------------------------------------------
512
+ #
513
+
514
+ module GroupDocsViewerCloud
515
+
516
+ #
517
+ # Request model for create_folder operation.
518
+ #
519
+ class CreateFolderRequest
520
+
521
+ # Folder path to create e.g. 'folder_1/folder_2/'
522
+ attr_accessor :path
523
+ # Storage name
524
+ attr_accessor :storage_name
525
+
526
+ #
527
+ # Initializes a new instance.
528
+ # @param path Folder path to create e.g. 'folder_1/folder_2/'
529
+ # @param storage_name Storage name
530
+ def initialize(path, storage_name = nil)
531
+ self.path = path
532
+ self.storage_name = storage_name
533
+ end
534
+ end
535
+ end
536
+ #
537
+ # --------------------------------------------------------------------------------------------------------------------
538
+ # <copyright company="Aspose Pty Ltd" file="delete_folder_request.rb">
539
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
540
+ # </copyright>
541
+ # <summary>
542
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
543
+ # of this software and associated documentation files (the "Software"), to deal
544
+ # in the Software without restriction, including without limitation the rights
545
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
546
+ # copies of the Software, and to permit persons to whom the Software is
547
+ # furnished to do so, subject to the following conditions:
548
+ #
549
+ # The above copyright notice and this permission notice shall be included in all
550
+ # copies or substantial portions of the Software.
551
+ #
552
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
553
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
554
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
555
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
556
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
557
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
558
+ # SOFTWARE.
559
+ # </summary>
560
+ # --------------------------------------------------------------------------------------------------------------------
561
+ #
562
+
563
+ module GroupDocsViewerCloud
564
+
565
+ #
566
+ # Request model for delete_folder operation.
567
+ #
568
+ class DeleteFolderRequest
569
+
570
+ # Folder path e.g. '/folder'
571
+ attr_accessor :path
572
+ # Storage name
573
+ attr_accessor :storage_name
574
+ # Enable to delete folders, subfolders and files
575
+ attr_accessor :recursive
576
+
577
+ #
578
+ # Initializes a new instance.
579
+ # @param path Folder path e.g. '/folder'
580
+ # @param storage_name Storage name
581
+ # @param recursive Enable to delete folders, subfolders and files
582
+ def initialize(path, storage_name = nil, recursive = nil)
583
+ self.path = path
584
+ self.storage_name = storage_name
585
+ self.recursive = recursive
586
+ end
587
+ end
588
+ end
589
+ #
590
+ # --------------------------------------------------------------------------------------------------------------------
591
+ # <copyright company="Aspose Pty Ltd" file="get_files_list_request.rb">
592
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
593
+ # </copyright>
594
+ # <summary>
595
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
596
+ # of this software and associated documentation files (the "Software"), to deal
597
+ # in the Software without restriction, including without limitation the rights
598
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
599
+ # copies of the Software, and to permit persons to whom the Software is
600
+ # furnished to do so, subject to the following conditions:
601
+ #
602
+ # The above copyright notice and this permission notice shall be included in all
603
+ # copies or substantial portions of the Software.
604
+ #
605
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
606
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
607
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
608
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
609
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
610
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
611
+ # SOFTWARE.
612
+ # </summary>
613
+ # --------------------------------------------------------------------------------------------------------------------
614
+ #
615
+
616
+ module GroupDocsViewerCloud
617
+
618
+ #
619
+ # Request model for get_files_list operation.
620
+ #
621
+ class GetFilesListRequest
622
+
623
+ # Folder path e.g. '/folder'
624
+ attr_accessor :path
625
+ # Storage name
626
+ attr_accessor :storage_name
627
+
628
+ #
629
+ # Initializes a new instance.
630
+ # @param path Folder path e.g. '/folder'
631
+ # @param storage_name Storage name
632
+ def initialize(path, storage_name = nil)
633
+ self.path = path
634
+ self.storage_name = storage_name
635
+ end
636
+ end
637
+ end
638
+ #
639
+ # --------------------------------------------------------------------------------------------------------------------
640
+ # <copyright company="Aspose Pty Ltd" file="move_folder_request.rb">
641
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
642
+ # </copyright>
643
+ # <summary>
644
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
645
+ # of this software and associated documentation files (the "Software"), to deal
646
+ # in the Software without restriction, including without limitation the rights
647
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
648
+ # copies of the Software, and to permit persons to whom the Software is
649
+ # furnished to do so, subject to the following conditions:
650
+ #
651
+ # The above copyright notice and this permission notice shall be included in all
652
+ # copies or substantial portions of the Software.
653
+ #
654
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
655
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
656
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
657
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
658
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
659
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
660
+ # SOFTWARE.
661
+ # </summary>
662
+ # --------------------------------------------------------------------------------------------------------------------
663
+ #
664
+
665
+ module GroupDocsViewerCloud
666
+
667
+ #
668
+ # Request model for move_folder operation.
669
+ #
670
+ class MoveFolderRequest
671
+
672
+ # Folder path to move e.g. '/folder'
673
+ attr_accessor :src_path
674
+ # Destination folder path to move to e.g '/dst'
675
+ attr_accessor :dest_path
676
+ # Source storage name
677
+ attr_accessor :src_storage_name
678
+ # Destination storage name
679
+ attr_accessor :dest_storage_name
680
+
681
+ #
682
+ # Initializes a new instance.
683
+ # @param src_path Folder path to move e.g. '/folder'
684
+ # @param dest_path Destination folder path to move to e.g '/dst'
685
+ # @param src_storage_name Source storage name
686
+ # @param dest_storage_name Destination storage name
687
+ def initialize(src_path, dest_path, src_storage_name = nil, dest_storage_name = nil)
688
+ self.src_path = src_path
689
+ self.dest_path = dest_path
690
+ self.src_storage_name = src_storage_name
691
+ self.dest_storage_name = dest_storage_name
692
+ end
693
+ end
694
+ end