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,541 @@
1
+ # -----------------------------------------------------------------------------------
2
+ # <copyright company="Aspose Pty Ltd" file="storage.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 StorageApi
34
+ attr_accessor :config
35
+
36
+ #make StorageApi.new private
37
+ private_class_method :new
38
+
39
+ # Initializes new instance of StorageApi
40
+ #
41
+ # @param [config] Configuration
42
+ # @return [StorageApi] New instance of StorageApi
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 StorageApi
50
+ #
51
+ # @param [app_sid] Application identifier (App SID)
52
+ # @param [app_key] Application private key (App Key)
53
+ # @return [StorageApi] New instance of StorageApi
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 StorageApi
60
+ #
61
+ # @param [config] Configuration
62
+ # @return [StorageApi] New instance of StorageApi
63
+ def self.from_config(config)
64
+ return new(config)
65
+ end
66
+
67
+ # Get disc usage
68
+ #
69
+ # @param request get_disc_usage_request
70
+ # @return [DiscUsage]
71
+ def get_disc_usage(request)
72
+ data, _status_code, _headers = get_disc_usage_with_http_info(request)
73
+ data
74
+ end
75
+
76
+ # Get disc usage
77
+ #
78
+ # @param request get_disc_usage_request
79
+ # @return [Array<(DiscUsage, Fixnum, Hash)>]
80
+ # DiscUsage data, response status code and response headers
81
+ def get_disc_usage_with_http_info(request)
82
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? GetDiscUsageRequest
83
+
84
+ @api_client.config.logger.debug 'Calling API: StorageApi.get_disc_usage ...' if @api_client.config.debugging
85
+ # resource path
86
+ local_var_path = '/viewer/storage/disc'
87
+
88
+ # query parameters
89
+ query_params = {}
90
+ if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}')
91
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)
92
+ else
93
+ query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil?
94
+ end
95
+
96
+ # header parameters
97
+ header_params = {}
98
+ # HTTP header 'Accept' (if needed)
99
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
100
+ # HTTP header 'Content-Type'
101
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
102
+
103
+ # form parameters
104
+ form_params = {}
105
+
106
+ # http body (model)
107
+ post_body = nil
108
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
109
+ header_params: header_params,
110
+ query_params: query_params,
111
+ form_params: form_params,
112
+ body: post_body,
113
+ access_token: get_access_token,
114
+ return_type: 'DiscUsage')
115
+ if @api_client.config.debugging
116
+ @api_client.config.logger.debug "API called:
117
+ StorageApi#get_disc_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
118
+ end
119
+ [data, status_code, headers]
120
+ end
121
+
122
+ # Get file versions
123
+ #
124
+ # @param request get_file_versions_request
125
+ # @return [FileVersions]
126
+ def get_file_versions(request)
127
+ data, _status_code, _headers = get_file_versions_with_http_info(request)
128
+ data
129
+ end
130
+
131
+ # Get file versions
132
+ #
133
+ # @param request get_file_versions_request
134
+ # @return [Array<(FileVersions, Fixnum, Hash)>]
135
+ # FileVersions data, response status code and response headers
136
+ def get_file_versions_with_http_info(request)
137
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? GetFileVersionsRequest
138
+
139
+ @api_client.config.logger.debug 'Calling API: StorageApi.get_file_versions ...' if @api_client.config.debugging
140
+ # verify the required parameter 'path' is set
141
+ raise ArgumentError, 'Missing the required parameter path when calling StorageApi.get_file_versions' if @api_client.config.client_side_validation && request.path.nil?
142
+ # resource path
143
+ local_var_path = '/viewer/storage/version/{path}'
144
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('path') + '}', request.path.to_s)
145
+
146
+ # query parameters
147
+ query_params = {}
148
+ if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}')
149
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)
150
+ else
151
+ query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil?
152
+ end
153
+
154
+ # header parameters
155
+ header_params = {}
156
+ # HTTP header 'Accept' (if needed)
157
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
158
+ # HTTP header 'Content-Type'
159
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
160
+
161
+ # form parameters
162
+ form_params = {}
163
+
164
+ # http body (model)
165
+ post_body = nil
166
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
167
+ header_params: header_params,
168
+ query_params: query_params,
169
+ form_params: form_params,
170
+ body: post_body,
171
+ access_token: get_access_token,
172
+ return_type: 'FileVersions')
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug "API called:
175
+ StorageApi#get_file_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
176
+ end
177
+ [data, status_code, headers]
178
+ end
179
+
180
+ # Check if file or folder exists
181
+ #
182
+ # @param request object_exists_request
183
+ # @return [ObjectExist]
184
+ def object_exists(request)
185
+ data, _status_code, _headers = object_exists_with_http_info(request)
186
+ data
187
+ end
188
+
189
+ # Check if file or folder exists
190
+ #
191
+ # @param request object_exists_request
192
+ # @return [Array<(ObjectExist, Fixnum, Hash)>]
193
+ # ObjectExist data, response status code and response headers
194
+ def object_exists_with_http_info(request)
195
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? ObjectExistsRequest
196
+
197
+ @api_client.config.logger.debug 'Calling API: StorageApi.object_exists ...' if @api_client.config.debugging
198
+ # verify the required parameter 'path' is set
199
+ raise ArgumentError, 'Missing the required parameter path when calling StorageApi.object_exists' if @api_client.config.client_side_validation && request.path.nil?
200
+ # resource path
201
+ local_var_path = '/viewer/storage/exist/{path}'
202
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('path') + '}', request.path.to_s)
203
+
204
+ # query parameters
205
+ query_params = {}
206
+ if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}')
207
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)
208
+ else
209
+ query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil?
210
+ end
211
+ if local_var_path.include? ('{' + downcase_first_letter('versionId') + '}')
212
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('versionId') + '}', request.version_id.to_s)
213
+ else
214
+ query_params[downcase_first_letter('versionId')] = request.version_id unless request.version_id.nil?
215
+ end
216
+
217
+ # header parameters
218
+ header_params = {}
219
+ # HTTP header 'Accept' (if needed)
220
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
221
+ # HTTP header 'Content-Type'
222
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
223
+
224
+ # form parameters
225
+ form_params = {}
226
+
227
+ # http body (model)
228
+ post_body = nil
229
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
230
+ header_params: header_params,
231
+ query_params: query_params,
232
+ form_params: form_params,
233
+ body: post_body,
234
+ access_token: get_access_token,
235
+ return_type: 'ObjectExist')
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called:
238
+ StorageApi#object_exists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
+ end
240
+ [data, status_code, headers]
241
+ end
242
+
243
+ # Check if storage exists
244
+ #
245
+ # @param request storage_exists_request
246
+ # @return [StorageExist]
247
+ def storage_exists(request)
248
+ data, _status_code, _headers = storage_exists_with_http_info(request)
249
+ data
250
+ end
251
+
252
+ # Check if storage exists
253
+ #
254
+ # @param request storage_exists_request
255
+ # @return [Array<(StorageExist, Fixnum, Hash)>]
256
+ # StorageExist data, response status code and response headers
257
+ def storage_exists_with_http_info(request)
258
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? StorageExistsRequest
259
+
260
+ @api_client.config.logger.debug 'Calling API: StorageApi.storage_exists ...' if @api_client.config.debugging
261
+ # verify the required parameter 'storage_name' is set
262
+ raise ArgumentError, 'Missing the required parameter storage_name when calling StorageApi.storage_exists' if @api_client.config.client_side_validation && request.storage_name.nil?
263
+ # resource path
264
+ local_var_path = '/viewer/storage/{storageName}/exist'
265
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s)
266
+
267
+ # query parameters
268
+ query_params = {}
269
+
270
+ # header parameters
271
+ header_params = {}
272
+ # HTTP header 'Accept' (if needed)
273
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
274
+ # HTTP header 'Content-Type'
275
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
276
+
277
+ # form parameters
278
+ form_params = {}
279
+
280
+ # http body (model)
281
+ post_body = nil
282
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
283
+ header_params: header_params,
284
+ query_params: query_params,
285
+ form_params: form_params,
286
+ body: post_body,
287
+ access_token: get_access_token,
288
+ return_type: 'StorageExist')
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug "API called:
291
+ StorageApi#storage_exists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
292
+ end
293
+ [data, status_code, headers]
294
+ end
295
+
296
+ #
297
+ # Helper method to convert first letter to downcase
298
+ #
299
+ private def downcase_first_letter(str)
300
+ value = str[0].downcase + str[1..-1]
301
+ value
302
+ end
303
+
304
+ #
305
+ # Retrieves access token
306
+ #
307
+ private def get_access_token
308
+ if @access_token.nil? then
309
+ request_access_token
310
+ end
311
+
312
+ @access_token
313
+ end
314
+
315
+ #
316
+ # Gets a access token from server
317
+ #
318
+ private def request_access_token
319
+ auth_config = Configuration.new(@config.app_sid, @config.app_key)
320
+ auth_config.api_base_url = @config.api_base_url
321
+ auth_config.debugging = @config.debugging
322
+ auth_config.logger = @config.logger
323
+ auth_config.temp_folder_path = @config.temp_folder_path
324
+ auth_config.client_side_validation = @config.client_side_validation
325
+ auth_config.api_version = ''
326
+
327
+ auth_api_client = ApiClient.new(auth_config)
328
+
329
+ request_url = "/connect/token"
330
+ post_data = "grant_type=client_credentials&client_id=#{@config.app_sid}&client_secret=#{@config.app_key}"
331
+
332
+ data, _status_code, _header = auth_api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
333
+
334
+ @access_token = data[:access_token]
335
+
336
+ expires_in_seconds = data[:expires_in].to_i - 5 * 60
337
+ expires_in_days = Rational(expires_in_seconds, 60 * 60 * 24)
338
+ @access_token_expires_at = DateTime.now + expires_in_days
339
+ end
340
+
341
+ # requires all files inside a directory from current dir
342
+ # @param _dir can be relative path like '/lib' or "../lib"
343
+ private def require_all(_dir)
344
+ Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), _dir)) + "/*.rb"].each do |file|
345
+ require file
346
+ end
347
+ end
348
+ end
349
+ end
350
+ #
351
+ # --------------------------------------------------------------------------------------------------------------------
352
+ # <copyright company="Aspose Pty Ltd" file="get_disc_usage_request.rb">
353
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
354
+ # </copyright>
355
+ # <summary>
356
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
357
+ # of this software and associated documentation files (the "Software"), to deal
358
+ # in the Software without restriction, including without limitation the rights
359
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
360
+ # copies of the Software, and to permit persons to whom the Software is
361
+ # furnished to do so, subject to the following conditions:
362
+ #
363
+ # The above copyright notice and this permission notice shall be included in all
364
+ # copies or substantial portions of the Software.
365
+ #
366
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
367
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
368
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
369
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
370
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
371
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
372
+ # SOFTWARE.
373
+ # </summary>
374
+ # --------------------------------------------------------------------------------------------------------------------
375
+ #
376
+
377
+ module GroupDocsViewerCloud
378
+
379
+ #
380
+ # Request model for get_disc_usage operation.
381
+ #
382
+ class GetDiscUsageRequest
383
+
384
+ # Storage name
385
+ attr_accessor :storage_name
386
+
387
+ #
388
+ # Initializes a new instance.
389
+ # @param storage_name Storage name
390
+ def initialize(storage_name = nil)
391
+ self.storage_name = storage_name
392
+ end
393
+ end
394
+ end
395
+ #
396
+ # --------------------------------------------------------------------------------------------------------------------
397
+ # <copyright company="Aspose Pty Ltd" file="get_file_versions_request.rb">
398
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
399
+ # </copyright>
400
+ # <summary>
401
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
402
+ # of this software and associated documentation files (the "Software"), to deal
403
+ # in the Software without restriction, including without limitation the rights
404
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
405
+ # copies of the Software, and to permit persons to whom the Software is
406
+ # furnished to do so, subject to the following conditions:
407
+ #
408
+ # The above copyright notice and this permission notice shall be included in all
409
+ # copies or substantial portions of the Software.
410
+ #
411
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
412
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
413
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
414
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
415
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
416
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
417
+ # SOFTWARE.
418
+ # </summary>
419
+ # --------------------------------------------------------------------------------------------------------------------
420
+ #
421
+
422
+ module GroupDocsViewerCloud
423
+
424
+ #
425
+ # Request model for get_file_versions operation.
426
+ #
427
+ class GetFileVersionsRequest
428
+
429
+ # File path e.g. '/file.ext'
430
+ attr_accessor :path
431
+ # Storage name
432
+ attr_accessor :storage_name
433
+
434
+ #
435
+ # Initializes a new instance.
436
+ # @param path File path e.g. '/file.ext'
437
+ # @param storage_name Storage name
438
+ def initialize(path, storage_name = nil)
439
+ self.path = path
440
+ self.storage_name = storage_name
441
+ end
442
+ end
443
+ end
444
+ #
445
+ # --------------------------------------------------------------------------------------------------------------------
446
+ # <copyright company="Aspose Pty Ltd" file="object_exists_request.rb">
447
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
448
+ # </copyright>
449
+ # <summary>
450
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
451
+ # of this software and associated documentation files (the "Software"), to deal
452
+ # in the Software without restriction, including without limitation the rights
453
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
454
+ # copies of the Software, and to permit persons to whom the Software is
455
+ # furnished to do so, subject to the following conditions:
456
+ #
457
+ # The above copyright notice and this permission notice shall be included in all
458
+ # copies or substantial portions of the Software.
459
+ #
460
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
461
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
462
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
463
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
464
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
465
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
466
+ # SOFTWARE.
467
+ # </summary>
468
+ # --------------------------------------------------------------------------------------------------------------------
469
+ #
470
+
471
+ module GroupDocsViewerCloud
472
+
473
+ #
474
+ # Request model for object_exists operation.
475
+ #
476
+ class ObjectExistsRequest
477
+
478
+ # File or folder path e.g. '/file.ext' or '/folder'
479
+ attr_accessor :path
480
+ # Storage name
481
+ attr_accessor :storage_name
482
+ # File version ID
483
+ attr_accessor :version_id
484
+
485
+ #
486
+ # Initializes a new instance.
487
+ # @param path File or folder path e.g. '/file.ext' or '/folder'
488
+ # @param storage_name Storage name
489
+ # @param version_id File version ID
490
+ def initialize(path, storage_name = nil, version_id = nil)
491
+ self.path = path
492
+ self.storage_name = storage_name
493
+ self.version_id = version_id
494
+ end
495
+ end
496
+ end
497
+ #
498
+ # --------------------------------------------------------------------------------------------------------------------
499
+ # <copyright company="Aspose Pty Ltd" file="storage_exists_request.rb">
500
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
501
+ # </copyright>
502
+ # <summary>
503
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
504
+ # of this software and associated documentation files (the "Software"), to deal
505
+ # in the Software without restriction, including without limitation the rights
506
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
507
+ # copies of the Software, and to permit persons to whom the Software is
508
+ # furnished to do so, subject to the following conditions:
509
+ #
510
+ # The above copyright notice and this permission notice shall be included in all
511
+ # copies or substantial portions of the Software.
512
+ #
513
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
514
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
515
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
516
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
517
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
518
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
519
+ # SOFTWARE.
520
+ # </summary>
521
+ # --------------------------------------------------------------------------------------------------------------------
522
+ #
523
+
524
+ module GroupDocsViewerCloud
525
+
526
+ #
527
+ # Request model for storage_exists operation.
528
+ #
529
+ class StorageExistsRequest
530
+
531
+ # Storage name
532
+ attr_accessor :storage_name
533
+
534
+ #
535
+ # Initializes a new instance.
536
+ # @param storage_name Storage name
537
+ def initialize(storage_name)
538
+ self.storage_name = storage_name
539
+ end
540
+ end
541
+ end