aspose_words_cloud 22.1.0 → 22.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud/api_client.rb +1 -0
  3. data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +12 -14
  4. data/lib/aspose_words_cloud/models/doc_save_options_data.rb +9 -11
  5. data/lib/aspose_words_cloud/models/{ooxml_save_options_data.rb → docm_save_options_data.rb} +15 -17
  6. data/lib/aspose_words_cloud/models/docx_save_options_data.rb +440 -0
  7. data/lib/aspose_words_cloud/models/dot_save_options_data.rb +426 -0
  8. data/lib/aspose_words_cloud/models/dotm_save_options_data.rb +440 -0
  9. data/lib/aspose_words_cloud/models/dotx_save_options_data.rb +440 -0
  10. data/lib/aspose_words_cloud/models/emf_save_options_data.rb +12 -14
  11. data/lib/aspose_words_cloud/models/epub_save_options_data.rb +12 -14
  12. data/lib/aspose_words_cloud/models/flat_opc_macro_save_options_data.rb +440 -0
  13. data/lib/aspose_words_cloud/models/{txt_save_options_base_data.rb → flat_opc_save_options_data.rb} +50 -54
  14. data/lib/aspose_words_cloud/models/flat_opc_template_macro_save_options_data.rb +440 -0
  15. data/lib/aspose_words_cloud/models/flat_opc_template_save_options_data.rb +440 -0
  16. data/lib/aspose_words_cloud/models/gif_save_options_data.rb +12 -14
  17. data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +9 -11
  18. data/lib/aspose_words_cloud/models/html_save_options_data.rb +9 -11
  19. data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +12 -14
  20. data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +9 -11
  21. data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +12 -14
  22. data/lib/aspose_words_cloud/models/odt_save_options_data.rb +12 -14
  23. data/lib/aspose_words_cloud/models/{fixed_page_save_options_data.rb → open_xps_save_options_data.rb} +55 -17
  24. data/lib/aspose_words_cloud/models/ott_save_options_data.rb +441 -0
  25. data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +12 -14
  26. data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +9 -11
  27. data/lib/aspose_words_cloud/models/png_save_options_data.rb +12 -14
  28. data/lib/aspose_words_cloud/models/ps_save_options_data.rb +9 -11
  29. data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +9 -11
  30. data/lib/aspose_words_cloud/models/svg_save_options_data.rb +9 -11
  31. data/lib/aspose_words_cloud/models/text_save_options_data.rb +9 -11
  32. data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +9 -11
  33. data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +12 -14
  34. data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +12 -14
  35. data/lib/aspose_words_cloud/models/{save_options_data.rb → xaml_flow_pack_save_options_data.rb} +35 -17
  36. data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +12 -14
  37. data/lib/aspose_words_cloud/models/xps_save_options_data.rb +9 -11
  38. data/lib/aspose_words_cloud/version.rb +1 -1
  39. data/lib/aspose_words_cloud.rb +12 -10
  40. metadata +14 -12
  41. data/lib/aspose_words_cloud/models/comment_base.rb +0 -251
  42. data/lib/aspose_words_cloud/models/document_property_base.rb +0 -201
  43. data/lib/aspose_words_cloud/models/field_base.rb +0 -211
  44. data/lib/aspose_words_cloud/models/footnote_base.rb +0 -273
  45. data/lib/aspose_words_cloud/models/image_save_options_data.rb +0 -585
  46. data/lib/aspose_words_cloud/models/run_base.rb +0 -201
@@ -0,0 +1,426 @@
1
+ # ------------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="dot_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 dot save options.
31
+ class DotSaveOptionsData
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 a value indicating when False, that small metafiles are not compressed for performance reason.
79
+ # The default value is true, all metafiles are compressed regardless of its size.
80
+ attr_accessor :always_compress_metafiles
81
+
82
+ # Gets or sets the password.
83
+ attr_accessor :password
84
+
85
+ # Gets or sets a value indicating when False, that PictureBullet data is not saved to the output document.
86
+ # The default value is true.
87
+ attr_accessor :save_picture_bullet
88
+
89
+ # Gets or sets a value indicating whether to save RoutingSlip data to output document.
90
+ attr_accessor :save_routing_slip
91
+
92
+ # Gets the format of save.
93
+ attr_accessor :save_format
94
+
95
+ class EnumAttributeValidator
96
+ attr_reader :datatype
97
+ attr_reader :allowable_values
98
+
99
+ def initialize(datatype, allowable_values)
100
+ @allowable_values = allowable_values.map do |value|
101
+ case datatype.to_s
102
+ when /Integer/i
103
+ value.to_i
104
+ when /Float/i
105
+ value.to_f
106
+ else
107
+ value
108
+ end
109
+ end
110
+ end
111
+
112
+ def valid?(value)
113
+ !value || allowable_values.include?(value)
114
+ end
115
+ end
116
+
117
+ # Attribute mapping from ruby-style variable name to JSON key.
118
+ def self.attribute_map
119
+ {
120
+ :'allow_embedding_post_script_fonts' => :'AllowEmbeddingPostScriptFonts',
121
+ :'custom_time_zone_info_data' => :'CustomTimeZoneInfoData',
122
+ :'dml3_d_effects_rendering_mode' => :'Dml3DEffectsRenderingMode',
123
+ :'dml_effects_rendering_mode' => :'DmlEffectsRenderingMode',
124
+ :'dml_rendering_mode' => :'DmlRenderingMode',
125
+ :'file_name' => :'FileName',
126
+ :'flat_opc_xml_mapping_only' => :'FlatOpcXmlMappingOnly',
127
+ :'iml_rendering_mode' => :'ImlRenderingMode',
128
+ :'update_created_time_property' => :'UpdateCreatedTimeProperty',
129
+ :'update_fields' => :'UpdateFields',
130
+ :'update_last_printed_property' => :'UpdateLastPrintedProperty',
131
+ :'update_last_saved_time_property' => :'UpdateLastSavedTimeProperty',
132
+ :'update_sdt_content' => :'UpdateSdtContent',
133
+ :'zip_output' => :'ZipOutput',
134
+ :'always_compress_metafiles' => :'AlwaysCompressMetafiles',
135
+ :'password' => :'Password',
136
+ :'save_picture_bullet' => :'SavePictureBullet',
137
+ :'save_routing_slip' => :'SaveRoutingSlip',
138
+ :'save_format' => :'SaveFormat'
139
+ }
140
+ end
141
+
142
+ # Attribute type mapping.
143
+ def self.swagger_types
144
+ {
145
+ :'allow_embedding_post_script_fonts' => :'BOOLEAN',
146
+ :'custom_time_zone_info_data' => :'TimeZoneInfoData',
147
+ :'dml3_d_effects_rendering_mode' => :'String',
148
+ :'dml_effects_rendering_mode' => :'String',
149
+ :'dml_rendering_mode' => :'String',
150
+ :'file_name' => :'String',
151
+ :'flat_opc_xml_mapping_only' => :'BOOLEAN',
152
+ :'iml_rendering_mode' => :'String',
153
+ :'update_created_time_property' => :'BOOLEAN',
154
+ :'update_fields' => :'BOOLEAN',
155
+ :'update_last_printed_property' => :'BOOLEAN',
156
+ :'update_last_saved_time_property' => :'BOOLEAN',
157
+ :'update_sdt_content' => :'BOOLEAN',
158
+ :'zip_output' => :'BOOLEAN',
159
+ :'always_compress_metafiles' => :'BOOLEAN',
160
+ :'password' => :'String',
161
+ :'save_picture_bullet' => :'BOOLEAN',
162
+ :'save_routing_slip' => :'BOOLEAN',
163
+ :'save_format' => :'String'
164
+ }
165
+ end
166
+
167
+ # Initializes the object
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ def initialize(attributes = {})
170
+ return unless attributes.is_a?(Hash)
171
+
172
+ # convert string to symbol for hash key
173
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
174
+
175
+ self.save_format = 'dot'
176
+
177
+ if attributes.key?(:'AllowEmbeddingPostScriptFonts')
178
+ self.allow_embedding_post_script_fonts = attributes[:'AllowEmbeddingPostScriptFonts']
179
+ end
180
+
181
+ if attributes.key?(:'CustomTimeZoneInfoData')
182
+ self.custom_time_zone_info_data = attributes[:'CustomTimeZoneInfoData']
183
+ end
184
+
185
+ if attributes.key?(:'Dml3DEffectsRenderingMode')
186
+ self.dml3_d_effects_rendering_mode = attributes[:'Dml3DEffectsRenderingMode']
187
+ end
188
+
189
+ if attributes.key?(:'DmlEffectsRenderingMode')
190
+ self.dml_effects_rendering_mode = attributes[:'DmlEffectsRenderingMode']
191
+ end
192
+
193
+ if attributes.key?(:'DmlRenderingMode')
194
+ self.dml_rendering_mode = attributes[:'DmlRenderingMode']
195
+ end
196
+
197
+ if attributes.key?(:'FileName')
198
+ self.file_name = attributes[:'FileName']
199
+ end
200
+
201
+ if attributes.key?(:'FlatOpcXmlMappingOnly')
202
+ self.flat_opc_xml_mapping_only = attributes[:'FlatOpcXmlMappingOnly']
203
+ end
204
+
205
+ if attributes.key?(:'ImlRenderingMode')
206
+ self.iml_rendering_mode = attributes[:'ImlRenderingMode']
207
+ end
208
+
209
+ if attributes.key?(:'UpdateCreatedTimeProperty')
210
+ self.update_created_time_property = attributes[:'UpdateCreatedTimeProperty']
211
+ end
212
+
213
+ if attributes.key?(:'UpdateFields')
214
+ self.update_fields = attributes[:'UpdateFields']
215
+ end
216
+
217
+ if attributes.key?(:'UpdateLastPrintedProperty')
218
+ self.update_last_printed_property = attributes[:'UpdateLastPrintedProperty']
219
+ end
220
+
221
+ if attributes.key?(:'UpdateLastSavedTimeProperty')
222
+ self.update_last_saved_time_property = attributes[:'UpdateLastSavedTimeProperty']
223
+ end
224
+
225
+ if attributes.key?(:'UpdateSdtContent')
226
+ self.update_sdt_content = attributes[:'UpdateSdtContent']
227
+ end
228
+
229
+ if attributes.key?(:'ZipOutput')
230
+ self.zip_output = attributes[:'ZipOutput']
231
+ end
232
+
233
+ if attributes.key?(:'AlwaysCompressMetafiles')
234
+ self.always_compress_metafiles = attributes[:'AlwaysCompressMetafiles']
235
+ end
236
+
237
+ if attributes.key?(:'Password')
238
+ self.password = attributes[:'Password']
239
+ end
240
+
241
+ if attributes.key?(:'SavePictureBullet')
242
+ self.save_picture_bullet = attributes[:'SavePictureBullet']
243
+ end
244
+
245
+ if attributes.key?(:'SaveRoutingSlip')
246
+ self.save_routing_slip = attributes[:'SaveRoutingSlip']
247
+ end
248
+ end
249
+
250
+ # Show invalid properties with the reasons. Usually used together with valid?
251
+ # @return Array for valid properies with the reasons
252
+ def list_invalid_properties
253
+ invalid_properties = []
254
+ return invalid_properties
255
+ end
256
+
257
+ # Check to see if the all the properties in the model are valid
258
+ # @return true if the model is valid
259
+ def valid?
260
+ dml3_d_effects_rendering_mode_validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
261
+ return false unless dml3_d_effects_rendering_mode_validator.valid?(@dml3_d_effects_rendering_mode)
262
+
263
+ return true
264
+ end
265
+
266
+ # Custom attribute writer method checking allowed values (enum).
267
+ # @param [Object] dml3_d_effects_rendering_mode Object to be assigned
268
+ def dml3_d_effects_rendering_mode=(dml3_d_effects_rendering_mode)
269
+ validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
270
+ if dml3_d_effects_rendering_mode.to_i == 0
271
+ unless validator.valid?(dml3_d_effects_rendering_mode)
272
+ raise ArgumentError, "invalid value for 'dml3_d_effects_rendering_mode', must be one of #{validator.allowable_values}."
273
+ end
274
+ @dml3_d_effects_rendering_mode = dml3_d_effects_rendering_mode
275
+ else
276
+ @dml3_d_effects_rendering_mode = validator.allowable_values[dml3_d_effects_rendering_mode.to_i]
277
+ end
278
+ end
279
+
280
+
281
+ # Checks equality by comparing each attribute.
282
+ # @param [Object] Object to be compared
283
+ def ==(other)
284
+ return true if self.equal?(other)
285
+ self.class == other.class &&
286
+ allow_embedding_post_script_fonts == other.allow_embedding_post_script_fonts &&
287
+ custom_time_zone_info_data == other.custom_time_zone_info_data &&
288
+ dml3_d_effects_rendering_mode == other.dml3_d_effects_rendering_mode &&
289
+ dml_effects_rendering_mode == other.dml_effects_rendering_mode &&
290
+ dml_rendering_mode == other.dml_rendering_mode &&
291
+ file_name == other.file_name &&
292
+ flat_opc_xml_mapping_only == other.flat_opc_xml_mapping_only &&
293
+ iml_rendering_mode == other.iml_rendering_mode &&
294
+ update_created_time_property == other.update_created_time_property &&
295
+ update_fields == other.update_fields &&
296
+ update_last_printed_property == other.update_last_printed_property &&
297
+ update_last_saved_time_property == other.update_last_saved_time_property &&
298
+ update_sdt_content == other.update_sdt_content &&
299
+ zip_output == other.zip_output &&
300
+ always_compress_metafiles == other.always_compress_metafiles &&
301
+ password == other.password &&
302
+ save_picture_bullet == other.save_picture_bullet &&
303
+ save_routing_slip == other.save_routing_slip &&
304
+ save_format == other.save_format
305
+ end
306
+
307
+ # @see the `==` method
308
+ # @param [Object] Object to be compared
309
+ def eql?(other)
310
+ self == other
311
+ end
312
+
313
+ # Calculates hash code according to all attributes.
314
+ # @return [Fixnum] Hash code
315
+ def hash
316
+ [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, always_compress_metafiles, password, save_picture_bullet, save_routing_slip, save_format].hash
317
+ end
318
+
319
+ # Builds the object from hash
320
+ # @param [Hash] attributes Model attributes in the form of hash
321
+ # @return [Object] Returns the model itself
322
+ def build_from_hash(attributes)
323
+ return nil unless attributes.is_a?(Hash)
324
+ self.class.swagger_types.each_pair do |key, type|
325
+ if type =~ /\AArray<(.*)>/i
326
+ # check to ensure the input is an array given that the the attribute
327
+ # is documented as an array but the input is not
328
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
329
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
330
+ end
331
+ elsif !attributes[self.class.attribute_map[key]].nil?
332
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
333
+ end
334
+ # or else data not found in attributes(hash), not an issue as the data can be optional
335
+ end
336
+
337
+ self
338
+ end
339
+
340
+ # Deserializes the data based on type
341
+ # @param string type Data type
342
+ # @param string value Value to be deserialized
343
+ # @return [Object] Deserialized data
344
+ def _deserialize(type, value)
345
+ case type.to_sym
346
+ when :DateTime
347
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
348
+ when :Date
349
+ Time.at(/\d/.match(value)[0].to_f).to_date
350
+ when :String
351
+ value.to_s
352
+ when :Integer
353
+ value.to_i
354
+ when :Float
355
+ value.to_f
356
+ when :BOOLEAN
357
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
358
+ true
359
+ else
360
+ false
361
+ end
362
+ when :Object
363
+ # generic object (usually a Hash), return directly
364
+ value
365
+ when /\AArray<(?<inner_type>.+)>\z/
366
+ inner_type = Regexp.last_match[:inner_type]
367
+ value.map { |v| _deserialize(inner_type, v) }
368
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
369
+ k_type = Regexp.last_match[:k_type]
370
+ v_type = Regexp.last_match[:v_type]
371
+ {}.tap do |hash|
372
+ value.each do |k, v|
373
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
374
+ end
375
+ end
376
+ else
377
+ # model
378
+ temp_model = AsposeWordsCloud.const_get(type).new
379
+ temp_model.build_from_hash(value)
380
+ end
381
+ end
382
+
383
+ # Returns the string representation of the object
384
+ # @return [String] String presentation of the object
385
+ def to_s
386
+ to_hash.to_s
387
+ end
388
+
389
+ # to_body is an alias to to_hash (backward compatibility)
390
+ # @return [Hash] Returns the object in the form of hash
391
+ def to_body
392
+ to_hash
393
+ end
394
+
395
+ # Returns the object in the form of hash
396
+ # @return [Hash] Returns the object in the form of hash
397
+ def to_hash
398
+ hash = {}
399
+ self.class.attribute_map.each_pair do |attr, param|
400
+ value = self.send(attr)
401
+ next if value.nil?
402
+ hash[param] = _to_hash(value)
403
+ end
404
+ hash
405
+ end
406
+
407
+ # Outputs non-array value in the form of hash
408
+ # For object, use to_hash. Otherwise, just return the value
409
+ # @param [Object] value Any valid value
410
+ # @return [Hash] Returns the value in the form of hash
411
+ def _to_hash(value)
412
+ if value.is_a?(Array)
413
+ value.compact.map { |v| _to_hash(v) }
414
+ elsif value.is_a?(Hash)
415
+ {}.tap do |hash|
416
+ value.each { |k, v| hash[k] = _to_hash(v) }
417
+ end
418
+ elsif value.respond_to? :to_hash
419
+ value.to_hash
420
+ else
421
+ value
422
+ end
423
+ end
424
+
425
+ end
426
+ end