aspose_words_cloud 20.4.0 → 20.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud.rb +30 -0
  3. data/lib/aspose_words_cloud/api/words_api.rb +4292 -2201
  4. data/lib/aspose_words_cloud/api_client.rb +1 -0
  5. data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +61 -4
  6. data/lib/aspose_words_cloud/models/csv_data_load_options.rb +237 -0
  7. data/lib/aspose_words_cloud/models/doc_save_options_data.rb +58 -1
  8. data/lib/aspose_words_cloud/models/emf_save_options_data.rb +61 -4
  9. data/lib/aspose_words_cloud/models/epub_save_options_data.rb +37 -1
  10. data/lib/aspose_words_cloud/models/fixed_page_save_options_data.rb +58 -1
  11. data/lib/aspose_words_cloud/models/gif_save_options_data.rb +61 -4
  12. data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +71 -4
  13. data/lib/aspose_words_cloud/models/html_save_options_data.rb +37 -1
  14. data/lib/aspose_words_cloud/models/image_save_options_data.rb +58 -1
  15. data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +61 -4
  16. data/lib/aspose_words_cloud/models/list_format.rb +236 -0
  17. data/lib/aspose_words_cloud/models/list_format_update.rb +217 -0
  18. data/lib/aspose_words_cloud/models/list_info.rb +274 -0
  19. data/lib/aspose_words_cloud/models/list_insert.rb +244 -0
  20. data/lib/aspose_words_cloud/models/list_level.rb +393 -0
  21. data/lib/aspose_words_cloud/models/list_level_update.rb +366 -0
  22. data/lib/aspose_words_cloud/models/list_levels.rb +218 -0
  23. data/lib/aspose_words_cloud/models/list_response.rb +216 -0
  24. data/lib/aspose_words_cloud/models/list_update.rb +207 -0
  25. data/lib/aspose_words_cloud/models/lists.rb +218 -0
  26. data/lib/aspose_words_cloud/models/lists_response.rb +216 -0
  27. data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +37 -1
  28. data/lib/aspose_words_cloud/models/odt_save_options_data.rb +47 -1
  29. data/lib/aspose_words_cloud/models/ooxml_save_options_data.rb +58 -1
  30. data/lib/aspose_words_cloud/models/paragraph_format.rb +10 -1
  31. data/lib/aspose_words_cloud/models/paragraph_list_format_response.rb +216 -0
  32. data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +58 -1
  33. data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +47 -1
  34. data/lib/aspose_words_cloud/models/png_save_options_data.rb +61 -4
  35. data/lib/aspose_words_cloud/models/ps_save_options_data.rb +58 -1
  36. data/lib/aspose_words_cloud/models/report_build_options.rb +26 -0
  37. data/lib/aspose_words_cloud/models/report_engine_settings.rb +275 -0
  38. data/lib/aspose_words_cloud/models/requests/ApplyStyleToDocumentElementRequest.rb +81 -0
  39. data/lib/aspose_words_cloud/models/requests/BuildReportOnlineRequest.rb +57 -0
  40. data/lib/aspose_words_cloud/models/requests/BuildReportRequest.rb +73 -0
  41. data/lib/aspose_words_cloud/models/requests/CopyStyleRequest.rb +77 -0
  42. data/lib/aspose_words_cloud/models/requests/DeleteAllParagraphTabStopsRequest.rb +73 -0
  43. data/lib/aspose_words_cloud/models/requests/DeleteParagraphListFormatRequest.rb +81 -0
  44. data/lib/aspose_words_cloud/models/requests/DeleteParagraphTabStopRequest.rb +77 -0
  45. data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeOnlineRequest.rb +2 -2
  46. data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeRequest.rb +2 -2
  47. data/lib/aspose_words_cloud/models/requests/GetDocumentFieldNamesRequest.rb +2 -2
  48. data/lib/aspose_words_cloud/models/requests/GetListRequest.rb +65 -0
  49. data/lib/aspose_words_cloud/models/requests/GetListsRequest.rb +61 -0
  50. data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatRequest.rb +69 -0
  51. data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatWithoutNodePathRequest.rb +65 -0
  52. data/lib/aspose_words_cloud/models/requests/GetParagraphTabStopsRequest.rb +69 -0
  53. data/lib/aspose_words_cloud/models/requests/GetStyleFromDocumentElementRequest.rb +65 -0
  54. data/lib/aspose_words_cloud/models/requests/GetStyleRequest.rb +65 -0
  55. data/lib/aspose_words_cloud/models/requests/GetStylesRequest.rb +61 -0
  56. data/lib/aspose_words_cloud/models/requests/InsertListRequest.rb +77 -0
  57. data/lib/aspose_words_cloud/models/requests/InsertOrUpdateParagraphTabStopRequest.rb +77 -0
  58. data/lib/aspose_words_cloud/models/requests/InsertStyleRequest.rb +77 -0
  59. data/lib/aspose_words_cloud/models/requests/UpdateListLevelRequest.rb +85 -0
  60. data/lib/aspose_words_cloud/models/requests/UpdateListRequest.rb +81 -0
  61. data/lib/aspose_words_cloud/models/requests/UpdateParagraphListFormatRequest.rb +85 -0
  62. data/lib/aspose_words_cloud/models/requests/UpdateStyleRequest.rb +81 -0
  63. data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +58 -1
  64. data/lib/aspose_words_cloud/models/save_options_data.rb +61 -4
  65. data/lib/aspose_words_cloud/models/shading.rb +262 -0
  66. data/lib/aspose_words_cloud/models/style.rb +370 -0
  67. data/lib/aspose_words_cloud/models/style_apply.rb +207 -0
  68. data/lib/aspose_words_cloud/models/style_copy.rb +207 -0
  69. data/lib/aspose_words_cloud/models/style_insert.rb +254 -0
  70. data/lib/aspose_words_cloud/models/style_response.rb +216 -0
  71. data/lib/aspose_words_cloud/models/style_update.rb +237 -0
  72. data/lib/aspose_words_cloud/models/styles.rb +218 -0
  73. data/lib/aspose_words_cloud/models/styles_response.rb +216 -0
  74. data/lib/aspose_words_cloud/models/svg_save_options_data.rb +58 -1
  75. data/lib/aspose_words_cloud/models/tab_stop.rb +290 -0
  76. data/lib/aspose_words_cloud/models/tab_stop_base.rb +280 -0
  77. data/lib/aspose_words_cloud/models/tab_stop_insert.rb +280 -0
  78. data/lib/aspose_words_cloud/models/tab_stops_response.rb +219 -0
  79. data/lib/aspose_words_cloud/models/text_save_options_data.rb +37 -1
  80. data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +58 -1
  81. data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +58 -1
  82. data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +58 -1
  83. data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +58 -1
  84. data/lib/aspose_words_cloud/models/xps_save_options_data.rb +58 -1
  85. data/lib/aspose_words_cloud/version.rb +1 -1
  86. metadata +52 -2
@@ -0,0 +1,280 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="TabStopInsert.rb">
8
+ # Copyright (c) 2019 Aspose.Words for Cloud
9
+ # </copyright>
10
+ # <summary>
11
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ # of this software and associated documentation files (the "Software"), to deal
13
+ # in the Software without restriction, including without limitation the rights
14
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the Software is
16
+ # furnished to do so, subject to the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included in all
19
+ # copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ # SOFTWARE.
28
+ # </summary>
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ #
31
+
32
+ # A DTO to Insert / replace a tab stop.
33
+ class TabStopInsert
34
+ # Gets or sets the alignment of text at this tab stop.
35
+ attr_accessor :alignment
36
+
37
+ # Gets or sets the type of the leader line displayed under the tab character.
38
+ attr_accessor :leader
39
+
40
+ # Gets or sets the position of the tab stop in points.
41
+ attr_accessor :position
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'alignment' => :'Alignment',
69
+ :'leader' => :'Leader',
70
+ :'position' => :'Position'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ :'alignment' => :'String',
78
+ :'leader' => :'String',
79
+ :'position' => :'Float'
80
+ }
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ return unless attributes.is_a?(Hash)
87
+
88
+ # convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
90
+
91
+ if attributes.key?(:'Alignment')
92
+ self.alignment = attributes[:'Alignment']
93
+ end
94
+
95
+ if attributes.key?(:'Leader')
96
+ self.leader = attributes[:'Leader']
97
+ end
98
+
99
+ if attributes.key?(:'Position')
100
+ self.position = attributes[:'Position']
101
+ end
102
+
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properies with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = []
109
+ return invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right", "Decimal", "Bar", "List", "Clear"])
116
+ return false unless alignment_validator.valid?(@alignment)
117
+ leader_validator = EnumAttributeValidator.new('String', ["None", "Dots", "Dashes", "Line", "Heavy", "MiddleDot"])
118
+ return false unless leader_validator.valid?(@leader)
119
+ return true
120
+ end
121
+
122
+ # Custom attribute writer method checking allowed values (enum).
123
+ # @param [Object] alignment Object to be assigned
124
+ def alignment=(alignment)
125
+ validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right", "Decimal", "Bar", "List", "Clear"])
126
+ if alignment.to_i == 0
127
+ unless validator.valid?(alignment)
128
+ raise ArgumentError, "invalid value for 'alignment', must be one of #{validator.allowable_values}."
129
+ end
130
+ @alignment = alignment
131
+ else
132
+ @alignment = validator.allowable_values[alignment.to_i]
133
+ end
134
+ end
135
+
136
+ # Custom attribute writer method checking allowed values (enum).
137
+ # @param [Object] leader Object to be assigned
138
+ def leader=(leader)
139
+ validator = EnumAttributeValidator.new('String', ["None", "Dots", "Dashes", "Line", "Heavy", "MiddleDot"])
140
+ if leader.to_i == 0
141
+ unless validator.valid?(leader)
142
+ raise ArgumentError, "invalid value for 'leader', must be one of #{validator.allowable_values}."
143
+ end
144
+ @leader = leader
145
+ else
146
+ @leader = validator.allowable_values[leader.to_i]
147
+ end
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(other)
153
+ return true if self.equal?(other)
154
+ self.class == other.class &&
155
+ alignment == other.alignment &&
156
+ leader == other.leader &&
157
+ position == other.position
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(other)
163
+ self == other
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Fixnum] Hash code
168
+ def hash
169
+ [alignment, leader, position].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.swagger_types.each_pair do |key, type|
178
+ if type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end
187
+ # or else data not found in attributes(hash), not an issue as the data can be optional
188
+ end
189
+
190
+ self
191
+ end
192
+
193
+ # Deserializes the data based on type
194
+ # @param string type Data type
195
+ # @param string value Value to be deserialized
196
+ # @return [Object] Deserialized data
197
+ def _deserialize(type, value)
198
+ case type.to_sym
199
+ when :DateTime
200
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
201
+ when :Date
202
+ Time.at(/\d/.match(value)[0].to_f).to_date
203
+ when :String
204
+ value.to_s
205
+ when :Integer
206
+ value.to_i
207
+ when :Float
208
+ value.to_f
209
+ when :BOOLEAN
210
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
211
+ true
212
+ else
213
+ false
214
+ end
215
+ when :Object
216
+ # generic object (usually a Hash), return directly
217
+ value
218
+ when /\AArray<(?<inner_type>.+)>\z/
219
+ inner_type = Regexp.last_match[:inner_type]
220
+ value.map { |v| _deserialize(inner_type, v) }
221
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
222
+ k_type = Regexp.last_match[:k_type]
223
+ v_type = Regexp.last_match[:v_type]
224
+ {}.tap do |hash|
225
+ value.each do |k, v|
226
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
227
+ end
228
+ end
229
+ else
230
+ # model
231
+ temp_model = AsposeWordsCloud.const_get(type).new
232
+ temp_model.build_from_hash(value)
233
+ end
234
+ end
235
+
236
+ # Returns the string representation of the object
237
+ # @return [String] String presentation of the object
238
+ def to_s
239
+ to_hash.to_s
240
+ end
241
+
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_body
245
+ to_hash
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ next if value.nil?
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end
@@ -0,0 +1,219 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="TabStopsResponse.rb">
8
+ # Copyright (c) 2019 Aspose.Words for Cloud
9
+ # </copyright>
10
+ # <summary>
11
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ # of this software and associated documentation files (the "Software"), to deal
13
+ # in the Software without restriction, including without limitation the rights
14
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the Software is
16
+ # furnished to do so, subject to the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included in all
19
+ # copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ # SOFTWARE.
28
+ # </summary>
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ #
31
+
32
+ # This response should be returned by the service when handling: GET https://api.aspose.cloud/v4.0/words/Test.doc/paragraphs/{0}/tabstops.
33
+ class TabStopsResponse
34
+ # Gets or sets request Id.
35
+ attr_accessor :request_id
36
+
37
+ # Gets or sets represents a tab stop.
38
+ attr_accessor :tab_stops
39
+
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'request_id' => :'RequestId',
45
+ :'tab_stops' => :'TabStops'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+ :'request_id' => :'String',
53
+ :'tab_stops' => :'Array<TabStop>'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ if attributes.key?(:'RequestId')
66
+ self.request_id = attributes[:'RequestId']
67
+ end
68
+
69
+ if attributes.key?(:'TabStops')
70
+ if (value = attributes[:'TabStops']).is_a?(Array)
71
+ self.tab_stops = value
72
+ end
73
+ end
74
+
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properies with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = []
81
+ return invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(other)
93
+ return true if self.equal?(other)
94
+ self.class == other.class &&
95
+ request_id == other.request_id &&
96
+ tab_stops == other.tab_stops
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(other)
102
+ self == other
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [request_id, tab_stops].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end
126
+ # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
140
+ when :Date
141
+ Time.at(/\d/.match(value)[0].to_f).to_date
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :BOOLEAN
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else
169
+ # model
170
+ temp_model = AsposeWordsCloud.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end