groupdocs_annotation_cloud 19.5 → 22.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_annotation_cloud/api/annotate_api.rb +107 -263
  3. data/lib/groupdocs_annotation_cloud/api/file_api.rb +7 -7
  4. data/lib/groupdocs_annotation_cloud/api/folder_api.rb +7 -7
  5. data/lib/groupdocs_annotation_cloud/api/info_api.rb +11 -22
  6. data/lib/groupdocs_annotation_cloud/api/license_api.rb +169 -0
  7. data/lib/groupdocs_annotation_cloud/api/preview_api.rb +23 -90
  8. data/lib/groupdocs_annotation_cloud/api/storage_api.rb +5 -5
  9. data/lib/groupdocs_annotation_cloud/api_client.rb +1 -1
  10. data/lib/groupdocs_annotation_cloud/api_error.rb +18 -5
  11. data/lib/groupdocs_annotation_cloud/configuration.rb +1 -1
  12. data/lib/groupdocs_annotation_cloud/models/{row_info.rb → annotate_options.rb} +65 -72
  13. data/lib/groupdocs_annotation_cloud/models/annotation_api_link.rb +1 -1
  14. data/lib/groupdocs_annotation_cloud/models/annotation_info.rb +184 -61
  15. data/lib/groupdocs_annotation_cloud/models/annotation_reply_info.rb +41 -26
  16. data/lib/groupdocs_annotation_cloud/models/consumption_result.rb +234 -0
  17. data/lib/groupdocs_annotation_cloud/models/disc_usage.rb +1 -1
  18. data/lib/groupdocs_annotation_cloud/models/document_info.rb +1 -1
  19. data/lib/groupdocs_annotation_cloud/models/error.rb +1 -1
  20. data/lib/groupdocs_annotation_cloud/models/error_details.rb +1 -1
  21. data/lib/groupdocs_annotation_cloud/models/file_info.rb +244 -0
  22. data/lib/groupdocs_annotation_cloud/models/file_version.rb +1 -1
  23. data/lib/groupdocs_annotation_cloud/models/file_versions.rb +1 -1
  24. data/lib/groupdocs_annotation_cloud/models/files_list.rb +1 -1
  25. data/lib/groupdocs_annotation_cloud/models/files_upload_result.rb +1 -1
  26. data/lib/groupdocs_annotation_cloud/models/format.rb +1 -1
  27. data/lib/groupdocs_annotation_cloud/models/formats_result.rb +1 -1
  28. data/lib/groupdocs_annotation_cloud/models/link.rb +1 -1
  29. data/lib/groupdocs_annotation_cloud/models/link_element.rb +1 -1
  30. data/lib/groupdocs_annotation_cloud/models/object_exist.rb +1 -1
  31. data/lib/groupdocs_annotation_cloud/models/page_image.rb +2 -2
  32. data/lib/groupdocs_annotation_cloud/models/page_images.rb +1 -1
  33. data/lib/groupdocs_annotation_cloud/models/page_info.rb +5 -32
  34. data/lib/groupdocs_annotation_cloud/models/point.rb +1 -1
  35. data/lib/groupdocs_annotation_cloud/models/preview_options.rb +364 -0
  36. data/lib/groupdocs_annotation_cloud/models/rectangle.rb +1 -1
  37. data/lib/groupdocs_annotation_cloud/models/remove_options.rb +236 -0
  38. data/lib/groupdocs_annotation_cloud/models/storage_exist.rb +1 -1
  39. data/lib/groupdocs_annotation_cloud/models/storage_file.rb +1 -1
  40. data/lib/groupdocs_annotation_cloud/version.rb +2 -2
  41. data/lib/groupdocs_annotation_cloud.rb +7 -2
  42. metadata +8 -17
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="page_info.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -40,20 +40,12 @@ module GroupDocsAnnotationCloud
40
40
  # Gets or sets the page height
41
41
  attr_accessor :height
42
42
 
43
- # Indicates whether page is visible or not
44
- attr_accessor :is_visible
45
-
46
- # Gets or sets the list of text rows
47
- attr_accessor :rows
48
-
49
43
  # Attribute mapping from ruby-style variable name to JSON key.
50
44
  def self.attribute_map
51
45
  {
52
46
  :'number' => :'Number',
53
47
  :'width' => :'Width',
54
- :'height' => :'Height',
55
- :'is_visible' => :'IsVisible',
56
- :'rows' => :'Rows'
48
+ :'height' => :'Height'
57
49
  }
58
50
  end
59
51
 
@@ -62,9 +54,7 @@ module GroupDocsAnnotationCloud
62
54
  {
63
55
  :'number' => :'Integer',
64
56
  :'width' => :'Integer',
65
- :'height' => :'Integer',
66
- :'is_visible' => :'BOOLEAN',
67
- :'rows' => :'Array<RowInfo>'
57
+ :'height' => :'Integer'
68
58
  }
69
59
  end
70
60
 
@@ -88,16 +78,6 @@ module GroupDocsAnnotationCloud
88
78
  self.height = attributes[:'Height']
89
79
  end
90
80
 
91
- if attributes.key?(:'IsVisible')
92
- self.is_visible = attributes[:'IsVisible']
93
- end
94
-
95
- if attributes.key?(:'Rows')
96
- if (value = attributes[:'Rows']).is_a?(Array)
97
- self.rows = value
98
- end
99
- end
100
-
101
81
  end
102
82
 
103
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -116,10 +96,6 @@ module GroupDocsAnnotationCloud
116
96
  invalid_properties.push("invalid value for 'height', height cannot be nil.")
117
97
  end
118
98
 
119
- if @is_visible.nil?
120
- invalid_properties.push("invalid value for 'is_visible', is_visible cannot be nil.")
121
- end
122
-
123
99
  return invalid_properties
124
100
  end
125
101
 
@@ -129,7 +105,6 @@ module GroupDocsAnnotationCloud
129
105
  return false if @number.nil?
130
106
  return false if @width.nil?
131
107
  return false if @height.nil?
132
- return false if @is_visible.nil?
133
108
  return true
134
109
  end
135
110
 
@@ -140,9 +115,7 @@ module GroupDocsAnnotationCloud
140
115
  self.class == other.class &&
141
116
  number == other.number &&
142
117
  width == other.width &&
143
- height == other.height &&
144
- is_visible == other.is_visible &&
145
- rows == other.rows
118
+ height == other.height
146
119
  end
147
120
 
148
121
  # @see the `==` method
@@ -154,7 +127,7 @@ module GroupDocsAnnotationCloud
154
127
  # Calculates hash code according to all attributes.
155
128
  # @return [Fixnum] Hash code
156
129
  def hash
157
- [number, width, height, is_visible, rows].hash
130
+ [number, width, height].hash
158
131
  end
159
132
 
160
133
  # Downcases first letter.
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="point.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -0,0 +1,364 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="preview_options.rb">
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsAnnotationCloud
31
+ # Represents options for GetPages API method
32
+ class PreviewOptions
33
+
34
+ # Input document description
35
+ attr_accessor :file_info
36
+
37
+ # Preview format. Supported values are: PNG, JPEG or BMP. Default value is PNG.
38
+ attr_accessor :format
39
+
40
+ # Page numbers to preview. All pages proceeded if not specified.
41
+ attr_accessor :page_numbers
42
+
43
+ # Preview image width. Not required. Default width used if not specified or 0.
44
+ attr_accessor :width
45
+
46
+ # Preview image height. Not required. Default width used if not specified or 0.
47
+ attr_accessor :height
48
+
49
+ # Gets or sets the resolution for generated images, in dots per inch. The default value is 96.
50
+ attr_accessor :resolution
51
+
52
+ # Render document comments. Default value is 'false'.
53
+ attr_accessor :render_comments
54
+
55
+ # The property that controls whether annotations will be generated on the preview. Default State - true.
56
+ attr_accessor :render_annotations
57
+
58
+ # The path to directory containing custom fonts in storage
59
+ attr_accessor :fonts_path
60
+ class EnumAttributeValidator
61
+ attr_reader :datatype
62
+ attr_reader :allowable_values
63
+
64
+ def initialize(datatype, allowable_values)
65
+ @allowable_values = allowable_values.map do |value|
66
+ case datatype.to_s
67
+ when /Integer/i
68
+ value.to_i
69
+ when /Float/i
70
+ value.to_f
71
+ else
72
+ value
73
+ end
74
+ end
75
+ end
76
+
77
+ def valid?(value)
78
+ !value || allowable_values.include?(value)
79
+ end
80
+ end
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'file_info' => :'FileInfo',
86
+ :'format' => :'Format',
87
+ :'page_numbers' => :'PageNumbers',
88
+ :'width' => :'Width',
89
+ :'height' => :'Height',
90
+ :'resolution' => :'Resolution',
91
+ :'render_comments' => :'RenderComments',
92
+ :'render_annotations' => :'RenderAnnotations',
93
+ :'fonts_path' => :'FontsPath'
94
+ }
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.swagger_types
99
+ {
100
+ :'file_info' => :'FileInfo',
101
+ :'format' => :'String',
102
+ :'page_numbers' => :'Array<Integer>',
103
+ :'width' => :'Integer',
104
+ :'height' => :'Integer',
105
+ :'resolution' => :'Integer',
106
+ :'render_comments' => :'BOOLEAN',
107
+ :'render_annotations' => :'BOOLEAN',
108
+ :'fonts_path' => :'String'
109
+ }
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ return unless attributes.is_a?(Hash)
116
+
117
+ # convert string to symbol for hash key
118
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
119
+
120
+ if attributes.key?(:'FileInfo')
121
+ self.file_info = attributes[:'FileInfo']
122
+ end
123
+
124
+ if attributes.key?(:'Format')
125
+ self.format = attributes[:'Format']
126
+ end
127
+
128
+ if attributes.key?(:'PageNumbers')
129
+ if (value = attributes[:'PageNumbers']).is_a?(Array)
130
+ self.page_numbers = value
131
+ end
132
+ end
133
+
134
+ if attributes.key?(:'Width')
135
+ self.width = attributes[:'Width']
136
+ end
137
+
138
+ if attributes.key?(:'Height')
139
+ self.height = attributes[:'Height']
140
+ end
141
+
142
+ if attributes.key?(:'Resolution')
143
+ self.resolution = attributes[:'Resolution']
144
+ end
145
+
146
+ if attributes.key?(:'RenderComments')
147
+ self.render_comments = attributes[:'RenderComments']
148
+ end
149
+
150
+ if attributes.key?(:'RenderAnnotations')
151
+ self.render_annotations = attributes[:'RenderAnnotations']
152
+ end
153
+
154
+ if attributes.key?(:'FontsPath')
155
+ self.fonts_path = attributes[:'FontsPath']
156
+ end
157
+
158
+ end
159
+
160
+ # Show invalid properties with the reasons. Usually used together with valid?
161
+ # @return Array for valid properies with the reasons
162
+ def list_invalid_properties
163
+ invalid_properties = []
164
+ if @format.nil?
165
+ invalid_properties.push("invalid value for 'format', format cannot be nil.")
166
+ end
167
+
168
+ if @width.nil?
169
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
170
+ end
171
+
172
+ if @height.nil?
173
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
174
+ end
175
+
176
+ if @resolution.nil?
177
+ invalid_properties.push("invalid value for 'resolution', resolution cannot be nil.")
178
+ end
179
+
180
+ if @render_comments.nil?
181
+ invalid_properties.push("invalid value for 'render_comments', render_comments cannot be nil.")
182
+ end
183
+
184
+ if @render_annotations.nil?
185
+ invalid_properties.push("invalid value for 'render_annotations', render_annotations cannot be nil.")
186
+ end
187
+
188
+ return invalid_properties
189
+ end
190
+
191
+ # Check to see if the all the properties in the model are valid
192
+ # @return true if the model is valid
193
+ def valid?
194
+ return false if @format.nil?
195
+ format_validator = EnumAttributeValidator.new('String', ["PNG", "JPEG", "BMP"])
196
+ return false unless format_validator.valid?(@format)
197
+ return false if @width.nil?
198
+ return false if @height.nil?
199
+ return false if @resolution.nil?
200
+ return false if @render_comments.nil?
201
+ return false if @render_annotations.nil?
202
+ return true
203
+ end
204
+
205
+ # Custom attribute writer method checking allowed values (enum).
206
+ # @param [Object] format Object to be assigned
207
+ def format=(format)
208
+ validator = EnumAttributeValidator.new('String', ["PNG", "JPEG", "BMP"])
209
+ if format.to_i == 0
210
+ unless validator.valid?(format)
211
+ # raise ArgumentError, "invalid value for 'format', must be one of #{validator.allowable_values}."
212
+ @format = validator.allowable_values[format.to_i]
213
+ end
214
+ @format = format
215
+ else
216
+ @format = validator.allowable_values[format.to_i]
217
+ end
218
+ end
219
+
220
+ # Checks equality by comparing each attribute.
221
+ # @param [Object] Object to be compared
222
+ def ==(other)
223
+ return true if self.equal?(other)
224
+ self.class == other.class &&
225
+ file_info == other.file_info &&
226
+ format == other.format &&
227
+ page_numbers == other.page_numbers &&
228
+ width == other.width &&
229
+ height == other.height &&
230
+ resolution == other.resolution &&
231
+ render_comments == other.render_comments &&
232
+ render_annotations == other.render_annotations &&
233
+ fonts_path == other.fonts_path
234
+ end
235
+
236
+ # @see the `==` method
237
+ # @param [Object] Object to be compared
238
+ def eql?(other)
239
+ self == other
240
+ end
241
+
242
+ # Calculates hash code according to all attributes.
243
+ # @return [Fixnum] Hash code
244
+ def hash
245
+ [file_info, format, page_numbers, width, height, resolution, render_comments, render_annotations, fonts_path].hash
246
+ end
247
+
248
+ # Downcases first letter.
249
+ # @return downcased string
250
+ def uncap(str)
251
+ str[0, 1].downcase + str[1..-1]
252
+ end
253
+
254
+ # Builds the object from hash
255
+ # @param [Hash] attributes Model attributes in the form of hash
256
+ # @return [Object] Returns the model itself
257
+ def build_from_hash(attributes)
258
+ return nil unless attributes.is_a?(Hash)
259
+ self.class.swagger_types.each_pair do |key, type|
260
+ pname = uncap(self.class.attribute_map[key]).intern
261
+ value = attributes[pname]
262
+ if type =~ /\AArray<(.*)>/i
263
+ # check to ensure the input is an array given that the the attribute
264
+ # is documented as an array but the input is not
265
+ if value.is_a?(Array)
266
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
267
+ end
268
+ elsif !value.nil?
269
+ self.send("#{key}=", _deserialize(type, value))
270
+ end
271
+ # or else data not found in attributes(hash), not an issue as the data can be optional
272
+ end
273
+
274
+ self
275
+ end
276
+
277
+ # Deserializes the data based on type
278
+ # @param string type Data type
279
+ # @param string value Value to be deserialized
280
+ # @return [Object] Deserialized data
281
+ def _deserialize(type, value)
282
+ case type.to_sym
283
+ when :DateTime
284
+ Date.parse value
285
+ when :Date
286
+ Date.parse value
287
+ when :String
288
+ value.to_s
289
+ when :Integer
290
+ value.to_i
291
+ when :Float
292
+ value.to_f
293
+ when :BOOLEAN
294
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
295
+ true
296
+ else
297
+ false
298
+ end
299
+ when :Object
300
+ # generic object (usually a Hash), return directly
301
+ value
302
+ when /\AArray<(?<inner_type>.+)>\z/
303
+ inner_type = Regexp.last_match[:inner_type]
304
+ value.map { |v| _deserialize(inner_type, v) }
305
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
306
+ k_type = Regexp.last_match[:k_type]
307
+ v_type = Regexp.last_match[:v_type]
308
+ {}.tap do |hash|
309
+ value.each do |k, v|
310
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
311
+ end
312
+ end
313
+ else
314
+ # model
315
+ temp_model = GroupDocsAnnotationCloud.const_get(type).new
316
+ temp_model.build_from_hash(value)
317
+ end
318
+ end
319
+
320
+ # Returns the string representation of the object
321
+ # @return [String] String presentation of the object
322
+ def to_s
323
+ to_hash.to_s
324
+ end
325
+
326
+ # to_body is an alias to to_hash (backward compatibility)
327
+ # @return [Hash] Returns the object in the form of hash
328
+ def to_body
329
+ to_hash
330
+ end
331
+
332
+ # Returns the object in the form of hash
333
+ # @return [Hash] Returns the object in the form of hash
334
+ def to_hash
335
+ hash = {}
336
+ self.class.attribute_map.each_pair do |attr, param|
337
+ value = self.send(attr)
338
+ next if value.nil?
339
+ hash[param] = _to_hash(value)
340
+ end
341
+ hash
342
+ end
343
+
344
+ # Outputs non-array value in the form of hash
345
+ # For object, use to_hash. Otherwise, just return the value
346
+ # @param [Object] value Any valid value
347
+ # @return [Hash] Returns the value in the form of hash
348
+ def _to_hash(value)
349
+ if value.is_a?(Array)
350
+ value.compact.map { |v| _to_hash(v) }
351
+ elsif value.is_a?(Hash)
352
+ {}.tap do |hash|
353
+ value.each { |k, v| hash[k] = _to_hash(v) }
354
+ end
355
+ elsif value.respond_to? :to_hash
356
+ value.to_hash
357
+ else
358
+ value
359
+ end
360
+ end
361
+
362
+ end
363
+
364
+ end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="rectangle.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy