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,290 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="TabStop.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
+ # Paragraph format tab stop.
33
+ class TabStop
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
+ # Gets or sets a value indicating whether this tab stop clears any existing tab stops in this position.
44
+ attr_accessor :is_clear
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'alignment' => :'Alignment',
72
+ :'leader' => :'Leader',
73
+ :'position' => :'Position',
74
+ :'is_clear' => :'IsClear'
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.swagger_types
80
+ {
81
+ :'alignment' => :'String',
82
+ :'leader' => :'String',
83
+ :'position' => :'Float',
84
+ :'is_clear' => :'BOOLEAN'
85
+ }
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ return unless attributes.is_a?(Hash)
92
+
93
+ # convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
95
+
96
+ if attributes.key?(:'Alignment')
97
+ self.alignment = attributes[:'Alignment']
98
+ end
99
+
100
+ if attributes.key?(:'Leader')
101
+ self.leader = attributes[:'Leader']
102
+ end
103
+
104
+ if attributes.key?(:'Position')
105
+ self.position = attributes[:'Position']
106
+ end
107
+
108
+ if attributes.key?(:'IsClear')
109
+ self.is_clear = attributes[:'IsClear']
110
+ end
111
+
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properies with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = []
118
+ return invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right", "Decimal", "Bar", "List", "Clear"])
125
+ return false unless alignment_validator.valid?(@alignment)
126
+ leader_validator = EnumAttributeValidator.new('String', ["None", "Dots", "Dashes", "Line", "Heavy", "MiddleDot"])
127
+ return false unless leader_validator.valid?(@leader)
128
+ return true
129
+ end
130
+
131
+ # Custom attribute writer method checking allowed values (enum).
132
+ # @param [Object] alignment Object to be assigned
133
+ def alignment=(alignment)
134
+ validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right", "Decimal", "Bar", "List", "Clear"])
135
+ if alignment.to_i == 0
136
+ unless validator.valid?(alignment)
137
+ raise ArgumentError, "invalid value for 'alignment', must be one of #{validator.allowable_values}."
138
+ end
139
+ @alignment = alignment
140
+ else
141
+ @alignment = validator.allowable_values[alignment.to_i]
142
+ end
143
+ end
144
+
145
+ # Custom attribute writer method checking allowed values (enum).
146
+ # @param [Object] leader Object to be assigned
147
+ def leader=(leader)
148
+ validator = EnumAttributeValidator.new('String', ["None", "Dots", "Dashes", "Line", "Heavy", "MiddleDot"])
149
+ if leader.to_i == 0
150
+ unless validator.valid?(leader)
151
+ raise ArgumentError, "invalid value for 'leader', must be one of #{validator.allowable_values}."
152
+ end
153
+ @leader = leader
154
+ else
155
+ @leader = validator.allowable_values[leader.to_i]
156
+ end
157
+ end
158
+
159
+ # Checks equality by comparing each attribute.
160
+ # @param [Object] Object to be compared
161
+ def ==(other)
162
+ return true if self.equal?(other)
163
+ self.class == other.class &&
164
+ alignment == other.alignment &&
165
+ leader == other.leader &&
166
+ position == other.position &&
167
+ is_clear == other.is_clear
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(other)
173
+ self == other
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Fixnum] Hash code
178
+ def hash
179
+ [alignment, leader, position, is_clear].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ self.class.swagger_types.each_pair do |key, type|
188
+ if type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
192
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
+ end
194
+ elsif !attributes[self.class.attribute_map[key]].nil?
195
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
+ end
197
+ # or else data not found in attributes(hash), not an issue as the data can be optional
198
+ end
199
+
200
+ self
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def _deserialize(type, value)
208
+ case type.to_sym
209
+ when :DateTime
210
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
211
+ when :Date
212
+ Time.at(/\d/.match(value)[0].to_f).to_date
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :BOOLEAN
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else
240
+ # model
241
+ temp_model = AsposeWordsCloud.const_get(type).new
242
+ temp_model.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ next if value.nil?
265
+ hash[param] = _to_hash(value)
266
+ end
267
+ hash
268
+ end
269
+
270
+ # Outputs non-array value in the form of hash
271
+ # For object, use to_hash. Otherwise, just return the value
272
+ # @param [Object] value Any valid value
273
+ # @return [Hash] Returns the value in the form of hash
274
+ def _to_hash(value)
275
+ if value.is_a?(Array)
276
+ value.compact.map { |v| _to_hash(v) }
277
+ elsif value.is_a?(Hash)
278
+ {}.tap do |hash|
279
+ value.each { |k, v| hash[k] = _to_hash(v) }
280
+ end
281
+ elsif value.respond_to? :to_hash
282
+ value.to_hash
283
+ else
284
+ value
285
+ end
286
+ end
287
+
288
+ end
289
+
290
+ end
@@ -0,0 +1,280 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="TabStopBase.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
+ # Base class for paragraph format tab stop DTO.
33
+ class TabStopBase
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