groupdocs_conversion_cloud 19.4 → 19.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_conversion_cloud.rb +3 -1
  3. data/lib/groupdocs_conversion_cloud/api/convert_api.rb +218 -0
  4. data/lib/groupdocs_conversion_cloud/api/file_api.rb +1 -1
  5. data/lib/groupdocs_conversion_cloud/api/folder_api.rb +1 -1
  6. data/lib/groupdocs_conversion_cloud/api/{conversion_api.rb → info_api.rb} +51 -40
  7. data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +101 -4
  8. data/lib/groupdocs_conversion_cloud/models/cgm_convert_options.rb +101 -4
  9. data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +101 -4
  10. data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +101 -4
  11. data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +101 -4
  12. data/lib/groupdocs_conversion_cloud/models/document_metadata.rb +396 -0
  13. data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +101 -4
  14. data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +101 -4
  15. data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +101 -4
  16. data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +101 -4
  17. data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +98 -1
  18. data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +98 -1
  19. data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +98 -1
  20. data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +98 -1
  21. data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +98 -1
  22. data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +98 -1
  23. data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +98 -1
  24. data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +98 -1
  25. data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +101 -4
  26. data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +101 -4
  27. data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +77 -1
  28. data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +77 -1
  29. data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +77 -1
  30. data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +98 -1
  31. data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +101 -4
  32. data/lib/groupdocs_conversion_cloud/version.rb +1 -1
  33. metadata +5 -3
@@ -64,8 +64,41 @@ module GroupDocsConversionCloud
64
64
  # Watermark specific options
65
65
  attr_accessor :watermark_options
66
66
 
67
+ # Adjust image brightness
68
+ attr_accessor :brightness
69
+
70
+ # Adjust image contrast
71
+ attr_accessor :contrast
72
+
73
+ # Adjust image gamma
74
+ attr_accessor :gamma
75
+
76
+ # Image flip mode
77
+ attr_accessor :flip_mode
78
+
67
79
  # Desired image quality when converting to Jpeg. The value must be between 0 and 100. The default value is 100.
68
80
  attr_accessor :quality
81
+ class EnumAttributeValidator
82
+ attr_reader :datatype
83
+ attr_reader :allowable_values
84
+
85
+ def initialize(datatype, allowable_values)
86
+ @allowable_values = allowable_values.map do |value|
87
+ case datatype.to_s
88
+ when /Integer/i
89
+ value.to_i
90
+ when /Float/i
91
+ value.to_f
92
+ else
93
+ value
94
+ end
95
+ end
96
+ end
97
+
98
+ def valid?(value)
99
+ !value || allowable_values.include?(value)
100
+ end
101
+ end
69
102
 
70
103
  # Attribute mapping from ruby-style variable name to JSON key.
71
104
  def self.attribute_map
@@ -81,6 +114,10 @@ module GroupDocsConversionCloud
81
114
  :'rotate_angle' => :'RotateAngle',
82
115
  :'use_pdf' => :'UsePdf',
83
116
  :'watermark_options' => :'WatermarkOptions',
117
+ :'brightness' => :'Brightness',
118
+ :'contrast' => :'Contrast',
119
+ :'gamma' => :'Gamma',
120
+ :'flip_mode' => :'FlipMode',
84
121
  :'quality' => :'Quality'
85
122
  }
86
123
  end
@@ -99,6 +136,10 @@ module GroupDocsConversionCloud
99
136
  :'rotate_angle' => :'Integer',
100
137
  :'use_pdf' => :'BOOLEAN',
101
138
  :'watermark_options' => :'WatermarkOptions',
139
+ :'brightness' => :'Integer',
140
+ :'contrast' => :'Integer',
141
+ :'gamma' => :'Float',
142
+ :'flip_mode' => :'String',
102
143
  :'quality' => :'Integer'
103
144
  }
104
145
  end
@@ -157,6 +198,22 @@ module GroupDocsConversionCloud
157
198
  self.watermark_options = attributes[:'WatermarkOptions']
158
199
  end
159
200
 
201
+ if attributes.key?(:'Brightness')
202
+ self.brightness = attributes[:'Brightness']
203
+ end
204
+
205
+ if attributes.key?(:'Contrast')
206
+ self.contrast = attributes[:'Contrast']
207
+ end
208
+
209
+ if attributes.key?(:'Gamma')
210
+ self.gamma = attributes[:'Gamma']
211
+ end
212
+
213
+ if attributes.key?(:'FlipMode')
214
+ self.flip_mode = attributes[:'FlipMode']
215
+ end
216
+
160
217
  if attributes.key?(:'Quality')
161
218
  self.quality = attributes[:'Quality']
162
219
  end
@@ -203,6 +260,22 @@ module GroupDocsConversionCloud
203
260
  invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
204
261
  end
205
262
 
263
+ if @brightness.nil?
264
+ invalid_properties.push("invalid value for 'brightness', brightness cannot be nil.")
265
+ end
266
+
267
+ if @contrast.nil?
268
+ invalid_properties.push("invalid value for 'contrast', contrast cannot be nil.")
269
+ end
270
+
271
+ if @gamma.nil?
272
+ invalid_properties.push("invalid value for 'gamma', gamma cannot be nil.")
273
+ end
274
+
275
+ if @flip_mode.nil?
276
+ invalid_properties.push("invalid value for 'flip_mode', flip_mode cannot be nil.")
277
+ end
278
+
206
279
  if @quality.nil?
207
280
  invalid_properties.push("invalid value for 'quality', quality cannot be nil.")
208
281
  end
@@ -222,10 +295,30 @@ module GroupDocsConversionCloud
222
295
  return false if @grayscale.nil?
223
296
  return false if @rotate_angle.nil?
224
297
  return false if @use_pdf.nil?
298
+ return false if @brightness.nil?
299
+ return false if @contrast.nil?
300
+ return false if @gamma.nil?
301
+ return false if @flip_mode.nil?
302
+ flip_mode_validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
303
+ return false unless flip_mode_validator.valid?(@flip_mode)
225
304
  return false if @quality.nil?
226
305
  return true
227
306
  end
228
307
 
308
+ # Custom attribute writer method checking allowed values (enum).
309
+ # @param [Object] flip_mode Object to be assigned
310
+ def flip_mode=(flip_mode)
311
+ validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
312
+ if flip_mode.to_i == 0
313
+ unless validator.valid?(flip_mode)
314
+ raise ArgumentError, "invalid value for 'flip_mode', must be one of #{validator.allowable_values}."
315
+ end
316
+ @flip_mode = flip_mode
317
+ else
318
+ @flip_mode = validator.allowable_values[flip_mode.to_i]
319
+ end
320
+ end
321
+
229
322
  # Checks equality by comparing each attribute.
230
323
  # @param [Object] Object to be compared
231
324
  def ==(other)
@@ -242,6 +335,10 @@ module GroupDocsConversionCloud
242
335
  rotate_angle == other.rotate_angle &&
243
336
  use_pdf == other.use_pdf &&
244
337
  watermark_options == other.watermark_options &&
338
+ brightness == other.brightness &&
339
+ contrast == other.contrast &&
340
+ gamma == other.gamma &&
341
+ flip_mode == other.flip_mode &&
245
342
  quality == other.quality
246
343
  end
247
344
 
@@ -254,7 +351,7 @@ module GroupDocsConversionCloud
254
351
  # Calculates hash code according to all attributes.
255
352
  # @return [Fixnum] Hash code
256
353
  def hash
257
- [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, quality].hash
354
+ [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, brightness, contrast, gamma, flip_mode, quality].hash
258
355
  end
259
356
 
260
357
  # Downcases first letter.
@@ -64,8 +64,41 @@ module GroupDocsConversionCloud
64
64
  # Watermark specific options
65
65
  attr_accessor :watermark_options
66
66
 
67
+ # Adjust image brightness
68
+ attr_accessor :brightness
69
+
70
+ # Adjust image contrast
71
+ attr_accessor :contrast
72
+
73
+ # Adjust image gamma
74
+ attr_accessor :gamma
75
+
76
+ # Image flip mode
77
+ attr_accessor :flip_mode
78
+
67
79
  # Desired image quality when converting to Jpeg. The value must be between 0 and 100. The default value is 100.
68
80
  attr_accessor :quality
81
+ class EnumAttributeValidator
82
+ attr_reader :datatype
83
+ attr_reader :allowable_values
84
+
85
+ def initialize(datatype, allowable_values)
86
+ @allowable_values = allowable_values.map do |value|
87
+ case datatype.to_s
88
+ when /Integer/i
89
+ value.to_i
90
+ when /Float/i
91
+ value.to_f
92
+ else
93
+ value
94
+ end
95
+ end
96
+ end
97
+
98
+ def valid?(value)
99
+ !value || allowable_values.include?(value)
100
+ end
101
+ end
69
102
 
70
103
  # Attribute mapping from ruby-style variable name to JSON key.
71
104
  def self.attribute_map
@@ -81,6 +114,10 @@ module GroupDocsConversionCloud
81
114
  :'rotate_angle' => :'RotateAngle',
82
115
  :'use_pdf' => :'UsePdf',
83
116
  :'watermark_options' => :'WatermarkOptions',
117
+ :'brightness' => :'Brightness',
118
+ :'contrast' => :'Contrast',
119
+ :'gamma' => :'Gamma',
120
+ :'flip_mode' => :'FlipMode',
84
121
  :'quality' => :'Quality'
85
122
  }
86
123
  end
@@ -99,6 +136,10 @@ module GroupDocsConversionCloud
99
136
  :'rotate_angle' => :'Integer',
100
137
  :'use_pdf' => :'BOOLEAN',
101
138
  :'watermark_options' => :'WatermarkOptions',
139
+ :'brightness' => :'Integer',
140
+ :'contrast' => :'Integer',
141
+ :'gamma' => :'Float',
142
+ :'flip_mode' => :'String',
102
143
  :'quality' => :'Integer'
103
144
  }
104
145
  end
@@ -157,6 +198,22 @@ module GroupDocsConversionCloud
157
198
  self.watermark_options = attributes[:'WatermarkOptions']
158
199
  end
159
200
 
201
+ if attributes.key?(:'Brightness')
202
+ self.brightness = attributes[:'Brightness']
203
+ end
204
+
205
+ if attributes.key?(:'Contrast')
206
+ self.contrast = attributes[:'Contrast']
207
+ end
208
+
209
+ if attributes.key?(:'Gamma')
210
+ self.gamma = attributes[:'Gamma']
211
+ end
212
+
213
+ if attributes.key?(:'FlipMode')
214
+ self.flip_mode = attributes[:'FlipMode']
215
+ end
216
+
160
217
  if attributes.key?(:'Quality')
161
218
  self.quality = attributes[:'Quality']
162
219
  end
@@ -203,6 +260,22 @@ module GroupDocsConversionCloud
203
260
  invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
204
261
  end
205
262
 
263
+ if @brightness.nil?
264
+ invalid_properties.push("invalid value for 'brightness', brightness cannot be nil.")
265
+ end
266
+
267
+ if @contrast.nil?
268
+ invalid_properties.push("invalid value for 'contrast', contrast cannot be nil.")
269
+ end
270
+
271
+ if @gamma.nil?
272
+ invalid_properties.push("invalid value for 'gamma', gamma cannot be nil.")
273
+ end
274
+
275
+ if @flip_mode.nil?
276
+ invalid_properties.push("invalid value for 'flip_mode', flip_mode cannot be nil.")
277
+ end
278
+
206
279
  if @quality.nil?
207
280
  invalid_properties.push("invalid value for 'quality', quality cannot be nil.")
208
281
  end
@@ -222,10 +295,30 @@ module GroupDocsConversionCloud
222
295
  return false if @grayscale.nil?
223
296
  return false if @rotate_angle.nil?
224
297
  return false if @use_pdf.nil?
298
+ return false if @brightness.nil?
299
+ return false if @contrast.nil?
300
+ return false if @gamma.nil?
301
+ return false if @flip_mode.nil?
302
+ flip_mode_validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
303
+ return false unless flip_mode_validator.valid?(@flip_mode)
225
304
  return false if @quality.nil?
226
305
  return true
227
306
  end
228
307
 
308
+ # Custom attribute writer method checking allowed values (enum).
309
+ # @param [Object] flip_mode Object to be assigned
310
+ def flip_mode=(flip_mode)
311
+ validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
312
+ if flip_mode.to_i == 0
313
+ unless validator.valid?(flip_mode)
314
+ raise ArgumentError, "invalid value for 'flip_mode', must be one of #{validator.allowable_values}."
315
+ end
316
+ @flip_mode = flip_mode
317
+ else
318
+ @flip_mode = validator.allowable_values[flip_mode.to_i]
319
+ end
320
+ end
321
+
229
322
  # Checks equality by comparing each attribute.
230
323
  # @param [Object] Object to be compared
231
324
  def ==(other)
@@ -242,6 +335,10 @@ module GroupDocsConversionCloud
242
335
  rotate_angle == other.rotate_angle &&
243
336
  use_pdf == other.use_pdf &&
244
337
  watermark_options == other.watermark_options &&
338
+ brightness == other.brightness &&
339
+ contrast == other.contrast &&
340
+ gamma == other.gamma &&
341
+ flip_mode == other.flip_mode &&
245
342
  quality == other.quality
246
343
  end
247
344
 
@@ -254,7 +351,7 @@ module GroupDocsConversionCloud
254
351
  # Calculates hash code according to all attributes.
255
352
  # @return [Fixnum] Hash code
256
353
  def hash
257
- [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, quality].hash
354
+ [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, brightness, contrast, gamma, flip_mode, quality].hash
258
355
  end
259
356
 
260
357
  # Downcases first letter.
@@ -64,8 +64,41 @@ module GroupDocsConversionCloud
64
64
  # Watermark specific options
65
65
  attr_accessor :watermark_options
66
66
 
67
+ # Adjust image brightness
68
+ attr_accessor :brightness
69
+
70
+ # Adjust image contrast
71
+ attr_accessor :contrast
72
+
73
+ # Adjust image gamma
74
+ attr_accessor :gamma
75
+
76
+ # Image flip mode
77
+ attr_accessor :flip_mode
78
+
67
79
  # Desired image quality when converting to Jpeg. The value must be between 0 and 100. The default value is 100.
68
80
  attr_accessor :quality
81
+ class EnumAttributeValidator
82
+ attr_reader :datatype
83
+ attr_reader :allowable_values
84
+
85
+ def initialize(datatype, allowable_values)
86
+ @allowable_values = allowable_values.map do |value|
87
+ case datatype.to_s
88
+ when /Integer/i
89
+ value.to_i
90
+ when /Float/i
91
+ value.to_f
92
+ else
93
+ value
94
+ end
95
+ end
96
+ end
97
+
98
+ def valid?(value)
99
+ !value || allowable_values.include?(value)
100
+ end
101
+ end
69
102
 
70
103
  # Attribute mapping from ruby-style variable name to JSON key.
71
104
  def self.attribute_map
@@ -81,6 +114,10 @@ module GroupDocsConversionCloud
81
114
  :'rotate_angle' => :'RotateAngle',
82
115
  :'use_pdf' => :'UsePdf',
83
116
  :'watermark_options' => :'WatermarkOptions',
117
+ :'brightness' => :'Brightness',
118
+ :'contrast' => :'Contrast',
119
+ :'gamma' => :'Gamma',
120
+ :'flip_mode' => :'FlipMode',
84
121
  :'quality' => :'Quality'
85
122
  }
86
123
  end
@@ -99,6 +136,10 @@ module GroupDocsConversionCloud
99
136
  :'rotate_angle' => :'Integer',
100
137
  :'use_pdf' => :'BOOLEAN',
101
138
  :'watermark_options' => :'WatermarkOptions',
139
+ :'brightness' => :'Integer',
140
+ :'contrast' => :'Integer',
141
+ :'gamma' => :'Float',
142
+ :'flip_mode' => :'String',
102
143
  :'quality' => :'Integer'
103
144
  }
104
145
  end
@@ -157,6 +198,22 @@ module GroupDocsConversionCloud
157
198
  self.watermark_options = attributes[:'WatermarkOptions']
158
199
  end
159
200
 
201
+ if attributes.key?(:'Brightness')
202
+ self.brightness = attributes[:'Brightness']
203
+ end
204
+
205
+ if attributes.key?(:'Contrast')
206
+ self.contrast = attributes[:'Contrast']
207
+ end
208
+
209
+ if attributes.key?(:'Gamma')
210
+ self.gamma = attributes[:'Gamma']
211
+ end
212
+
213
+ if attributes.key?(:'FlipMode')
214
+ self.flip_mode = attributes[:'FlipMode']
215
+ end
216
+
160
217
  if attributes.key?(:'Quality')
161
218
  self.quality = attributes[:'Quality']
162
219
  end
@@ -203,6 +260,22 @@ module GroupDocsConversionCloud
203
260
  invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
204
261
  end
205
262
 
263
+ if @brightness.nil?
264
+ invalid_properties.push("invalid value for 'brightness', brightness cannot be nil.")
265
+ end
266
+
267
+ if @contrast.nil?
268
+ invalid_properties.push("invalid value for 'contrast', contrast cannot be nil.")
269
+ end
270
+
271
+ if @gamma.nil?
272
+ invalid_properties.push("invalid value for 'gamma', gamma cannot be nil.")
273
+ end
274
+
275
+ if @flip_mode.nil?
276
+ invalid_properties.push("invalid value for 'flip_mode', flip_mode cannot be nil.")
277
+ end
278
+
206
279
  if @quality.nil?
207
280
  invalid_properties.push("invalid value for 'quality', quality cannot be nil.")
208
281
  end
@@ -222,10 +295,30 @@ module GroupDocsConversionCloud
222
295
  return false if @grayscale.nil?
223
296
  return false if @rotate_angle.nil?
224
297
  return false if @use_pdf.nil?
298
+ return false if @brightness.nil?
299
+ return false if @contrast.nil?
300
+ return false if @gamma.nil?
301
+ return false if @flip_mode.nil?
302
+ flip_mode_validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
303
+ return false unless flip_mode_validator.valid?(@flip_mode)
225
304
  return false if @quality.nil?
226
305
  return true
227
306
  end
228
307
 
308
+ # Custom attribute writer method checking allowed values (enum).
309
+ # @param [Object] flip_mode Object to be assigned
310
+ def flip_mode=(flip_mode)
311
+ validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
312
+ if flip_mode.to_i == 0
313
+ unless validator.valid?(flip_mode)
314
+ raise ArgumentError, "invalid value for 'flip_mode', must be one of #{validator.allowable_values}."
315
+ end
316
+ @flip_mode = flip_mode
317
+ else
318
+ @flip_mode = validator.allowable_values[flip_mode.to_i]
319
+ end
320
+ end
321
+
229
322
  # Checks equality by comparing each attribute.
230
323
  # @param [Object] Object to be compared
231
324
  def ==(other)
@@ -242,6 +335,10 @@ module GroupDocsConversionCloud
242
335
  rotate_angle == other.rotate_angle &&
243
336
  use_pdf == other.use_pdf &&
244
337
  watermark_options == other.watermark_options &&
338
+ brightness == other.brightness &&
339
+ contrast == other.contrast &&
340
+ gamma == other.gamma &&
341
+ flip_mode == other.flip_mode &&
245
342
  quality == other.quality
246
343
  end
247
344
 
@@ -254,7 +351,7 @@ module GroupDocsConversionCloud
254
351
  # Calculates hash code according to all attributes.
255
352
  # @return [Fixnum] Hash code
256
353
  def hash
257
- [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, quality].hash
354
+ [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, brightness, contrast, gamma, flip_mode, quality].hash
258
355
  end
259
356
 
260
357
  # Downcases first letter.