groupdocs_conversion_cloud 25.10 → 25.12

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_conversion_cloud/models/{tsv_convert_options.rb → cad_convert_options.rb} +74 -32
  3. data/lib/groupdocs_conversion_cloud/models/{pps_convert_options.rb → compression_convert_options.rb} +7 -22
  4. data/lib/groupdocs_conversion_cloud/models/{odp_convert_options.rb → diagram_convert_options.rb} +14 -24
  5. data/lib/groupdocs_conversion_cloud/models/{otp_convert_options.rb → email_convert_options.rb} +7 -32
  6. data/lib/groupdocs_conversion_cloud/models/{ppt_convert_options.rb → finance_convert_options.rb} +7 -32
  7. data/lib/groupdocs_conversion_cloud/models/{potm_convert_options.rb → font_convert_options.rb} +7 -32
  8. data/lib/groupdocs_conversion_cloud/models/{txt_convert_options.rb → gis_convert_options.rb} +3 -3
  9. data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +44 -4
  10. data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +1 -265
  11. data/lib/groupdocs_conversion_cloud/models/pdl_convert_options.rb +35 -5
  12. data/lib/groupdocs_conversion_cloud/models/project_management_convert_options.rb +256 -0
  13. data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +1 -244
  14. data/lib/groupdocs_conversion_cloud/models/rtf_convert_options.rb +1 -237
  15. data/lib/groupdocs_conversion_cloud/models/spreadsheet_convert_options.rb +4 -19
  16. data/lib/groupdocs_conversion_cloud/models/three_d_convert_options.rb +256 -0
  17. data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +1 -244
  18. data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +1 -265
  19. data/lib/groupdocs_conversion_cloud/models/word_processing_convert_options.rb +14 -4
  20. data/lib/groupdocs_conversion_cloud/version.rb +1 -1
  21. data/lib/groupdocs_conversion_cloud.rb +14 -52
  22. metadata +11 -49
  23. data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +0 -468
  24. data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +0 -468
  25. data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +0 -468
  26. data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +0 -468
  27. data/lib/groupdocs_conversion_cloud/models/doc_convert_options.rb +0 -440
  28. data/lib/groupdocs_conversion_cloud/models/docm_convert_options.rb +0 -440
  29. data/lib/groupdocs_conversion_cloud/models/docx_convert_options.rb +0 -440
  30. data/lib/groupdocs_conversion_cloud/models/dot_convert_options.rb +0 -440
  31. data/lib/groupdocs_conversion_cloud/models/dotm_convert_options.rb +0 -440
  32. data/lib/groupdocs_conversion_cloud/models/dotx_convert_options.rb +0 -440
  33. data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +0 -468
  34. data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +0 -468
  35. data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +0 -468
  36. data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +0 -483
  37. data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +0 -483
  38. data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +0 -483
  39. data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +0 -483
  40. data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +0 -483
  41. data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +0 -483
  42. data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +0 -483
  43. data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +0 -468
  44. data/lib/groupdocs_conversion_cloud/models/ods_convert_options.rb +0 -296
  45. data/lib/groupdocs_conversion_cloud/models/odt_convert_options.rb +0 -440
  46. data/lib/groupdocs_conversion_cloud/models/ots_convert_options.rb +0 -296
  47. data/lib/groupdocs_conversion_cloud/models/ott_convert_options.rb +0 -440
  48. data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +0 -468
  49. data/lib/groupdocs_conversion_cloud/models/potx_convert_options.rb +0 -281
  50. data/lib/groupdocs_conversion_cloud/models/ppsm_convert_options.rb +0 -281
  51. data/lib/groupdocs_conversion_cloud/models/ppsx_convert_options.rb +0 -281
  52. data/lib/groupdocs_conversion_cloud/models/pptm_convert_options.rb +0 -281
  53. data/lib/groupdocs_conversion_cloud/models/pptx_convert_options.rb +0 -281
  54. data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +0 -494
  55. data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +0 -468
  56. data/lib/groupdocs_conversion_cloud/models/xls2003_convert_options.rb +0 -296
  57. data/lib/groupdocs_conversion_cloud/models/xls_convert_options.rb +0 -296
  58. data/lib/groupdocs_conversion_cloud/models/xlsb_convert_options.rb +0 -296
  59. data/lib/groupdocs_conversion_cloud/models/xlsm_convert_options.rb +0 -296
  60. data/lib/groupdocs_conversion_cloud/models/xlsx_convert_options.rb +0 -296
  61. data/lib/groupdocs_conversion_cloud/models/xltm_convert_options.rb +0 -296
  62. data/lib/groupdocs_conversion_cloud/models/xltx_convert_options.rb +0 -296
@@ -31,81 +31,12 @@ module GroupDocsConversionCloud
31
31
  # Rtf convert options
32
32
  class RtfConvertOptions
33
33
 
34
- # Start conversion from FromPage page
35
- attr_accessor :from_page
36
-
37
- # Number of pages to convert
38
- attr_accessor :pages_count
39
-
40
- # Convert specific pages. The list contains the page indexes of the pages to be converted
41
- attr_accessor :pages
42
-
43
- # Watermark specific options
44
- attr_accessor :watermark_options
45
-
46
- # Desired page width after conversion
47
- attr_accessor :width
48
-
49
- # Desired page height after conversion
50
- attr_accessor :height
51
-
52
- # Desired page DPI after conversion. The default resolution is: 96dpi
53
- attr_accessor :dpi
54
-
55
- # Set this property if you want to protect the converted document with a password
56
- attr_accessor :password
57
-
58
- # Specifies the zoom level in percentage. Default is 100. Default zoom is supported till Microsoft Word 2010. Starting from Microsoft Word 2013 default zoom is no longer set to document, instead it appears to use the zoom factor of the last document that was opened.
59
- attr_accessor :zoom
60
-
61
- # Recognition mode when converting from pdf
62
- attr_accessor :pdf_recognition_mode
63
-
64
- # Page size
65
- attr_accessor :page_size
66
-
67
- # Specifies page orientation
68
- attr_accessor :page_orientation
69
-
70
34
  # Specifies whether the keywords for \"old readers\" are written to RTF or not. This can significantly affect the size of the RTF document. Default is False.
71
35
  attr_accessor :export_images_for_old_readers
72
- class EnumAttributeValidator
73
- attr_reader :datatype
74
- attr_reader :allowable_values
75
-
76
- def initialize(datatype, allowable_values)
77
- @allowable_values = allowable_values.map do |value|
78
- case datatype.to_s
79
- when /Integer/i
80
- value.to_i
81
- when /Float/i
82
- value.to_f
83
- else
84
- value
85
- end
86
- end
87
- end
88
-
89
- def valid?(value)
90
- !value || allowable_values.include?(value)
91
- end
92
- end
93
36
 
94
37
  # Attribute mapping from ruby-style variable name to JSON key.
95
38
  def self.attribute_map
96
39
  {
97
- :'from_page' => :'FromPage',
98
- :'pages_count' => :'PagesCount',
99
- :'pages' => :'Pages',
100
- :'watermark_options' => :'WatermarkOptions',
101
- :'width' => :'Width',
102
- :'height' => :'Height',
103
- :'dpi' => :'Dpi',
104
- :'password' => :'Password',
105
- :'zoom' => :'Zoom',
106
- :'pdf_recognition_mode' => :'PdfRecognitionMode',
107
- :'page_size' => :'PageSize',
108
- :'page_orientation' => :'PageOrientation',
109
40
  :'export_images_for_old_readers' => :'ExportImagesForOldReaders'
110
41
  }
111
42
  end
@@ -113,18 +44,6 @@ module GroupDocsConversionCloud
113
44
  # Attribute type mapping.
114
45
  def self.swagger_types
115
46
  {
116
- :'from_page' => :'Integer',
117
- :'pages_count' => :'Integer',
118
- :'pages' => :'Array<Integer>',
119
- :'watermark_options' => :'WatermarkOptions',
120
- :'width' => :'Integer',
121
- :'height' => :'Integer',
122
- :'dpi' => :'Integer',
123
- :'password' => :'String',
124
- :'zoom' => :'Integer',
125
- :'pdf_recognition_mode' => :'String',
126
- :'page_size' => :'String',
127
- :'page_orientation' => :'String',
128
47
  :'export_images_for_old_readers' => :'BOOLEAN'
129
48
  }
130
49
  end
@@ -137,56 +56,6 @@ module GroupDocsConversionCloud
137
56
  # convert string to symbol for hash key
138
57
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
139
58
 
140
- if attributes.key?(:'FromPage')
141
- self.from_page = attributes[:'FromPage']
142
- end
143
-
144
- if attributes.key?(:'PagesCount')
145
- self.pages_count = attributes[:'PagesCount']
146
- end
147
-
148
- if attributes.key?(:'Pages')
149
- if (value = attributes[:'Pages']).is_a?(Array)
150
- self.pages = value
151
- end
152
- end
153
-
154
- if attributes.key?(:'WatermarkOptions')
155
- self.watermark_options = attributes[:'WatermarkOptions']
156
- end
157
-
158
- if attributes.key?(:'Width')
159
- self.width = attributes[:'Width']
160
- end
161
-
162
- if attributes.key?(:'Height')
163
- self.height = attributes[:'Height']
164
- end
165
-
166
- if attributes.key?(:'Dpi')
167
- self.dpi = attributes[:'Dpi']
168
- end
169
-
170
- if attributes.key?(:'Password')
171
- self.password = attributes[:'Password']
172
- end
173
-
174
- if attributes.key?(:'Zoom')
175
- self.zoom = attributes[:'Zoom']
176
- end
177
-
178
- if attributes.key?(:'PdfRecognitionMode')
179
- self.pdf_recognition_mode = attributes[:'PdfRecognitionMode']
180
- end
181
-
182
- if attributes.key?(:'PageSize')
183
- self.page_size = attributes[:'PageSize']
184
- end
185
-
186
- if attributes.key?(:'PageOrientation')
187
- self.page_orientation = attributes[:'PageOrientation']
188
- end
189
-
190
59
  if attributes.key?(:'ExportImagesForOldReaders')
191
60
  self.export_images_for_old_readers = attributes[:'ExportImagesForOldReaders']
192
61
  end
@@ -197,42 +66,6 @@ module GroupDocsConversionCloud
197
66
  # @return Array for valid properies with the reasons
198
67
  def list_invalid_properties
199
68
  invalid_properties = []
200
- if @from_page.nil?
201
- invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
202
- end
203
-
204
- if @pages_count.nil?
205
- invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
206
- end
207
-
208
- if @width.nil?
209
- invalid_properties.push("invalid value for 'width', width cannot be nil.")
210
- end
211
-
212
- if @height.nil?
213
- invalid_properties.push("invalid value for 'height', height cannot be nil.")
214
- end
215
-
216
- if @dpi.nil?
217
- invalid_properties.push("invalid value for 'dpi', dpi cannot be nil.")
218
- end
219
-
220
- if @zoom.nil?
221
- invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
222
- end
223
-
224
- if @pdf_recognition_mode.nil?
225
- invalid_properties.push("invalid value for 'pdf_recognition_mode', pdf_recognition_mode cannot be nil.")
226
- end
227
-
228
- if @page_size.nil?
229
- invalid_properties.push("invalid value for 'page_size', page_size cannot be nil.")
230
- end
231
-
232
- if @page_orientation.nil?
233
- invalid_properties.push("invalid value for 'page_orientation', page_orientation cannot be nil.")
234
- end
235
-
236
69
  if @export_images_for_old_readers.nil?
237
70
  invalid_properties.push("invalid value for 'export_images_for_old_readers', export_images_for_old_readers cannot be nil.")
238
71
  end
@@ -243,84 +76,15 @@ module GroupDocsConversionCloud
243
76
  # Check to see if the all the properties in the model are valid
244
77
  # @return true if the model is valid
245
78
  def valid?
246
- return false if @from_page.nil?
247
- return false if @pages_count.nil?
248
- return false if @width.nil?
249
- return false if @height.nil?
250
- return false if @dpi.nil?
251
- return false if @zoom.nil?
252
- return false if @pdf_recognition_mode.nil?
253
- pdf_recognition_mode_validator = EnumAttributeValidator.new('String', ["Textbox", "Flow"])
254
- return false unless pdf_recognition_mode_validator.valid?(@pdf_recognition_mode)
255
- return false if @page_size.nil?
256
- page_size_validator = EnumAttributeValidator.new('String', ["Default", "A3", "Statement", "Quarto", "Paper11x17", "Paper10x14", "Letter", "Legal", "Ledger", "Folio", "Executive", "EnvelopeDL", "Custom", "B5", "B4", "A5", "A4", "Tabloid"])
257
- return false unless page_size_validator.valid?(@page_size)
258
- return false if @page_orientation.nil?
259
- page_orientation_validator = EnumAttributeValidator.new('String', ["Default", "Landscape", "Portrait"])
260
- return false unless page_orientation_validator.valid?(@page_orientation)
261
79
  return false if @export_images_for_old_readers.nil?
262
80
  return true
263
81
  end
264
82
 
265
- # Custom attribute writer method checking allowed values (enum).
266
- # @param [Object] pdf_recognition_mode Object to be assigned
267
- def pdf_recognition_mode=(pdf_recognition_mode)
268
- validator = EnumAttributeValidator.new('String', ["Textbox", "Flow"])
269
- if pdf_recognition_mode.to_i == 0
270
- unless validator.valid?(pdf_recognition_mode)
271
- raise ArgumentError, "invalid value for 'pdf_recognition_mode', must be one of #{validator.allowable_values}."
272
- end
273
- @pdf_recognition_mode = pdf_recognition_mode
274
- else
275
- @pdf_recognition_mode = validator.allowable_values[pdf_recognition_mode.to_i]
276
- end
277
- end
278
-
279
- # Custom attribute writer method checking allowed values (enum).
280
- # @param [Object] page_size Object to be assigned
281
- def page_size=(page_size)
282
- validator = EnumAttributeValidator.new('String', ["Default", "A3", "Statement", "Quarto", "Paper11x17", "Paper10x14", "Letter", "Legal", "Ledger", "Folio", "Executive", "EnvelopeDL", "Custom", "B5", "B4", "A5", "A4", "Tabloid"])
283
- if page_size.to_i == 0
284
- unless validator.valid?(page_size)
285
- raise ArgumentError, "invalid value for 'page_size', must be one of #{validator.allowable_values}."
286
- end
287
- @page_size = page_size
288
- else
289
- @page_size = validator.allowable_values[page_size.to_i]
290
- end
291
- end
292
-
293
- # Custom attribute writer method checking allowed values (enum).
294
- # @param [Object] page_orientation Object to be assigned
295
- def page_orientation=(page_orientation)
296
- validator = EnumAttributeValidator.new('String', ["Default", "Landscape", "Portrait"])
297
- if page_orientation.to_i == 0
298
- unless validator.valid?(page_orientation)
299
- raise ArgumentError, "invalid value for 'page_orientation', must be one of #{validator.allowable_values}."
300
- end
301
- @page_orientation = page_orientation
302
- else
303
- @page_orientation = validator.allowable_values[page_orientation.to_i]
304
- end
305
- end
306
-
307
83
  # Checks equality by comparing each attribute.
308
84
  # @param [Object] Object to be compared
309
85
  def ==(other)
310
86
  return true if self.equal?(other)
311
87
  self.class == other.class &&
312
- from_page == other.from_page &&
313
- pages_count == other.pages_count &&
314
- pages == other.pages &&
315
- watermark_options == other.watermark_options &&
316
- width == other.width &&
317
- height == other.height &&
318
- dpi == other.dpi &&
319
- password == other.password &&
320
- zoom == other.zoom &&
321
- pdf_recognition_mode == other.pdf_recognition_mode &&
322
- page_size == other.page_size &&
323
- page_orientation == other.page_orientation &&
324
88
  export_images_for_old_readers == other.export_images_for_old_readers
325
89
  end
326
90
 
@@ -333,7 +97,7 @@ module GroupDocsConversionCloud
333
97
  # Calculates hash code according to all attributes.
334
98
  # @return [Fixnum] Hash code
335
99
  def hash
336
- [from_page, pages_count, pages, watermark_options, width, height, dpi, password, zoom, pdf_recognition_mode, page_size, page_orientation, export_images_for_old_readers].hash
100
+ [export_images_for_old_readers].hash
337
101
  end
338
102
 
339
103
  # Downcases first letter.
@@ -49,9 +49,6 @@ module GroupDocsConversionCloud
49
49
  # Specifies the zoom level in percentage. Default is 100.
50
50
  attr_accessor :zoom
51
51
 
52
- # If true, the input firstly is converted to PDF and after that to desired format
53
- attr_accessor :use_pdf
54
-
55
52
  # Attribute mapping from ruby-style variable name to JSON key.
56
53
  def self.attribute_map
57
54
  {
@@ -60,8 +57,7 @@ module GroupDocsConversionCloud
60
57
  :'pages' => :'Pages',
61
58
  :'watermark_options' => :'WatermarkOptions',
62
59
  :'password' => :'Password',
63
- :'zoom' => :'Zoom',
64
- :'use_pdf' => :'UsePdf'
60
+ :'zoom' => :'Zoom'
65
61
  }
66
62
  end
67
63
 
@@ -73,8 +69,7 @@ module GroupDocsConversionCloud
73
69
  :'pages' => :'Array<Integer>',
74
70
  :'watermark_options' => :'WatermarkOptions',
75
71
  :'password' => :'String',
76
- :'zoom' => :'Integer',
77
- :'use_pdf' => :'BOOLEAN'
72
+ :'zoom' => :'Integer'
78
73
  }
79
74
  end
80
75
 
@@ -112,10 +107,6 @@ module GroupDocsConversionCloud
112
107
  self.zoom = attributes[:'Zoom']
113
108
  end
114
109
 
115
- if attributes.key?(:'UsePdf')
116
- self.use_pdf = attributes[:'UsePdf']
117
- end
118
-
119
110
  end
120
111
 
121
112
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -134,10 +125,6 @@ module GroupDocsConversionCloud
134
125
  invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
135
126
  end
136
127
 
137
- if @use_pdf.nil?
138
- invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
139
- end
140
-
141
128
  return invalid_properties
142
129
  end
143
130
 
@@ -147,7 +134,6 @@ module GroupDocsConversionCloud
147
134
  return false if @from_page.nil?
148
135
  return false if @pages_count.nil?
149
136
  return false if @zoom.nil?
150
- return false if @use_pdf.nil?
151
137
  return true
152
138
  end
153
139
 
@@ -161,8 +147,7 @@ module GroupDocsConversionCloud
161
147
  pages == other.pages &&
162
148
  watermark_options == other.watermark_options &&
163
149
  password == other.password &&
164
- zoom == other.zoom &&
165
- use_pdf == other.use_pdf
150
+ zoom == other.zoom
166
151
  end
167
152
 
168
153
  # @see the `==` method
@@ -174,7 +159,7 @@ module GroupDocsConversionCloud
174
159
  # Calculates hash code according to all attributes.
175
160
  # @return [Fixnum] Hash code
176
161
  def hash
177
- [from_page, pages_count, pages, watermark_options, password, zoom, use_pdf].hash
162
+ [from_page, pages_count, pages, watermark_options, password, zoom].hash
178
163
  end
179
164
 
180
165
  # Downcases first letter.
@@ -0,0 +1,256 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="three_d_convert_options.rb">
4
+ # Copyright (c) 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 GroupDocsConversionCloud
31
+ # Options for to 3d conversion
32
+ class ThreeDConvertOptions
33
+
34
+ # Start conversion from FromPage page
35
+ attr_accessor :from_page
36
+
37
+ # Number of pages to convert
38
+ attr_accessor :pages_count
39
+
40
+ # Convert specific pages. The list contains the page indexes of the pages to be converted
41
+ attr_accessor :pages
42
+
43
+ # Watermark specific options
44
+ attr_accessor :watermark_options
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'from_page' => :'FromPage',
50
+ :'pages_count' => :'PagesCount',
51
+ :'pages' => :'Pages',
52
+ :'watermark_options' => :'WatermarkOptions'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'from_page' => :'Integer',
60
+ :'pages_count' => :'Integer',
61
+ :'pages' => :'Array<Integer>',
62
+ :'watermark_options' => :'WatermarkOptions'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.key?(:'FromPage')
75
+ self.from_page = attributes[:'FromPage']
76
+ end
77
+
78
+ if attributes.key?(:'PagesCount')
79
+ self.pages_count = attributes[:'PagesCount']
80
+ end
81
+
82
+ if attributes.key?(:'Pages')
83
+ if (value = attributes[:'Pages']).is_a?(Array)
84
+ self.pages = value
85
+ end
86
+ end
87
+
88
+ if attributes.key?(:'WatermarkOptions')
89
+ self.watermark_options = attributes[:'WatermarkOptions']
90
+ end
91
+
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properies with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = []
98
+ if @from_page.nil?
99
+ invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
100
+ end
101
+
102
+ if @pages_count.nil?
103
+ invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
104
+ end
105
+
106
+ return invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return false if @from_page.nil?
113
+ return false if @pages_count.nil?
114
+ return true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(other)
120
+ return true if self.equal?(other)
121
+ self.class == other.class &&
122
+ from_page == other.from_page &&
123
+ pages_count == other.pages_count &&
124
+ pages == other.pages &&
125
+ watermark_options == other.watermark_options
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(other)
131
+ self == other
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [from_page, pages_count, pages, watermark_options].hash
138
+ end
139
+
140
+ # Downcases first letter.
141
+ # @return downcased string
142
+ def uncap(str)
143
+ str[0, 1].downcase + str[1..-1]
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.swagger_types.each_pair do |key, type|
152
+ pname = uncap(self.class.attribute_map[key]).intern
153
+ value = attributes[pname]
154
+ if type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the the attribute
156
+ # is documented as an array but the input is not
157
+ if value.is_a?(Array)
158
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !value.nil?
161
+ self.send("#{key}=", _deserialize(type, value))
162
+ end
163
+ # or else data not found in attributes(hash), not an issue as the data can be optional
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ Date.parse value
177
+ when :Date
178
+ Date.parse value
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :BOOLEAN
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else
206
+ # model
207
+ temp_model = GroupDocsConversionCloud.const_get(type).new
208
+ temp_model.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ next if value.nil?
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end