aspose_words_cloud 22.1.0 → 22.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud/api/words_api.rb +328 -218
  3. data/lib/aspose_words_cloud/api_client.rb +82 -66
  4. data/lib/aspose_words_cloud/configuration.rb +6 -4
  5. data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +124 -14
  6. data/lib/aspose_words_cloud/models/doc_save_options_data.rb +57 -11
  7. data/lib/aspose_words_cloud/models/{ooxml_save_options_data.rb → docm_save_options_data.rb} +79 -17
  8. data/lib/aspose_words_cloud/models/document_entry.rb +14 -14
  9. data/lib/aspose_words_cloud/models/docx_save_options_data.rb +504 -0
  10. data/lib/aspose_words_cloud/models/{fixed_page_save_options_data.rb → dot_save_options_data.rb} +89 -74
  11. data/lib/aspose_words_cloud/models/dotm_save_options_data.rb +504 -0
  12. data/lib/aspose_words_cloud/models/dotx_save_options_data.rb +504 -0
  13. data/lib/aspose_words_cloud/models/emf_save_options_data.rb +124 -14
  14. data/lib/aspose_words_cloud/models/epub_save_options_data.rb +150 -14
  15. data/lib/aspose_words_cloud/models/flat_opc_macro_save_options_data.rb +504 -0
  16. data/lib/aspose_words_cloud/models/flat_opc_save_options_data.rb +504 -0
  17. data/lib/aspose_words_cloud/models/flat_opc_template_macro_save_options_data.rb +504 -0
  18. data/lib/aspose_words_cloud/models/flat_opc_template_save_options_data.rb +504 -0
  19. data/lib/aspose_words_cloud/models/gif_save_options_data.rb +124 -14
  20. data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +121 -11
  21. data/lib/aspose_words_cloud/models/html_save_options_data.rb +147 -11
  22. data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +124 -14
  23. data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +57 -11
  24. data/lib/aspose_words_cloud/models/metafile_rendering_options_data.rb +57 -0
  25. data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +150 -14
  26. data/lib/aspose_words_cloud/models/odt_save_options_data.rb +60 -14
  27. data/lib/aspose_words_cloud/models/{image_save_options_data.rb → open_xps_save_options_data.rb} +119 -127
  28. data/lib/aspose_words_cloud/models/{save_options_data.rb → ott_save_options_data.rb} +120 -17
  29. data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +92 -14
  30. data/lib/aspose_words_cloud/models/pdf_digital_signature_details_data.rb +41 -0
  31. data/lib/aspose_words_cloud/models/pdf_encryption_details_data.rb +5 -13
  32. data/lib/aspose_words_cloud/models/pdf_permissions.rb +52 -0
  33. data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +201 -11
  34. data/lib/aspose_words_cloud/models/png_save_options_data.rb +124 -14
  35. data/lib/aspose_words_cloud/models/ps_save_options_data.rb +89 -11
  36. data/lib/aspose_words_cloud/models/requests/copy_styles_from_template_request.rb +201 -0
  37. data/lib/aspose_words_cloud/models/requests/delete_comment_online_request.rb +1 -1
  38. data/lib/aspose_words_cloud/models/requests/delete_comments_online_request.rb +1 -1
  39. data/lib/aspose_words_cloud/models/requests/delete_custom_xml_part_online_request.rb +1 -1
  40. data/lib/aspose_words_cloud/models/requests/delete_custom_xml_parts_online_request.rb +1 -1
  41. data/lib/aspose_words_cloud/models/requests/delete_document_property_online_request.rb +1 -1
  42. data/lib/aspose_words_cloud/models/requests/delete_drawing_object_online_request.rb +1 -1
  43. data/lib/aspose_words_cloud/models/requests/delete_field_online_request.rb +1 -1
  44. data/lib/aspose_words_cloud/models/requests/delete_fields_online_request.rb +1 -1
  45. data/lib/aspose_words_cloud/models/requests/delete_footnote_online_request.rb +1 -1
  46. data/lib/aspose_words_cloud/models/requests/delete_form_field_online_request.rb +1 -1
  47. data/lib/aspose_words_cloud/models/requests/delete_header_footer_online_request.rb +1 -1
  48. data/lib/aspose_words_cloud/models/requests/delete_headers_footers_online_request.rb +1 -1
  49. data/lib/aspose_words_cloud/models/requests/delete_macros_online_request.rb +1 -1
  50. data/lib/aspose_words_cloud/models/requests/delete_office_math_object_online_request.rb +1 -1
  51. data/lib/aspose_words_cloud/models/requests/delete_paragraph_online_request.rb +1 -1
  52. data/lib/aspose_words_cloud/models/requests/delete_run_online_request.rb +1 -1
  53. data/lib/aspose_words_cloud/models/requests/delete_section_online_request.rb +1 -1
  54. data/lib/aspose_words_cloud/models/requests/delete_table_cell_online_request.rb +1 -1
  55. data/lib/aspose_words_cloud/models/requests/delete_table_online_request.rb +1 -1
  56. data/lib/aspose_words_cloud/models/requests/delete_table_row_online_request.rb +1 -1
  57. data/lib/aspose_words_cloud/models/requests/optimize_document_online_request.rb +1 -1
  58. data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +57 -11
  59. data/lib/aspose_words_cloud/models/svg_save_options_data.rb +105 -11
  60. data/lib/aspose_words_cloud/models/text_save_options_data.rb +57 -11
  61. data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +153 -11
  62. data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +60 -14
  63. data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +92 -14
  64. data/lib/aspose_words_cloud/models/{txt_save_options_base_data.rb → xaml_flow_pack_save_options_data.rb} +67 -59
  65. data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +60 -14
  66. data/lib/aspose_words_cloud/models/xps_save_options_data.rb +89 -11
  67. data/lib/aspose_words_cloud/version.rb +1 -1
  68. data/lib/aspose_words_cloud.rb +14 -10
  69. metadata +16 -12
  70. data/lib/aspose_words_cloud/models/comment_base.rb +0 -251
  71. data/lib/aspose_words_cloud/models/document_property_base.rb +0 -201
  72. data/lib/aspose_words_cloud/models/field_base.rb +0 -211
  73. data/lib/aspose_words_cloud/models/footnote_base.rb +0 -273
  74. data/lib/aspose_words_cloud/models/run_base.rb +0 -201
@@ -0,0 +1,504 @@
1
+ # ------------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="docx_save_options_data.rb">
3
+ # Copyright (c) 2022 Aspose.Words for Cloud
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 'date'
27
+
28
+ module AsposeWordsCloud
29
+
30
+ # Container class for docx save options.
31
+ class DocxSaveOptionsData
32
+ # Gets or sets a boolean value indicating whether to allow embedding fonts with PostScript outlines when embedding TrueType fonts in a document upon it is saved. The default value is false..
33
+ attr_accessor :allow_embedding_post_script_fonts
34
+
35
+ # Gets or sets CustomTimeZoneInfo.
36
+ attr_accessor :custom_time_zone_info_data
37
+
38
+ # Gets or sets the value determining how 3D effects are rendered.
39
+ attr_accessor :dml3_d_effects_rendering_mode
40
+
41
+ # Gets or sets the value determining how DrawingML effects are rendered.
42
+ # { Simplified | None | Fine }.
43
+ attr_accessor :dml_effects_rendering_mode
44
+
45
+ # Gets or sets the option that controls how DrawingML shapes are rendered.
46
+ attr_accessor :dml_rendering_mode
47
+
48
+ # Gets or sets the name of destination file.
49
+ attr_accessor :file_name
50
+
51
+ # Gets or sets value determining which document formats are allowed to be mapped by Aspose.Words.Markup.StructuredDocumentTag.XmlMapping.
52
+ # By default only Aspose.Words.LoadFormat.FlatOpc document format is allowed to be mapped.
53
+ attr_accessor :flat_opc_xml_mapping_only
54
+
55
+ # Gets or sets the value determining how ink (InkML) objects are rendered.
56
+ attr_accessor :iml_rendering_mode
57
+
58
+ # Gets or sets a value determining whether the Aspose.Words.Properties.BuiltInDocumentProperties.CreatedTime property is updated before saving.
59
+ # Default value is false.
60
+ attr_accessor :update_created_time_property
61
+
62
+ # Gets or sets a value indicating whether fields should be updated before saving the document to a fixed page format. The default value is true.
63
+ attr_accessor :update_fields
64
+
65
+ # Gets or sets a value indicating whether the Aspose.Words.Properties.BuiltInDocumentProperties.LastPrinted property is updated before saving.
66
+ attr_accessor :update_last_printed_property
67
+
68
+ # Gets or sets a value indicating whether the Aspose.Words.Properties.BuiltInDocumentProperties.LastSavedTime property is updated before saving.
69
+ attr_accessor :update_last_saved_time_property
70
+
71
+ # Gets or sets a value indicating whether content of StructuredDocumentTag is updated before saving.
72
+ attr_accessor :update_sdt_content
73
+
74
+ # Gets or sets a value indicating whether to zip output or not.
75
+ # The default value is false.
76
+ attr_accessor :zip_output
77
+
78
+ # Gets or sets the oOXML version for the output document.
79
+ attr_accessor :compliance
80
+
81
+ # Gets or sets the compression level.
82
+ attr_accessor :compression_level
83
+
84
+ # Gets or sets the password to encrypt document using ECMA376 Standard encryption algorithm.
85
+ attr_accessor :password
86
+
87
+ # Gets or sets a value indicating whether to use pretty formats output.
88
+ attr_accessor :pretty_format
89
+
90
+ # Gets the format of save.
91
+ attr_accessor :save_format
92
+
93
+ class EnumAttributeValidator
94
+ attr_reader :datatype
95
+ attr_reader :allowable_values
96
+
97
+ def initialize(datatype, allowable_values)
98
+ @allowable_values = allowable_values.map do |value|
99
+ case datatype.to_s
100
+ when /Integer/i
101
+ value.to_i
102
+ when /Float/i
103
+ value.to_f
104
+ else
105
+ value
106
+ end
107
+ end
108
+ end
109
+
110
+ def valid?(value)
111
+ !value || allowable_values.include?(value)
112
+ end
113
+ end
114
+
115
+ # Attribute mapping from ruby-style variable name to JSON key.
116
+ def self.attribute_map
117
+ {
118
+ :'allow_embedding_post_script_fonts' => :'AllowEmbeddingPostScriptFonts',
119
+ :'custom_time_zone_info_data' => :'CustomTimeZoneInfoData',
120
+ :'dml3_d_effects_rendering_mode' => :'Dml3DEffectsRenderingMode',
121
+ :'dml_effects_rendering_mode' => :'DmlEffectsRenderingMode',
122
+ :'dml_rendering_mode' => :'DmlRenderingMode',
123
+ :'file_name' => :'FileName',
124
+ :'flat_opc_xml_mapping_only' => :'FlatOpcXmlMappingOnly',
125
+ :'iml_rendering_mode' => :'ImlRenderingMode',
126
+ :'update_created_time_property' => :'UpdateCreatedTimeProperty',
127
+ :'update_fields' => :'UpdateFields',
128
+ :'update_last_printed_property' => :'UpdateLastPrintedProperty',
129
+ :'update_last_saved_time_property' => :'UpdateLastSavedTimeProperty',
130
+ :'update_sdt_content' => :'UpdateSdtContent',
131
+ :'zip_output' => :'ZipOutput',
132
+ :'compliance' => :'Compliance',
133
+ :'compression_level' => :'CompressionLevel',
134
+ :'password' => :'Password',
135
+ :'pretty_format' => :'PrettyFormat',
136
+ :'save_format' => :'SaveFormat'
137
+ }
138
+ end
139
+
140
+ # Attribute type mapping.
141
+ def self.swagger_types
142
+ {
143
+ :'allow_embedding_post_script_fonts' => :'BOOLEAN',
144
+ :'custom_time_zone_info_data' => :'TimeZoneInfoData',
145
+ :'dml3_d_effects_rendering_mode' => :'String',
146
+ :'dml_effects_rendering_mode' => :'String',
147
+ :'dml_rendering_mode' => :'String',
148
+ :'file_name' => :'String',
149
+ :'flat_opc_xml_mapping_only' => :'BOOLEAN',
150
+ :'iml_rendering_mode' => :'String',
151
+ :'update_created_time_property' => :'BOOLEAN',
152
+ :'update_fields' => :'BOOLEAN',
153
+ :'update_last_printed_property' => :'BOOLEAN',
154
+ :'update_last_saved_time_property' => :'BOOLEAN',
155
+ :'update_sdt_content' => :'BOOLEAN',
156
+ :'zip_output' => :'BOOLEAN',
157
+ :'compliance' => :'String',
158
+ :'compression_level' => :'String',
159
+ :'password' => :'String',
160
+ :'pretty_format' => :'BOOLEAN',
161
+ :'save_format' => :'String'
162
+ }
163
+ end
164
+
165
+ # Initializes the object
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ def initialize(attributes = {})
168
+ return unless attributes.is_a?(Hash)
169
+
170
+ # convert string to symbol for hash key
171
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
172
+
173
+ self.save_format = 'docx'
174
+
175
+ if attributes.key?(:'AllowEmbeddingPostScriptFonts')
176
+ self.allow_embedding_post_script_fonts = attributes[:'AllowEmbeddingPostScriptFonts']
177
+ end
178
+
179
+ if attributes.key?(:'CustomTimeZoneInfoData')
180
+ self.custom_time_zone_info_data = attributes[:'CustomTimeZoneInfoData']
181
+ end
182
+
183
+ if attributes.key?(:'Dml3DEffectsRenderingMode')
184
+ self.dml3_d_effects_rendering_mode = attributes[:'Dml3DEffectsRenderingMode']
185
+ end
186
+
187
+ if attributes.key?(:'DmlEffectsRenderingMode')
188
+ self.dml_effects_rendering_mode = attributes[:'DmlEffectsRenderingMode']
189
+ end
190
+
191
+ if attributes.key?(:'DmlRenderingMode')
192
+ self.dml_rendering_mode = attributes[:'DmlRenderingMode']
193
+ end
194
+
195
+ if attributes.key?(:'FileName')
196
+ self.file_name = attributes[:'FileName']
197
+ end
198
+
199
+ if attributes.key?(:'FlatOpcXmlMappingOnly')
200
+ self.flat_opc_xml_mapping_only = attributes[:'FlatOpcXmlMappingOnly']
201
+ end
202
+
203
+ if attributes.key?(:'ImlRenderingMode')
204
+ self.iml_rendering_mode = attributes[:'ImlRenderingMode']
205
+ end
206
+
207
+ if attributes.key?(:'UpdateCreatedTimeProperty')
208
+ self.update_created_time_property = attributes[:'UpdateCreatedTimeProperty']
209
+ end
210
+
211
+ if attributes.key?(:'UpdateFields')
212
+ self.update_fields = attributes[:'UpdateFields']
213
+ end
214
+
215
+ if attributes.key?(:'UpdateLastPrintedProperty')
216
+ self.update_last_printed_property = attributes[:'UpdateLastPrintedProperty']
217
+ end
218
+
219
+ if attributes.key?(:'UpdateLastSavedTimeProperty')
220
+ self.update_last_saved_time_property = attributes[:'UpdateLastSavedTimeProperty']
221
+ end
222
+
223
+ if attributes.key?(:'UpdateSdtContent')
224
+ self.update_sdt_content = attributes[:'UpdateSdtContent']
225
+ end
226
+
227
+ if attributes.key?(:'ZipOutput')
228
+ self.zip_output = attributes[:'ZipOutput']
229
+ end
230
+
231
+ if attributes.key?(:'Compliance')
232
+ self.compliance = attributes[:'Compliance']
233
+ end
234
+
235
+ if attributes.key?(:'CompressionLevel')
236
+ self.compression_level = attributes[:'CompressionLevel']
237
+ end
238
+
239
+ if attributes.key?(:'Password')
240
+ self.password = attributes[:'Password']
241
+ end
242
+
243
+ if attributes.key?(:'PrettyFormat')
244
+ self.pretty_format = attributes[:'PrettyFormat']
245
+ end
246
+ end
247
+
248
+ # Show invalid properties with the reasons. Usually used together with valid?
249
+ # @return Array for valid properies with the reasons
250
+ def list_invalid_properties
251
+ invalid_properties = []
252
+ return invalid_properties
253
+ end
254
+
255
+ # Check to see if the all the properties in the model are valid
256
+ # @return true if the model is valid
257
+ def valid?
258
+ dml3_d_effects_rendering_mode_validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
259
+ return false unless dml3_d_effects_rendering_mode_validator.valid?(@dml3_d_effects_rendering_mode)
260
+ dml_effects_rendering_mode_validator = EnumAttributeValidator.new('String', ["Simplified", "None", "Fine"])
261
+ return false unless dml_effects_rendering_mode_validator.valid?(@dml_effects_rendering_mode)
262
+ dml_rendering_mode_validator = EnumAttributeValidator.new('String', ["Fallback", "DrawingML"])
263
+ return false unless dml_rendering_mode_validator.valid?(@dml_rendering_mode)
264
+ iml_rendering_mode_validator = EnumAttributeValidator.new('String', ["Fallback", "InkML"])
265
+ return false unless iml_rendering_mode_validator.valid?(@iml_rendering_mode)
266
+ compliance_validator = EnumAttributeValidator.new('String', ["Ecma376_2006", "Iso29500_2008_Transitional", "Iso29500_2008_Strict"])
267
+ return false unless compliance_validator.valid?(@compliance)
268
+ compression_level_validator = EnumAttributeValidator.new('String', ["Normal", "Maximum", "Fast", "SuperFast"])
269
+ return false unless compression_level_validator.valid?(@compression_level)
270
+
271
+ return true
272
+ end
273
+
274
+ # Custom attribute writer method checking allowed values (enum).
275
+ # @param [Object] dml3_d_effects_rendering_mode Object to be assigned
276
+ def dml3_d_effects_rendering_mode=(dml3_d_effects_rendering_mode)
277
+ validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
278
+ if dml3_d_effects_rendering_mode.to_i == 0
279
+ unless validator.valid?(dml3_d_effects_rendering_mode)
280
+ raise ArgumentError, "invalid value for 'dml3_d_effects_rendering_mode', must be one of #{validator.allowable_values}."
281
+ end
282
+ @dml3_d_effects_rendering_mode = dml3_d_effects_rendering_mode
283
+ else
284
+ @dml3_d_effects_rendering_mode = validator.allowable_values[dml3_d_effects_rendering_mode.to_i]
285
+ end
286
+ end
287
+
288
+ # Custom attribute writer method checking allowed values (enum).
289
+ # @param [Object] dml_effects_rendering_mode Object to be assigned
290
+ def dml_effects_rendering_mode=(dml_effects_rendering_mode)
291
+ validator = EnumAttributeValidator.new('String', ["Simplified", "None", "Fine"])
292
+ if dml_effects_rendering_mode.to_i == 0
293
+ unless validator.valid?(dml_effects_rendering_mode)
294
+ raise ArgumentError, "invalid value for 'dml_effects_rendering_mode', must be one of #{validator.allowable_values}."
295
+ end
296
+ @dml_effects_rendering_mode = dml_effects_rendering_mode
297
+ else
298
+ @dml_effects_rendering_mode = validator.allowable_values[dml_effects_rendering_mode.to_i]
299
+ end
300
+ end
301
+
302
+ # Custom attribute writer method checking allowed values (enum).
303
+ # @param [Object] dml_rendering_mode Object to be assigned
304
+ def dml_rendering_mode=(dml_rendering_mode)
305
+ validator = EnumAttributeValidator.new('String', ["Fallback", "DrawingML"])
306
+ if dml_rendering_mode.to_i == 0
307
+ unless validator.valid?(dml_rendering_mode)
308
+ raise ArgumentError, "invalid value for 'dml_rendering_mode', must be one of #{validator.allowable_values}."
309
+ end
310
+ @dml_rendering_mode = dml_rendering_mode
311
+ else
312
+ @dml_rendering_mode = validator.allowable_values[dml_rendering_mode.to_i]
313
+ end
314
+ end
315
+
316
+ # Custom attribute writer method checking allowed values (enum).
317
+ # @param [Object] iml_rendering_mode Object to be assigned
318
+ def iml_rendering_mode=(iml_rendering_mode)
319
+ validator = EnumAttributeValidator.new('String', ["Fallback", "InkML"])
320
+ if iml_rendering_mode.to_i == 0
321
+ unless validator.valid?(iml_rendering_mode)
322
+ raise ArgumentError, "invalid value for 'iml_rendering_mode', must be one of #{validator.allowable_values}."
323
+ end
324
+ @iml_rendering_mode = iml_rendering_mode
325
+ else
326
+ @iml_rendering_mode = validator.allowable_values[iml_rendering_mode.to_i]
327
+ end
328
+ end
329
+
330
+ # Custom attribute writer method checking allowed values (enum).
331
+ # @param [Object] compliance Object to be assigned
332
+ def compliance=(compliance)
333
+ validator = EnumAttributeValidator.new('String', ["Ecma376_2006", "Iso29500_2008_Transitional", "Iso29500_2008_Strict"])
334
+ if compliance.to_i == 0
335
+ unless validator.valid?(compliance)
336
+ raise ArgumentError, "invalid value for 'compliance', must be one of #{validator.allowable_values}."
337
+ end
338
+ @compliance = compliance
339
+ else
340
+ @compliance = validator.allowable_values[compliance.to_i]
341
+ end
342
+ end
343
+
344
+ # Custom attribute writer method checking allowed values (enum).
345
+ # @param [Object] compression_level Object to be assigned
346
+ def compression_level=(compression_level)
347
+ validator = EnumAttributeValidator.new('String', ["Normal", "Maximum", "Fast", "SuperFast"])
348
+ if compression_level.to_i == 0
349
+ unless validator.valid?(compression_level)
350
+ raise ArgumentError, "invalid value for 'compression_level', must be one of #{validator.allowable_values}."
351
+ end
352
+ @compression_level = compression_level
353
+ else
354
+ @compression_level = validator.allowable_values[compression_level.to_i]
355
+ end
356
+ end
357
+
358
+
359
+ # Checks equality by comparing each attribute.
360
+ # @param [Object] Object to be compared
361
+ def ==(other)
362
+ return true if self.equal?(other)
363
+ self.class == other.class &&
364
+ allow_embedding_post_script_fonts == other.allow_embedding_post_script_fonts &&
365
+ custom_time_zone_info_data == other.custom_time_zone_info_data &&
366
+ dml3_d_effects_rendering_mode == other.dml3_d_effects_rendering_mode &&
367
+ dml_effects_rendering_mode == other.dml_effects_rendering_mode &&
368
+ dml_rendering_mode == other.dml_rendering_mode &&
369
+ file_name == other.file_name &&
370
+ flat_opc_xml_mapping_only == other.flat_opc_xml_mapping_only &&
371
+ iml_rendering_mode == other.iml_rendering_mode &&
372
+ update_created_time_property == other.update_created_time_property &&
373
+ update_fields == other.update_fields &&
374
+ update_last_printed_property == other.update_last_printed_property &&
375
+ update_last_saved_time_property == other.update_last_saved_time_property &&
376
+ update_sdt_content == other.update_sdt_content &&
377
+ zip_output == other.zip_output &&
378
+ compliance == other.compliance &&
379
+ compression_level == other.compression_level &&
380
+ password == other.password &&
381
+ pretty_format == other.pretty_format &&
382
+ save_format == other.save_format
383
+ end
384
+
385
+ # @see the `==` method
386
+ # @param [Object] Object to be compared
387
+ def eql?(other)
388
+ self == other
389
+ end
390
+
391
+ # Calculates hash code according to all attributes.
392
+ # @return [Fixnum] Hash code
393
+ def hash
394
+ [allow_embedding_post_script_fonts, custom_time_zone_info_data, dml3_d_effects_rendering_mode, dml_effects_rendering_mode, dml_rendering_mode, file_name, flat_opc_xml_mapping_only, iml_rendering_mode, update_created_time_property, update_fields, update_last_printed_property, update_last_saved_time_property, update_sdt_content, zip_output, compliance, compression_level, password, pretty_format, save_format].hash
395
+ end
396
+
397
+ # Builds the object from hash
398
+ # @param [Hash] attributes Model attributes in the form of hash
399
+ # @return [Object] Returns the model itself
400
+ def build_from_hash(attributes)
401
+ return nil unless attributes.is_a?(Hash)
402
+ self.class.swagger_types.each_pair do |key, type|
403
+ if type =~ /\AArray<(.*)>/i
404
+ # check to ensure the input is an array given that the the attribute
405
+ # is documented as an array but the input is not
406
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
407
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
408
+ end
409
+ elsif !attributes[self.class.attribute_map[key]].nil?
410
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
411
+ end
412
+ # or else data not found in attributes(hash), not an issue as the data can be optional
413
+ end
414
+
415
+ self
416
+ end
417
+
418
+ # Deserializes the data based on type
419
+ # @param string type Data type
420
+ # @param string value Value to be deserialized
421
+ # @return [Object] Deserialized data
422
+ def _deserialize(type, value)
423
+ case type.to_sym
424
+ when :DateTime
425
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
426
+ when :Date
427
+ Time.at(/\d/.match(value)[0].to_f).to_date
428
+ when :String
429
+ value.to_s
430
+ when :Integer
431
+ value.to_i
432
+ when :Float
433
+ value.to_f
434
+ when :BOOLEAN
435
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
436
+ true
437
+ else
438
+ false
439
+ end
440
+ when :Object
441
+ # generic object (usually a Hash), return directly
442
+ value
443
+ when /\AArray<(?<inner_type>.+)>\z/
444
+ inner_type = Regexp.last_match[:inner_type]
445
+ value.map { |v| _deserialize(inner_type, v) }
446
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
447
+ k_type = Regexp.last_match[:k_type]
448
+ v_type = Regexp.last_match[:v_type]
449
+ {}.tap do |hash|
450
+ value.each do |k, v|
451
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
452
+ end
453
+ end
454
+ else
455
+ # model
456
+ temp_model = AsposeWordsCloud.const_get(type).new
457
+ temp_model.build_from_hash(value)
458
+ end
459
+ end
460
+
461
+ # Returns the string representation of the object
462
+ # @return [String] String presentation of the object
463
+ def to_s
464
+ to_hash.to_s
465
+ end
466
+
467
+ # to_body is an alias to to_hash (backward compatibility)
468
+ # @return [Hash] Returns the object in the form of hash
469
+ def to_body
470
+ to_hash
471
+ end
472
+
473
+ # Returns the object in the form of hash
474
+ # @return [Hash] Returns the object in the form of hash
475
+ def to_hash
476
+ hash = {}
477
+ self.class.attribute_map.each_pair do |attr, param|
478
+ value = self.send(attr)
479
+ next if value.nil?
480
+ hash[param] = _to_hash(value)
481
+ end
482
+ hash
483
+ end
484
+
485
+ # Outputs non-array value in the form of hash
486
+ # For object, use to_hash. Otherwise, just return the value
487
+ # @param [Object] value Any valid value
488
+ # @return [Hash] Returns the value in the form of hash
489
+ def _to_hash(value)
490
+ if value.is_a?(Array)
491
+ value.compact.map { |v| _to_hash(v) }
492
+ elsif value.is_a?(Hash)
493
+ {}.tap do |hash|
494
+ value.each { |k, v| hash[k] = _to_hash(v) }
495
+ end
496
+ elsif value.respond_to? :to_hash
497
+ value.to_hash
498
+ else
499
+ value
500
+ end
501
+ end
502
+
503
+ end
504
+ end