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.
- checksums.yaml +4 -4
- data/lib/aspose_words_cloud/api_client.rb +1 -0
- data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/doc_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/{ooxml_save_options_data.rb → docm_save_options_data.rb} +15 -17
- data/lib/aspose_words_cloud/models/docx_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/dot_save_options_data.rb +426 -0
- data/lib/aspose_words_cloud/models/dotm_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/dotx_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/emf_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/epub_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/flat_opc_macro_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/{txt_save_options_base_data.rb → flat_opc_save_options_data.rb} +50 -54
- data/lib/aspose_words_cloud/models/flat_opc_template_macro_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/flat_opc_template_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/gif_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/html_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/odt_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/{fixed_page_save_options_data.rb → open_xps_save_options_data.rb} +55 -17
- data/lib/aspose_words_cloud/models/ott_save_options_data.rb +441 -0
- data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/png_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/ps_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/svg_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/text_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/{save_options_data.rb → xaml_flow_pack_save_options_data.rb} +35 -17
- data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/xps_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/version.rb +1 -1
- data/lib/aspose_words_cloud.rb +12 -10
- metadata +14 -12
- data/lib/aspose_words_cloud/models/comment_base.rb +0 -251
- data/lib/aspose_words_cloud/models/document_property_base.rb +0 -201
- data/lib/aspose_words_cloud/models/field_base.rb +0 -211
- data/lib/aspose_words_cloud/models/footnote_base.rb +0 -273
- data/lib/aspose_words_cloud/models/image_save_options_data.rb +0 -585
- data/lib/aspose_words_cloud/models/run_base.rb +0 -201
@@ -0,0 +1,440 @@
|
|
1
|
+
# ------------------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="dotm_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 dotm save options.
|
31
|
+
class DotmSaveOptionsData
|
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 = 'dotm'
|
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
|
+
compression_level_validator = EnumAttributeValidator.new('String', ["Normal", "Maximum", "Fast", "SuperFast"])
|
261
|
+
return false unless compression_level_validator.valid?(@compression_level)
|
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
|
+
# Custom attribute writer method checking allowed values (enum).
|
281
|
+
# @param [Object] compression_level Object to be assigned
|
282
|
+
def compression_level=(compression_level)
|
283
|
+
validator = EnumAttributeValidator.new('String', ["Normal", "Maximum", "Fast", "SuperFast"])
|
284
|
+
if compression_level.to_i == 0
|
285
|
+
unless validator.valid?(compression_level)
|
286
|
+
raise ArgumentError, "invalid value for 'compression_level', must be one of #{validator.allowable_values}."
|
287
|
+
end
|
288
|
+
@compression_level = compression_level
|
289
|
+
else
|
290
|
+
@compression_level = validator.allowable_values[compression_level.to_i]
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
|
295
|
+
# Checks equality by comparing each attribute.
|
296
|
+
# @param [Object] Object to be compared
|
297
|
+
def ==(other)
|
298
|
+
return true if self.equal?(other)
|
299
|
+
self.class == other.class &&
|
300
|
+
allow_embedding_post_script_fonts == other.allow_embedding_post_script_fonts &&
|
301
|
+
custom_time_zone_info_data == other.custom_time_zone_info_data &&
|
302
|
+
dml3_d_effects_rendering_mode == other.dml3_d_effects_rendering_mode &&
|
303
|
+
dml_effects_rendering_mode == other.dml_effects_rendering_mode &&
|
304
|
+
dml_rendering_mode == other.dml_rendering_mode &&
|
305
|
+
file_name == other.file_name &&
|
306
|
+
flat_opc_xml_mapping_only == other.flat_opc_xml_mapping_only &&
|
307
|
+
iml_rendering_mode == other.iml_rendering_mode &&
|
308
|
+
update_created_time_property == other.update_created_time_property &&
|
309
|
+
update_fields == other.update_fields &&
|
310
|
+
update_last_printed_property == other.update_last_printed_property &&
|
311
|
+
update_last_saved_time_property == other.update_last_saved_time_property &&
|
312
|
+
update_sdt_content == other.update_sdt_content &&
|
313
|
+
zip_output == other.zip_output &&
|
314
|
+
compliance == other.compliance &&
|
315
|
+
compression_level == other.compression_level &&
|
316
|
+
password == other.password &&
|
317
|
+
pretty_format == other.pretty_format &&
|
318
|
+
save_format == other.save_format
|
319
|
+
end
|
320
|
+
|
321
|
+
# @see the `==` method
|
322
|
+
# @param [Object] Object to be compared
|
323
|
+
def eql?(other)
|
324
|
+
self == other
|
325
|
+
end
|
326
|
+
|
327
|
+
# Calculates hash code according to all attributes.
|
328
|
+
# @return [Fixnum] Hash code
|
329
|
+
def hash
|
330
|
+
[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
|
331
|
+
end
|
332
|
+
|
333
|
+
# Builds the object from hash
|
334
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
335
|
+
# @return [Object] Returns the model itself
|
336
|
+
def build_from_hash(attributes)
|
337
|
+
return nil unless attributes.is_a?(Hash)
|
338
|
+
self.class.swagger_types.each_pair do |key, type|
|
339
|
+
if type =~ /\AArray<(.*)>/i
|
340
|
+
# check to ensure the input is an array given that the the attribute
|
341
|
+
# is documented as an array but the input is not
|
342
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
343
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
344
|
+
end
|
345
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
346
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
347
|
+
end
|
348
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
349
|
+
end
|
350
|
+
|
351
|
+
self
|
352
|
+
end
|
353
|
+
|
354
|
+
# Deserializes the data based on type
|
355
|
+
# @param string type Data type
|
356
|
+
# @param string value Value to be deserialized
|
357
|
+
# @return [Object] Deserialized data
|
358
|
+
def _deserialize(type, value)
|
359
|
+
case type.to_sym
|
360
|
+
when :DateTime
|
361
|
+
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
362
|
+
when :Date
|
363
|
+
Time.at(/\d/.match(value)[0].to_f).to_date
|
364
|
+
when :String
|
365
|
+
value.to_s
|
366
|
+
when :Integer
|
367
|
+
value.to_i
|
368
|
+
when :Float
|
369
|
+
value.to_f
|
370
|
+
when :BOOLEAN
|
371
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
372
|
+
true
|
373
|
+
else
|
374
|
+
false
|
375
|
+
end
|
376
|
+
when :Object
|
377
|
+
# generic object (usually a Hash), return directly
|
378
|
+
value
|
379
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
380
|
+
inner_type = Regexp.last_match[:inner_type]
|
381
|
+
value.map { |v| _deserialize(inner_type, v) }
|
382
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
383
|
+
k_type = Regexp.last_match[:k_type]
|
384
|
+
v_type = Regexp.last_match[:v_type]
|
385
|
+
{}.tap do |hash|
|
386
|
+
value.each do |k, v|
|
387
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
388
|
+
end
|
389
|
+
end
|
390
|
+
else
|
391
|
+
# model
|
392
|
+
temp_model = AsposeWordsCloud.const_get(type).new
|
393
|
+
temp_model.build_from_hash(value)
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
# Returns the string representation of the object
|
398
|
+
# @return [String] String presentation of the object
|
399
|
+
def to_s
|
400
|
+
to_hash.to_s
|
401
|
+
end
|
402
|
+
|
403
|
+
# to_body is an alias to to_hash (backward compatibility)
|
404
|
+
# @return [Hash] Returns the object in the form of hash
|
405
|
+
def to_body
|
406
|
+
to_hash
|
407
|
+
end
|
408
|
+
|
409
|
+
# Returns the object in the form of hash
|
410
|
+
# @return [Hash] Returns the object in the form of hash
|
411
|
+
def to_hash
|
412
|
+
hash = {}
|
413
|
+
self.class.attribute_map.each_pair do |attr, param|
|
414
|
+
value = self.send(attr)
|
415
|
+
next if value.nil?
|
416
|
+
hash[param] = _to_hash(value)
|
417
|
+
end
|
418
|
+
hash
|
419
|
+
end
|
420
|
+
|
421
|
+
# Outputs non-array value in the form of hash
|
422
|
+
# For object, use to_hash. Otherwise, just return the value
|
423
|
+
# @param [Object] value Any valid value
|
424
|
+
# @return [Hash] Returns the value in the form of hash
|
425
|
+
def _to_hash(value)
|
426
|
+
if value.is_a?(Array)
|
427
|
+
value.compact.map { |v| _to_hash(v) }
|
428
|
+
elsif value.is_a?(Hash)
|
429
|
+
{}.tap do |hash|
|
430
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
431
|
+
end
|
432
|
+
elsif value.respond_to? :to_hash
|
433
|
+
value.to_hash
|
434
|
+
else
|
435
|
+
value
|
436
|
+
end
|
437
|
+
end
|
438
|
+
|
439
|
+
end
|
440
|
+
end
|