groupdocs_annotation_cloud 18.7 → 19.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_annotation_cloud.rb +23 -39
  3. data/lib/groupdocs_annotation_cloud/api/annotate_api.rb +664 -0
  4. data/lib/groupdocs_annotation_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_annotation_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_annotation_cloud/api/{pdf_file_api.rb → info_api.rb} +101 -105
  7. data/lib/groupdocs_annotation_cloud/api/preview_api.rb +380 -0
  8. data/lib/groupdocs_annotation_cloud/api/storage_api.rb +541 -0
  9. data/lib/groupdocs_annotation_cloud/api_client.rb +7 -17
  10. data/lib/groupdocs_annotation_cloud/api_error.rb +5 -3
  11. data/lib/groupdocs_annotation_cloud/configuration.rb +3 -3
  12. data/lib/groupdocs_annotation_cloud/models/annotation_api_link.rb +24 -16
  13. data/lib/groupdocs_annotation_cloud/models/annotation_info.rb +97 -82
  14. data/lib/groupdocs_annotation_cloud/models/annotation_reply_info.rb +31 -23
  15. data/lib/groupdocs_annotation_cloud/models/disc_usage.rb +234 -0
  16. data/lib/groupdocs_annotation_cloud/models/document_info.rb +44 -22
  17. data/lib/groupdocs_annotation_cloud/models/error.rb +244 -0
  18. data/lib/groupdocs_annotation_cloud/models/error_details.rb +229 -0
  19. data/lib/groupdocs_annotation_cloud/models/file_version.rb +289 -0
  20. data/lib/groupdocs_annotation_cloud/models/{value_type.rb → file_versions.rb} +33 -13
  21. data/lib/groupdocs_annotation_cloud/models/files_list.rb +216 -0
  22. data/lib/groupdocs_annotation_cloud/models/files_upload_result.rb +228 -0
  23. data/lib/groupdocs_annotation_cloud/models/format.rb +224 -0
  24. data/lib/groupdocs_annotation_cloud/models/formats_result.rb +216 -0
  25. data/lib/groupdocs_annotation_cloud/models/link.rb +24 -16
  26. data/lib/groupdocs_annotation_cloud/models/link_element.rb +18 -10
  27. data/lib/groupdocs_annotation_cloud/models/object_exist.rb +234 -0
  28. data/lib/groupdocs_annotation_cloud/models/{image_page.rb → page_image.rb} +28 -13
  29. data/lib/groupdocs_annotation_cloud/models/{image_pages.rb → page_images.rb} +26 -14
  30. data/lib/groupdocs_annotation_cloud/models/page_info.rb +41 -23
  31. data/lib/groupdocs_annotation_cloud/models/point.rb +31 -13
  32. data/lib/groupdocs_annotation_cloud/models/rectangle.rb +45 -17
  33. data/lib/groupdocs_annotation_cloud/models/row_info.rb +38 -16
  34. data/lib/groupdocs_annotation_cloud/models/storage_exist.rb +219 -0
  35. data/lib/groupdocs_annotation_cloud/models/storage_file.rb +264 -0
  36. data/lib/groupdocs_annotation_cloud/version.rb +2 -2
  37. metadata +22 -39
  38. data/lib/groupdocs_annotation_cloud/api/annotation_api.rb +0 -344
  39. data/lib/groupdocs_annotation_cloud/api/image_info_api.rb +0 -218
  40. data/lib/groupdocs_annotation_cloud/api/image_pages_api.rb +0 -395
  41. data/lib/groupdocs_annotation_cloud/models/requests/delete_clean_document_request.rb +0 -53
  42. data/lib/groupdocs_annotation_cloud/models/requests/delete_pages_request.rb +0 -49
  43. data/lib/groupdocs_annotation_cloud/models/requests/get_import_request.rb +0 -53
  44. data/lib/groupdocs_annotation_cloud/models/requests/get_info_request.rb +0 -53
  45. data/lib/groupdocs_annotation_cloud/models/requests/get_page_request.rb +0 -53
  46. data/lib/groupdocs_annotation_cloud/models/requests/get_pages_request.rb +0 -49
  47. data/lib/groupdocs_annotation_cloud/models/requests/get_pdf_request.rb +0 -53
  48. data/lib/groupdocs_annotation_cloud/models/requests/get_pdf_stream_request.rb +0 -53
  49. data/lib/groupdocs_annotation_cloud/models/requests/post_pages_request.rb +0 -53
  50. data/lib/groupdocs_annotation_cloud/models/requests/put_export_request.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87ce3312a2efaac314b2356ebddf35f4baed97d4
4
- data.tar.gz: 8f42f946da1bc0bac4d24495b533359143963042
3
+ metadata.gz: fa25bb1a142858ec21ae5d8827bbb2aaedb9a9bf
4
+ data.tar.gz: 464012de126bbcf300a52af56fe01f8399e50fd0
5
5
  SHA512:
6
- metadata.gz: 28f18f6a91420d5db93b06110095de2594b2c87f1bd165950881c79eeeda1dd6de29863da496aa557763e6f741f56c65255fae18829e9566798785260d06d142
7
- data.tar.gz: 3b63dc7ecb6341351a3e7da532c2a355fd7ba625af7b9050b6d836807841573ef74abd98f99c25a6051eace76e6141cccc91ddcd2de74a3acdbcaada1c56927f
6
+ metadata.gz: 50779fdf6892678e62bc65d69a027fa763c018cea48573b6f43871e282c5748cfd0435eb1de9f64ea0d93e372302c1d1e3cf279c57080739424ed73bd3eecb01
7
+ data.tar.gz: 0a967391d16fb8d144e369a1b9ad5c9ee765dd4ac77ee30ba65780d58a01cfd698d8e82afd261c3a3eac9388e1a9006eabd89cbe9de93c09c8e9a986eaf66014
@@ -1,6 +1,6 @@
1
1
  # ------------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="groupdocs_annotation_cloud.rb">
3
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,49 +32,33 @@ require_relative 'groupdocs_annotation_cloud/configuration'
32
32
  # Models
33
33
  require_relative 'groupdocs_annotation_cloud/models/annotation_info'
34
34
  require_relative 'groupdocs_annotation_cloud/models/annotation_reply_info'
35
+ require_relative 'groupdocs_annotation_cloud/models/disc_usage'
35
36
  require_relative 'groupdocs_annotation_cloud/models/document_info'
36
- require_relative 'groupdocs_annotation_cloud/models/image_pages'
37
+ require_relative 'groupdocs_annotation_cloud/models/error'
38
+ require_relative 'groupdocs_annotation_cloud/models/error_details'
39
+ require_relative 'groupdocs_annotation_cloud/models/file_versions'
40
+ require_relative 'groupdocs_annotation_cloud/models/files_list'
41
+ require_relative 'groupdocs_annotation_cloud/models/files_upload_result'
42
+ require_relative 'groupdocs_annotation_cloud/models/format'
43
+ require_relative 'groupdocs_annotation_cloud/models/formats_result'
37
44
  require_relative 'groupdocs_annotation_cloud/models/link'
38
45
  require_relative 'groupdocs_annotation_cloud/models/link_element'
46
+ require_relative 'groupdocs_annotation_cloud/models/object_exist'
47
+ require_relative 'groupdocs_annotation_cloud/models/page_images'
39
48
  require_relative 'groupdocs_annotation_cloud/models/page_info'
40
- require_relative 'groupdocs_annotation_cloud/models/row_info'
41
- require_relative 'groupdocs_annotation_cloud/models/value_type'
42
- require_relative 'groupdocs_annotation_cloud/models/annotation_api_link'
43
- require_relative 'groupdocs_annotation_cloud/models/image_page'
44
49
  require_relative 'groupdocs_annotation_cloud/models/point'
45
50
  require_relative 'groupdocs_annotation_cloud/models/rectangle'
51
+ require_relative 'groupdocs_annotation_cloud/models/row_info'
52
+ require_relative 'groupdocs_annotation_cloud/models/storage_exist'
53
+ require_relative 'groupdocs_annotation_cloud/models/storage_file'
54
+ require_relative 'groupdocs_annotation_cloud/models/annotation_api_link'
55
+ require_relative 'groupdocs_annotation_cloud/models/file_version'
56
+ require_relative 'groupdocs_annotation_cloud/models/page_image'
46
57
 
47
58
  # APIs
48
- require_relative 'groupdocs_annotation_cloud/api/annotation_api'
49
- require_relative 'groupdocs_annotation_cloud/api/image_info_api'
50
- require_relative 'groupdocs_annotation_cloud/api/image_pages_api'
51
- require_relative 'groupdocs_annotation_cloud/api/pdf_file_api'
52
-
53
- module GroupDocsAnnotationCloud
54
- # Main module
55
- class << self
56
- # Initialize SDK with API keys.
57
- #
58
- # app_sid = "xxx"
59
- # app_key = "xxx"
60
- #
61
- # GroupDocsAnnotationCloud.from_keys(app_sid, app_key)
62
- def from_keys(app_sid, app_key)
63
- AnnotationApi.from_keys(app_sid, app_key)
64
- end
65
-
66
- # Initialize SDK with Configuration.
67
- #
68
- # app_sid = "xxx"
69
- # app_key = "xxx"
70
- #
71
- # config = GroupDocsAnnotationCloud::Configuration.new(app_sid, app_key)
72
- # config.debugging = true
73
- # config.temp_folder_path = "./temp"
74
- #
75
- # GroupDocsAnnotationCloud.from_config(config)
76
- def from_config(config)
77
- AnnotationApi.from_config(config)
78
- end
79
- end
80
- end
59
+ require_relative 'groupdocs_annotation_cloud/api/annotate_api'
60
+ require_relative 'groupdocs_annotation_cloud/api/file_api'
61
+ require_relative 'groupdocs_annotation_cloud/api/folder_api'
62
+ require_relative 'groupdocs_annotation_cloud/api/info_api'
63
+ require_relative 'groupdocs_annotation_cloud/api/preview_api'
64
+ require_relative 'groupdocs_annotation_cloud/api/storage_api'
@@ -0,0 +1,664 @@
1
+ # -----------------------------------------------------------------------------------
2
+ # <copyright company="Aspose Pty Ltd" file="annotate.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 GroupDocsAnnotationCloud
30
+ #
31
+ # GroupDocs.Annotation Cloud API
32
+ #
33
+ class AnnotateApi
34
+ attr_accessor :config
35
+
36
+ #make AnnotateApi.new private
37
+ private_class_method :new
38
+
39
+ # Initializes new instance of AnnotateApi
40
+ #
41
+ # @param [config] Configuration
42
+ # @return [AnnotateApi] New instance of AnnotateApi
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 AnnotateApi
50
+ #
51
+ # @param [app_sid] Application identifier (App SID)
52
+ # @param [app_key] Application private key (App Key)
53
+ # @return [AnnotateApi] New instance of AnnotateApi
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 AnnotateApi
60
+ #
61
+ # @param [config] Configuration
62
+ # @return [AnnotateApi] New instance of AnnotateApi
63
+ def self.from_config(config)
64
+ return new(config)
65
+ end
66
+
67
+ # Removes annotations from document
68
+ #
69
+ # @param request delete_annotations_request
70
+ # @return [nil]
71
+ def delete_annotations(request)
72
+ delete_annotations_with_http_info(request)
73
+ nil
74
+ end
75
+
76
+ # Removes annotations from document
77
+ #
78
+ # @param request delete_annotations_request
79
+ # @return [Array<(nil, Fixnum, Hash)>]
80
+ # nil, response status code and response headers
81
+ def delete_annotations_with_http_info(request)
82
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? DeleteAnnotationsRequest
83
+
84
+ @api_client.config.logger.debug 'Calling API: AnnotateApi.delete_annotations ...' if @api_client.config.debugging
85
+ # verify the required parameter 'file_path' is set
86
+ raise ArgumentError, 'Missing the required parameter file_path when calling AnnotateApi.delete_annotations' if @api_client.config.client_side_validation && request.file_path.nil?
87
+ # resource path
88
+ local_var_path = '/annotation'
89
+
90
+ # query parameters
91
+ query_params = {}
92
+ query_params[downcase_first_letter('filePath')] = request.file_path
93
+
94
+
95
+ # header parameters
96
+ header_params = {}
97
+ # HTTP header 'Accept' (if needed)
98
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
99
+ # HTTP header 'Content-Type'
100
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
101
+
102
+ # form parameters
103
+ form_params = {}
104
+
105
+ # http body (model)
106
+ post_body = nil
107
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
108
+ header_params: header_params,
109
+ query_params: query_params,
110
+ form_params: form_params,
111
+ body: post_body,
112
+ access_token: get_access_token)
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug "API called:
115
+ AnnotateApi#delete_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
116
+ end
117
+ [data, status_code, headers]
118
+ end
119
+
120
+ # Retrieves document with annotations
121
+ #
122
+ # @param request get_export_request
123
+ # @return [File]
124
+ def get_export(request)
125
+ data, _status_code, _headers = get_export_with_http_info(request)
126
+ data
127
+ end
128
+
129
+ # Retrieves document with annotations
130
+ #
131
+ # @param request get_export_request
132
+ # @return [Array<(File, Fixnum, Hash)>]
133
+ # File data, response status code and response headers
134
+ def get_export_with_http_info(request)
135
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? GetExportRequest
136
+
137
+ @api_client.config.logger.debug 'Calling API: AnnotateApi.get_export ...' if @api_client.config.debugging
138
+ # verify the required parameter 'file_path' is set
139
+ raise ArgumentError, 'Missing the required parameter file_path when calling AnnotateApi.get_export' if @api_client.config.client_side_validation && request.file_path.nil?
140
+ # resource path
141
+ local_var_path = '/annotation/result'
142
+
143
+ # query parameters
144
+ query_params = {}
145
+ query_params[downcase_first_letter('filePath')] = request.file_path
146
+
147
+ if local_var_path.include? ('{' + downcase_first_letter('annotationTypes') + '}')
148
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('annotationTypes') + '}', request.annotation_types.to_s)
149
+ else
150
+ query_params[downcase_first_letter('annotationTypes')] = request.annotation_types unless request.annotation_types.nil?
151
+ end
152
+ if local_var_path.include? ('{' + downcase_first_letter('annotatedPages') + '}')
153
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('annotatedPages') + '}', request.annotated_pages.to_s)
154
+ else
155
+ query_params[downcase_first_letter('annotatedPages')] = request.annotated_pages unless request.annotated_pages.nil?
156
+ end
157
+ if local_var_path.include? ('{' + downcase_first_letter('firstPage') + '}')
158
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('firstPage') + '}', request.first_page.to_s)
159
+ else
160
+ query_params[downcase_first_letter('firstPage')] = request.first_page unless request.first_page.nil?
161
+ end
162
+ if local_var_path.include? ('{' + downcase_first_letter('lastPage') + '}')
163
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('lastPage') + '}', request.last_page.to_s)
164
+ else
165
+ query_params[downcase_first_letter('lastPage')] = request.last_page unless request.last_page.nil?
166
+ end
167
+ if local_var_path.include? ('{' + downcase_first_letter('password') + '}')
168
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('password') + '}', request.password.to_s)
169
+ else
170
+ query_params[downcase_first_letter('password')] = request.password unless request.password.nil?
171
+ end
172
+
173
+ # header parameters
174
+ header_params = {}
175
+ # HTTP header 'Accept' (if needed)
176
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
177
+ # HTTP header 'Content-Type'
178
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
179
+
180
+ # form parameters
181
+ form_params = {}
182
+
183
+ # http body (model)
184
+ post_body = nil
185
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
186
+ header_params: header_params,
187
+ query_params: query_params,
188
+ form_params: form_params,
189
+ body: post_body,
190
+ access_token: get_access_token,
191
+ return_type: 'File')
192
+ if @api_client.config.debugging
193
+ @api_client.config.logger.debug "API called:
194
+ AnnotateApi#get_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
195
+ end
196
+ [data, status_code, headers]
197
+ end
198
+
199
+ # Extracts annotations from document
200
+ #
201
+ # @param request get_import_request
202
+ # @return [Array<AnnotationInfo>]
203
+ def get_import(request)
204
+ data, _status_code, _headers = get_import_with_http_info(request)
205
+ data
206
+ end
207
+
208
+ # Extracts annotations from document
209
+ #
210
+ # @param request get_import_request
211
+ # @return [Array<(Array<AnnotationInfo>, Fixnum, Hash)>]
212
+ # Array<AnnotationInfo> data, response status code and response headers
213
+ def get_import_with_http_info(request)
214
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? GetImportRequest
215
+
216
+ @api_client.config.logger.debug 'Calling API: AnnotateApi.get_import ...' if @api_client.config.debugging
217
+ # verify the required parameter 'file_path' is set
218
+ raise ArgumentError, 'Missing the required parameter file_path when calling AnnotateApi.get_import' if @api_client.config.client_side_validation && request.file_path.nil?
219
+ # resource path
220
+ local_var_path = '/annotation'
221
+
222
+ # query parameters
223
+ query_params = {}
224
+ query_params[downcase_first_letter('filePath')] = request.file_path
225
+
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(:GET, 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
+ return_type: 'Array<AnnotationInfo>')
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug "API called:
248
+ AnnotateApi#get_import\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
249
+ end
250
+ [data, status_code, headers]
251
+ end
252
+
253
+ # Retrieves PDF version of document
254
+ #
255
+ # @param request get_pdf_request
256
+ # @return [File]
257
+ def get_pdf(request)
258
+ data, _status_code, _headers = get_pdf_with_http_info(request)
259
+ data
260
+ end
261
+
262
+ # Retrieves PDF version of document
263
+ #
264
+ # @param request get_pdf_request
265
+ # @return [Array<(File, Fixnum, Hash)>]
266
+ # File data, response status code and response headers
267
+ def get_pdf_with_http_info(request)
268
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? GetPdfRequest
269
+
270
+ @api_client.config.logger.debug 'Calling API: AnnotateApi.get_pdf ...' if @api_client.config.debugging
271
+ # verify the required parameter 'file_path' is set
272
+ raise ArgumentError, 'Missing the required parameter file_path when calling AnnotateApi.get_pdf' if @api_client.config.client_side_validation && request.file_path.nil?
273
+ # resource path
274
+ local_var_path = '/annotation/pdf'
275
+
276
+ # query parameters
277
+ query_params = {}
278
+ query_params[downcase_first_letter('filePath')] = request.file_path
279
+
280
+
281
+ # header parameters
282
+ header_params = {}
283
+ # HTTP header 'Accept' (if needed)
284
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
285
+ # HTTP header 'Content-Type'
286
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
287
+
288
+ # form parameters
289
+ form_params = {}
290
+
291
+ # http body (model)
292
+ post_body = nil
293
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
294
+ header_params: header_params,
295
+ query_params: query_params,
296
+ form_params: form_params,
297
+ body: post_body,
298
+ access_token: get_access_token,
299
+ return_type: 'File')
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug "API called:
302
+ AnnotateApi#get_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
303
+ end
304
+ [data, status_code, headers]
305
+ end
306
+
307
+ # Adds annotations to document
308
+ #
309
+ # @param request post_annotations_request
310
+ # @return [nil]
311
+ def post_annotations(request)
312
+ post_annotations_with_http_info(request)
313
+ nil
314
+ end
315
+
316
+ # Adds annotations to document
317
+ #
318
+ # @param request post_annotations_request
319
+ # @return [Array<(nil, Fixnum, Hash)>]
320
+ # nil, response status code and response headers
321
+ def post_annotations_with_http_info(request)
322
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? PostAnnotationsRequest
323
+
324
+ @api_client.config.logger.debug 'Calling API: AnnotateApi.post_annotations ...' if @api_client.config.debugging
325
+ # verify the required parameter 'file_path' is set
326
+ raise ArgumentError, 'Missing the required parameter file_path when calling AnnotateApi.post_annotations' if @api_client.config.client_side_validation && request.file_path.nil?
327
+ # verify the required parameter 'annotations' is set
328
+ raise ArgumentError, 'Missing the required parameter annotations when calling AnnotateApi.post_annotations' if @api_client.config.client_side_validation && request.annotations.nil?
329
+ # resource path
330
+ local_var_path = '/annotation'
331
+
332
+ # query parameters
333
+ query_params = {}
334
+ query_params[downcase_first_letter('filePath')] = request.file_path
335
+
336
+
337
+ # header parameters
338
+ header_params = {}
339
+ # HTTP header 'Accept' (if needed)
340
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
341
+ # HTTP header 'Content-Type'
342
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
343
+
344
+ # form parameters
345
+ form_params = {}
346
+
347
+ # http body (model)
348
+ post_body = @api_client.object_to_http_body(request.annotations)
349
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
350
+ header_params: header_params,
351
+ query_params: query_params,
352
+ form_params: form_params,
353
+ body: post_body,
354
+ access_token: get_access_token)
355
+ if @api_client.config.debugging
356
+ @api_client.config.logger.debug "API called:
357
+ AnnotateApi#post_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
358
+ end
359
+ [data, status_code, headers]
360
+ end
361
+
362
+ #
363
+ # Helper method to convert first letter to downcase
364
+ #
365
+ private def downcase_first_letter(str)
366
+ value = str[0].downcase + str[1..-1]
367
+ value
368
+ end
369
+
370
+ #
371
+ # Retrieves access token
372
+ #
373
+ private def get_access_token
374
+ if @access_token.nil? then
375
+ request_access_token
376
+ end
377
+
378
+ @access_token
379
+ end
380
+
381
+ #
382
+ # Gets a access token from server
383
+ #
384
+ private def request_access_token
385
+ auth_config = Configuration.new(@config.app_sid, @config.app_key)
386
+ auth_config.api_base_url = @config.api_base_url
387
+ auth_config.debugging = @config.debugging
388
+ auth_config.logger = @config.logger
389
+ auth_config.temp_folder_path = @config.temp_folder_path
390
+ auth_config.client_side_validation = @config.client_side_validation
391
+ auth_config.api_version = ''
392
+
393
+ auth_api_client = ApiClient.new(auth_config)
394
+
395
+ request_url = "/connect/token"
396
+ post_data = "grant_type=client_credentials&client_id=#{@config.app_sid}&client_secret=#{@config.app_key}"
397
+
398
+ data, _status_code, _header = auth_api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
399
+
400
+ @access_token = data[:access_token]
401
+
402
+ expires_in_seconds = data[:expires_in].to_i - 5 * 60
403
+ expires_in_days = Rational(expires_in_seconds, 60 * 60 * 24)
404
+ @access_token_expires_at = DateTime.now + expires_in_days
405
+ end
406
+
407
+ # requires all files inside a directory from current dir
408
+ # @param _dir can be relative path like '/lib' or "../lib"
409
+ private def require_all(_dir)
410
+ Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), _dir)) + "/*.rb"].each do |file|
411
+ require file
412
+ end
413
+ end
414
+ end
415
+ end
416
+ #
417
+ # --------------------------------------------------------------------------------------------------------------------
418
+ # <copyright company="Aspose Pty Ltd" file="delete_annotations_request.rb">
419
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
420
+ # </copyright>
421
+ # <summary>
422
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
423
+ # of this software and associated documentation files (the "Software"), to deal
424
+ # in the Software without restriction, including without limitation the rights
425
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
426
+ # copies of the Software, and to permit persons to whom the Software is
427
+ # furnished to do so, subject to the following conditions:
428
+ #
429
+ # The above copyright notice and this permission notice shall be included in all
430
+ # copies or substantial portions of the Software.
431
+ #
432
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
433
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
434
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
435
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
436
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
437
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
438
+ # SOFTWARE.
439
+ # </summary>
440
+ # --------------------------------------------------------------------------------------------------------------------
441
+ #
442
+
443
+ module GroupDocsAnnotationCloud
444
+
445
+ #
446
+ # Request model for delete_annotations operation.
447
+ #
448
+ class DeleteAnnotationsRequest
449
+
450
+ # Document path in storage
451
+ attr_accessor :file_path
452
+
453
+ #
454
+ # Initializes a new instance.
455
+ # @param file_path Document path in storage
456
+ def initialize(file_path)
457
+ self.file_path = file_path
458
+ end
459
+ end
460
+ end
461
+ #
462
+ # --------------------------------------------------------------------------------------------------------------------
463
+ # <copyright company="Aspose Pty Ltd" file="get_export_request.rb">
464
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
465
+ # </copyright>
466
+ # <summary>
467
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
468
+ # of this software and associated documentation files (the "Software"), to deal
469
+ # in the Software without restriction, including without limitation the rights
470
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
471
+ # copies of the Software, and to permit persons to whom the Software is
472
+ # furnished to do so, subject to the following conditions:
473
+ #
474
+ # The above copyright notice and this permission notice shall be included in all
475
+ # copies or substantial portions of the Software.
476
+ #
477
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
478
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
479
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
480
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
481
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
482
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
483
+ # SOFTWARE.
484
+ # </summary>
485
+ # --------------------------------------------------------------------------------------------------------------------
486
+ #
487
+
488
+ module GroupDocsAnnotationCloud
489
+
490
+ #
491
+ # Request model for get_export operation.
492
+ #
493
+ class GetExportRequest
494
+
495
+ # Document path in storage
496
+ attr_accessor :file_path
497
+ # Annotation types that will be exported. All annotation types will be exported if not specified
498
+ attr_accessor :annotation_types
499
+ # Indicates whether to export only annotated pages
500
+ attr_accessor :annotated_pages
501
+ # Determines number of first exported page
502
+ attr_accessor :first_page
503
+ # Determines number of last exported page
504
+ attr_accessor :last_page
505
+ # Source document password
506
+ attr_accessor :password
507
+
508
+ #
509
+ # Initializes a new instance.
510
+ # @param file_path Document path in storage
511
+ # @param annotation_types Annotation types that will be exported. All annotation types will be exported if not specified
512
+ # @param annotated_pages Indicates whether to export only annotated pages
513
+ # @param first_page Determines number of first exported page
514
+ # @param last_page Determines number of last exported page
515
+ # @param password Source document password
516
+ def initialize(file_path, annotation_types = nil, annotated_pages = nil, first_page = nil, last_page = nil, password = nil)
517
+ self.file_path = file_path
518
+ self.annotation_types = annotation_types
519
+ self.annotated_pages = annotated_pages
520
+ self.first_page = first_page
521
+ self.last_page = last_page
522
+ self.password = password
523
+ end
524
+ end
525
+ end
526
+ #
527
+ # --------------------------------------------------------------------------------------------------------------------
528
+ # <copyright company="Aspose Pty Ltd" file="get_import_request.rb">
529
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
530
+ # </copyright>
531
+ # <summary>
532
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
533
+ # of this software and associated documentation files (the "Software"), to deal
534
+ # in the Software without restriction, including without limitation the rights
535
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
536
+ # copies of the Software, and to permit persons to whom the Software is
537
+ # furnished to do so, subject to the following conditions:
538
+ #
539
+ # The above copyright notice and this permission notice shall be included in all
540
+ # copies or substantial portions of the Software.
541
+ #
542
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
543
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
544
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
545
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
546
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
547
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
548
+ # SOFTWARE.
549
+ # </summary>
550
+ # --------------------------------------------------------------------------------------------------------------------
551
+ #
552
+
553
+ module GroupDocsAnnotationCloud
554
+
555
+ #
556
+ # Request model for get_import operation.
557
+ #
558
+ class GetImportRequest
559
+
560
+ # Document path in storage
561
+ attr_accessor :file_path
562
+
563
+ #
564
+ # Initializes a new instance.
565
+ # @param file_path Document path in storage
566
+ def initialize(file_path)
567
+ self.file_path = file_path
568
+ end
569
+ end
570
+ end
571
+ #
572
+ # --------------------------------------------------------------------------------------------------------------------
573
+ # <copyright company="Aspose Pty Ltd" file="get_pdf_request.rb">
574
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
575
+ # </copyright>
576
+ # <summary>
577
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
578
+ # of this software and associated documentation files (the "Software"), to deal
579
+ # in the Software without restriction, including without limitation the rights
580
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
581
+ # copies of the Software, and to permit persons to whom the Software is
582
+ # furnished to do so, subject to the following conditions:
583
+ #
584
+ # The above copyright notice and this permission notice shall be included in all
585
+ # copies or substantial portions of the Software.
586
+ #
587
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
588
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
589
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
590
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
591
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
592
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
593
+ # SOFTWARE.
594
+ # </summary>
595
+ # --------------------------------------------------------------------------------------------------------------------
596
+ #
597
+
598
+ module GroupDocsAnnotationCloud
599
+
600
+ #
601
+ # Request model for get_pdf operation.
602
+ #
603
+ class GetPdfRequest
604
+
605
+ # Path to document in storage
606
+ attr_accessor :file_path
607
+
608
+ #
609
+ # Initializes a new instance.
610
+ # @param file_path Path to document in storage
611
+ def initialize(file_path)
612
+ self.file_path = file_path
613
+ end
614
+ end
615
+ end
616
+ #
617
+ # --------------------------------------------------------------------------------------------------------------------
618
+ # <copyright company="Aspose Pty Ltd" file="post_annotations_request.rb">
619
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
620
+ # </copyright>
621
+ # <summary>
622
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
623
+ # of this software and associated documentation files (the "Software"), to deal
624
+ # in the Software without restriction, including without limitation the rights
625
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
626
+ # copies of the Software, and to permit persons to whom the Software is
627
+ # furnished to do so, subject to the following conditions:
628
+ #
629
+ # The above copyright notice and this permission notice shall be included in all
630
+ # copies or substantial portions of the Software.
631
+ #
632
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
633
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
634
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
635
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
636
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
637
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
638
+ # SOFTWARE.
639
+ # </summary>
640
+ # --------------------------------------------------------------------------------------------------------------------
641
+ #
642
+
643
+ module GroupDocsAnnotationCloud
644
+
645
+ #
646
+ # Request model for post_annotations operation.
647
+ #
648
+ class PostAnnotationsRequest
649
+
650
+ # Document path in storage
651
+ attr_accessor :file_path
652
+ # Array of annotation descriptions
653
+ attr_accessor :annotations
654
+
655
+ #
656
+ # Initializes a new instance.
657
+ # @param file_path Document path in storage
658
+ # @param annotations Array of annotation descriptions
659
+ def initialize(file_path, annotations)
660
+ self.file_path = file_path
661
+ self.annotations = annotations
662
+ end
663
+ end
664
+ end