groupdocs_metadata_cloud 26.1

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 (49) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_metadata_cloud/api/file_api.rb +729 -0
  3. data/lib/groupdocs_metadata_cloud/api/folder_api.rb +694 -0
  4. data/lib/groupdocs_metadata_cloud/api/info_api.rb +363 -0
  5. data/lib/groupdocs_metadata_cloud/api/metadata_api.rb +508 -0
  6. data/lib/groupdocs_metadata_cloud/api/storage_api.rb +541 -0
  7. data/lib/groupdocs_metadata_cloud/api_client.rb +379 -0
  8. data/lib/groupdocs_metadata_cloud/api_client_error.rb +71 -0
  9. data/lib/groupdocs_metadata_cloud/configuration.rb +95 -0
  10. data/lib/groupdocs_metadata_cloud/models/add_options.rb +236 -0
  11. data/lib/groupdocs_metadata_cloud/models/add_property.rb +234 -0
  12. data/lib/groupdocs_metadata_cloud/models/add_result.rb +239 -0
  13. data/lib/groupdocs_metadata_cloud/models/disc_usage.rb +234 -0
  14. data/lib/groupdocs_metadata_cloud/models/error.rb +244 -0
  15. data/lib/groupdocs_metadata_cloud/models/error_details.rb +229 -0
  16. data/lib/groupdocs_metadata_cloud/models/extract_options.rb +224 -0
  17. data/lib/groupdocs_metadata_cloud/models/extract_result.rb +226 -0
  18. data/lib/groupdocs_metadata_cloud/models/file_info.rb +224 -0
  19. data/lib/groupdocs_metadata_cloud/models/file_type.rb +234 -0
  20. data/lib/groupdocs_metadata_cloud/models/file_version.rb +289 -0
  21. data/lib/groupdocs_metadata_cloud/models/file_versions.rb +216 -0
  22. data/lib/groupdocs_metadata_cloud/models/files_list.rb +216 -0
  23. data/lib/groupdocs_metadata_cloud/models/files_upload_result.rb +228 -0
  24. data/lib/groupdocs_metadata_cloud/models/format.rb +224 -0
  25. data/lib/groupdocs_metadata_cloud/models/formats_result.rb +216 -0
  26. data/lib/groupdocs_metadata_cloud/models/info_options.rb +214 -0
  27. data/lib/groupdocs_metadata_cloud/models/info_result.rb +259 -0
  28. data/lib/groupdocs_metadata_cloud/models/match_options.rb +234 -0
  29. data/lib/groupdocs_metadata_cloud/models/metadata_package.rb +238 -0
  30. data/lib/groupdocs_metadata_cloud/models/metadata_property.rb +256 -0
  31. data/lib/groupdocs_metadata_cloud/models/name_options.rb +224 -0
  32. data/lib/groupdocs_metadata_cloud/models/object_exist.rb +234 -0
  33. data/lib/groupdocs_metadata_cloud/models/remove_options.rb +234 -0
  34. data/lib/groupdocs_metadata_cloud/models/remove_result.rb +239 -0
  35. data/lib/groupdocs_metadata_cloud/models/search_criteria.rb +234 -0
  36. data/lib/groupdocs_metadata_cloud/models/search_criteria_without_value.rb +224 -0
  37. data/lib/groupdocs_metadata_cloud/models/set_options.rb +236 -0
  38. data/lib/groupdocs_metadata_cloud/models/set_property.rb +234 -0
  39. data/lib/groupdocs_metadata_cloud/models/set_result.rb +239 -0
  40. data/lib/groupdocs_metadata_cloud/models/storage_exist.rb +219 -0
  41. data/lib/groupdocs_metadata_cloud/models/storage_file.rb +264 -0
  42. data/lib/groupdocs_metadata_cloud/models/tag.rb +224 -0
  43. data/lib/groupdocs_metadata_cloud/models/tag_options.rb +224 -0
  44. data/lib/groupdocs_metadata_cloud/models/tags_options.rb +214 -0
  45. data/lib/groupdocs_metadata_cloud/models/tags_result.rb +214 -0
  46. data/lib/groupdocs_metadata_cloud/models/value_options.rb +224 -0
  47. data/lib/groupdocs_metadata_cloud/version.rb +29 -0
  48. data/lib/groupdocs_metadata_cloud.rb +76 -0
  49. metadata +144 -0
@@ -0,0 +1,363 @@
1
+ # -----------------------------------------------------------------------------------
2
+ # <copyright company="Aspose Pty Ltd" file="info.rb">
3
+ # Copyright (c) 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 GroupDocsMetadataCloud
30
+ #
31
+ # GroupDocs.Metadata Cloud API
32
+ #
33
+ class InfoApi
34
+ attr_accessor :config
35
+
36
+ #make InfoApi.new private
37
+ private_class_method :new
38
+
39
+ # Initializes new instance of InfoApi
40
+ #
41
+ # @param [config] Configuration
42
+ # @return [InfoApi] New instance of InfoApi
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 InfoApi
50
+ #
51
+ # @param [app_sid] Application identifier (App SID)
52
+ # @param [app_key] Application private key (App Key)
53
+ # @return [InfoApi] New instance of InfoApi
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 InfoApi
60
+ #
61
+ # @param [config] Configuration
62
+ # @return [InfoApi] New instance of InfoApi
63
+ def self.from_config(config)
64
+ return new(config)
65
+ end
66
+
67
+ # Retrieve information about document.
68
+ #
69
+ # @param request get_info_request
70
+ # @return [InfoResult]
71
+ def get_info(request)
72
+ data, _status_code, _headers = get_info_with_http_info(request)
73
+ data
74
+ end
75
+
76
+ # Retrieve information about document.
77
+ #
78
+ # @param request get_info_request
79
+ # @return [Array<(InfoResult, Fixnum, Hash)>]
80
+ # InfoResult data, response status code and response headers
81
+ def get_info_with_http_info(request)
82
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? GetInfoRequest
83
+
84
+ @api_client.config.logger.debug 'Calling API: InfoApi.get_info ...' if @api_client.config.debugging
85
+ # verify the required parameter 'options' is set
86
+ raise ArgumentError, 'Missing the required parameter options when calling InfoApi.get_info' if @api_client.config.client_side_validation && request.options.nil?
87
+ # resource path
88
+ local_var_path = '/metadata/info'
89
+
90
+ # query parameters
91
+ query_params = {}
92
+
93
+ # header parameters
94
+ header_params = {}
95
+ # HTTP header 'Accept' (if needed)
96
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
97
+ # HTTP header 'Content-Type'
98
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
99
+
100
+ # form parameters
101
+ form_params = {}
102
+
103
+ # http body (model)
104
+ post_body = @api_client.object_to_http_body(request.options)
105
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
106
+ header_params: header_params,
107
+ query_params: query_params,
108
+ form_params: form_params,
109
+ body: post_body,
110
+ access_token: get_access_token,
111
+ return_type: 'InfoResult')
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug "API called:
114
+ InfoApi#get_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
115
+ end
116
+ [data, status_code, headers]
117
+ end
118
+
119
+ # List supported file formats.
120
+ #
121
+ # @return [FormatsResult]
122
+ def get_supported_file_formats()
123
+ data, _status_code, _headers = get_supported_file_formats_with_http_info()
124
+ data
125
+ end
126
+
127
+ # List supported file formats.
128
+ #
129
+
130
+ # @return [Array<(FormatsResult, Fixnum, Hash)>]
131
+ # FormatsResult data, response status code and response headers
132
+ def get_supported_file_formats_with_http_info()
133
+
134
+
135
+ @api_client.config.logger.debug 'Calling API: InfoApi.get_supported_file_formats ...' if @api_client.config.debugging
136
+ # resource path
137
+ local_var_path = '/metadata/formats'
138
+
139
+ # query parameters
140
+ query_params = {}
141
+
142
+ # header parameters
143
+ header_params = {}
144
+ # HTTP header 'Accept' (if needed)
145
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
146
+ # HTTP header 'Content-Type'
147
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
148
+
149
+ # form parameters
150
+ form_params = {}
151
+
152
+ # http body (model)
153
+ post_body = nil
154
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
155
+ header_params: header_params,
156
+ query_params: query_params,
157
+ form_params: form_params,
158
+ body: post_body,
159
+ access_token: get_access_token,
160
+ return_type: 'FormatsResult')
161
+ if @api_client.config.debugging
162
+ @api_client.config.logger.debug "API called:
163
+ InfoApi#get_supported_file_formats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
164
+ end
165
+ [data, status_code, headers]
166
+ end
167
+
168
+ # Retrieve information about metadata packages, properties and tags.
169
+ #
170
+ # @param request tags_request
171
+ # @return [TagsResult]
172
+ def tags(request)
173
+ data, _status_code, _headers = tags_with_http_info(request)
174
+ data
175
+ end
176
+
177
+ # Retrieve information about metadata packages, properties and tags.
178
+ #
179
+ # @param request tags_request
180
+ # @return [Array<(TagsResult, Fixnum, Hash)>]
181
+ # TagsResult data, response status code and response headers
182
+ def tags_with_http_info(request)
183
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? TagsRequest
184
+
185
+ @api_client.config.logger.debug 'Calling API: InfoApi.tags ...' if @api_client.config.debugging
186
+ # verify the required parameter 'options' is set
187
+ raise ArgumentError, 'Missing the required parameter options when calling InfoApi.tags' if @api_client.config.client_side_validation && request.options.nil?
188
+ # resource path
189
+ local_var_path = '/metadata/tags'
190
+
191
+ # query parameters
192
+ query_params = {}
193
+
194
+ # header parameters
195
+ header_params = {}
196
+ # HTTP header 'Accept' (if needed)
197
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
198
+ # HTTP header 'Content-Type'
199
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
200
+
201
+ # form parameters
202
+ form_params = {}
203
+
204
+ # http body (model)
205
+ post_body = @api_client.object_to_http_body(request.options)
206
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
207
+ header_params: header_params,
208
+ query_params: query_params,
209
+ form_params: form_params,
210
+ body: post_body,
211
+ access_token: get_access_token,
212
+ return_type: 'TagsResult')
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug "API called:
215
+ InfoApi#tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
216
+ end
217
+ [data, status_code, headers]
218
+ end
219
+
220
+ #
221
+ # Helper method to convert first letter to downcase
222
+ #
223
+ private def downcase_first_letter(str)
224
+ value = str[0].downcase + str[1..-1]
225
+ value
226
+ end
227
+
228
+ #
229
+ # Retrieves access token
230
+ #
231
+ private def get_access_token
232
+ if @access_token.nil? then
233
+ request_access_token
234
+ end
235
+
236
+ @access_token
237
+ end
238
+
239
+ #
240
+ # Gets a access token from server
241
+ #
242
+ private def request_access_token
243
+ auth_config = Configuration.new(@config.app_sid, @config.app_key)
244
+ auth_config.api_base_url = @config.api_base_url
245
+ auth_config.debugging = @config.debugging
246
+ auth_config.logger = @config.logger
247
+ auth_config.temp_folder_path = @config.temp_folder_path
248
+ auth_config.client_side_validation = @config.client_side_validation
249
+ auth_config.api_version = ''
250
+
251
+ auth_api_client = ApiClient.new(auth_config)
252
+
253
+ request_url = "/connect/token"
254
+ post_data = "grant_type=client_credentials&client_id=#{@config.app_sid}&client_secret=#{@config.app_key}"
255
+
256
+ data, _status_code, _header = auth_api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
257
+
258
+ @access_token = data[:access_token]
259
+
260
+ expires_in_seconds = data[:expires_in].to_i - 5 * 60
261
+ expires_in_days = Rational(expires_in_seconds, 60 * 60 * 24)
262
+ @access_token_expires_at = DateTime.now + expires_in_days
263
+ end
264
+
265
+ # requires all files inside a directory from current dir
266
+ # @param _dir can be relative path like '/lib' or "../lib"
267
+ private def require_all(_dir)
268
+ Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), _dir)) + "/*.rb"].each do |file|
269
+ require file
270
+ end
271
+ end
272
+ end
273
+ end
274
+ #
275
+ # --------------------------------------------------------------------------------------------------------------------
276
+ # <copyright company="Aspose Pty Ltd" file="get_info_request.rb">
277
+ # Copyright (c) Aspose Pty Ltd
278
+ # </copyright>
279
+ # <summary>
280
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
281
+ # of this software and associated documentation files (the "Software"), to deal
282
+ # in the Software without restriction, including without limitation the rights
283
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
284
+ # copies of the Software, and to permit persons to whom the Software is
285
+ # furnished to do so, subject to the following conditions:
286
+ #
287
+ # The above copyright notice and this permission notice shall be included in all
288
+ # copies or substantial portions of the Software.
289
+ #
290
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
291
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
292
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
293
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
294
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
295
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
296
+ # SOFTWARE.
297
+ # </summary>
298
+ # --------------------------------------------------------------------------------------------------------------------
299
+ #
300
+
301
+ module GroupDocsMetadataCloud
302
+
303
+ #
304
+ # Request model for get_info operation.
305
+ #
306
+ class GetInfoRequest
307
+
308
+ # Info options.
309
+ attr_accessor :options
310
+
311
+ #
312
+ # Initializes a new instance.
313
+ # @param options Info options.
314
+ def initialize(options)
315
+ self.options = options
316
+ end
317
+ end
318
+ end
319
+ #
320
+ # --------------------------------------------------------------------------------------------------------------------
321
+ # <copyright company="Aspose Pty Ltd" file="tags_request.rb">
322
+ # Copyright (c) Aspose Pty Ltd
323
+ # </copyright>
324
+ # <summary>
325
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
326
+ # of this software and associated documentation files (the "Software"), to deal
327
+ # in the Software without restriction, including without limitation the rights
328
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
329
+ # copies of the Software, and to permit persons to whom the Software is
330
+ # furnished to do so, subject to the following conditions:
331
+ #
332
+ # The above copyright notice and this permission notice shall be included in all
333
+ # copies or substantial portions of the Software.
334
+ #
335
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
336
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
337
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
338
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
339
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
340
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
341
+ # SOFTWARE.
342
+ # </summary>
343
+ # --------------------------------------------------------------------------------------------------------------------
344
+ #
345
+
346
+ module GroupDocsMetadataCloud
347
+
348
+ #
349
+ # Request model for tags operation.
350
+ #
351
+ class TagsRequest
352
+
353
+ # Tags options.
354
+ attr_accessor :options
355
+
356
+ #
357
+ # Initializes a new instance.
358
+ # @param options Tags options.
359
+ def initialize(options)
360
+ self.options = options
361
+ end
362
+ end
363
+ end