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,244 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="ListInsert.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
+ # Insert document to document list.
33
+ class ListInsert
34
+ # Gets or sets a value indicating whether specifies whether list should be restarted at each section. Default value is false.
35
+ attr_accessor :template
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'template' => :'Template'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'template' => :'String'
70
+ }
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ return unless attributes.is_a?(Hash)
77
+
78
+ # convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
80
+
81
+ if attributes.key?(:'Template')
82
+ self.template = attributes[:'Template']
83
+ end
84
+
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properies with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = []
91
+ return invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ template_validator = EnumAttributeValidator.new('String', ["BulletDefault", "BulletDisk", "BulletCircle", "BulletSquare", "BulletDiamonds", "BulletArrowHead", "BulletTick", "NumberDefault", "NumberArabicDot", "NumberArabicParenthesis", "NumberUppercaseRomanDot", "NumberUppercaseLetterDot", "NumberLowercaseLetterParenthesis", "NumberLowercaseLetterDot", "NumberLowercaseRomanDot", "OutlineNumbers", "OutlineLegal", "OutlineBullets", "OutlineHeadingsArticleSection", "OutlineHeadingsLegal", "OutlineHeadingsNumbers", "OutlineHeadingsChapter"])
98
+ return false unless template_validator.valid?(@template)
99
+ return true
100
+ end
101
+
102
+ # Custom attribute writer method checking allowed values (enum).
103
+ # @param [Object] template Object to be assigned
104
+ def template=(template)
105
+ validator = EnumAttributeValidator.new('String', ["BulletDefault", "BulletDisk", "BulletCircle", "BulletSquare", "BulletDiamonds", "BulletArrowHead", "BulletTick", "NumberDefault", "NumberArabicDot", "NumberArabicParenthesis", "NumberUppercaseRomanDot", "NumberUppercaseLetterDot", "NumberLowercaseLetterParenthesis", "NumberLowercaseLetterDot", "NumberLowercaseRomanDot", "OutlineNumbers", "OutlineLegal", "OutlineBullets", "OutlineHeadingsArticleSection", "OutlineHeadingsLegal", "OutlineHeadingsNumbers", "OutlineHeadingsChapter"])
106
+ if template.to_i == 0
107
+ unless validator.valid?(template)
108
+ raise ArgumentError, "invalid value for 'template', must be one of #{validator.allowable_values}."
109
+ end
110
+ @template = template
111
+ else
112
+ @template = validator.allowable_values[template.to_i]
113
+ end
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(other)
119
+ return true if self.equal?(other)
120
+ self.class == other.class &&
121
+ template == other.template
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(other)
127
+ self == other
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Fixnum] Hash code
132
+ def hash
133
+ [template].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.swagger_types.each_pair do |key, type|
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end
151
+ # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
165
+ when :Date
166
+ Time.at(/\d/.match(value)[0].to_f).to_date
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :BOOLEAN
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else
194
+ # model
195
+ temp_model = AsposeWordsCloud.const_get(type).new
196
+ temp_model.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ next if value.nil?
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -0,0 +1,393 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="ListLevel.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
+ # Represents a document list levels.
33
+ class ListLevel
34
+ attr_accessor :link
35
+
36
+ # Gets or sets the justification of the actual number of the list item.
37
+ attr_accessor :alignment
38
+
39
+ attr_accessor :font
40
+
41
+ # Gets or sets a value indicating whether true if the level turns all inherited numbers to Arabic, false if it preserves their number style.
42
+ attr_accessor :is_legal
43
+
44
+ attr_accessor :linked_style
45
+
46
+ # Gets or sets returns or sets the number format for the list level.
47
+ attr_accessor :number_format
48
+
49
+ # Gets or sets returns or sets the position (in points) of the number or bullet for the list level.
50
+ attr_accessor :number_position
51
+
52
+ # Gets or sets returns or sets the number style for this list level.
53
+ attr_accessor :number_style
54
+
55
+ # Gets or sets or returns the list level that must appear before the specified list level restarts numbering.
56
+ attr_accessor :restart_after_level
57
+
58
+ # Gets or sets returns or sets the starting number for this list level.
59
+ attr_accessor :start_at
60
+
61
+ # Gets or sets returns or sets the tab position (in points) for the list level.
62
+ attr_accessor :tab_position
63
+
64
+ # Gets or sets returns or sets the position (in points) for the second line of wrapping text for the list level.
65
+ attr_accessor :text_position
66
+
67
+ # Gets or sets returns or sets the character inserted after the number for the list level.
68
+ attr_accessor :trailing_character
69
+
70
+ class EnumAttributeValidator
71
+ attr_reader :datatype
72
+ attr_reader :allowable_values
73
+
74
+ def initialize(datatype, allowable_values)
75
+ @allowable_values = allowable_values.map do |value|
76
+ case datatype.to_s
77
+ when /Integer/i
78
+ value.to_i
79
+ when /Float/i
80
+ value.to_f
81
+ else
82
+ value
83
+ end
84
+ end
85
+ end
86
+
87
+ def valid?(value)
88
+ !value || allowable_values.include?(value)
89
+ end
90
+ end
91
+
92
+ # Attribute mapping from ruby-style variable name to JSON key.
93
+ def self.attribute_map
94
+ {
95
+ :'link' => :'link',
96
+ :'alignment' => :'Alignment',
97
+ :'font' => :'Font',
98
+ :'is_legal' => :'IsLegal',
99
+ :'linked_style' => :'LinkedStyle',
100
+ :'number_format' => :'NumberFormat',
101
+ :'number_position' => :'NumberPosition',
102
+ :'number_style' => :'NumberStyle',
103
+ :'restart_after_level' => :'RestartAfterLevel',
104
+ :'start_at' => :'StartAt',
105
+ :'tab_position' => :'TabPosition',
106
+ :'text_position' => :'TextPosition',
107
+ :'trailing_character' => :'TrailingCharacter'
108
+ }
109
+ end
110
+
111
+ # Attribute type mapping.
112
+ def self.swagger_types
113
+ {
114
+ :'link' => :'WordsApiLink',
115
+ :'alignment' => :'String',
116
+ :'font' => :'Font',
117
+ :'is_legal' => :'BOOLEAN',
118
+ :'linked_style' => :'Style',
119
+ :'number_format' => :'String',
120
+ :'number_position' => :'Float',
121
+ :'number_style' => :'String',
122
+ :'restart_after_level' => :'Integer',
123
+ :'start_at' => :'Integer',
124
+ :'tab_position' => :'Float',
125
+ :'text_position' => :'Float',
126
+ :'trailing_character' => :'String'
127
+ }
128
+ end
129
+
130
+ # Initializes the object
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ def initialize(attributes = {})
133
+ return unless attributes.is_a?(Hash)
134
+
135
+ # convert string to symbol for hash key
136
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
137
+
138
+ if attributes.key?(:'link')
139
+ self.link = attributes[:'link']
140
+ end
141
+
142
+ if attributes.key?(:'Alignment')
143
+ self.alignment = attributes[:'Alignment']
144
+ end
145
+
146
+ if attributes.key?(:'Font')
147
+ self.font = attributes[:'Font']
148
+ end
149
+
150
+ if attributes.key?(:'IsLegal')
151
+ self.is_legal = attributes[:'IsLegal']
152
+ end
153
+
154
+ if attributes.key?(:'LinkedStyle')
155
+ self.linked_style = attributes[:'LinkedStyle']
156
+ end
157
+
158
+ if attributes.key?(:'NumberFormat')
159
+ self.number_format = attributes[:'NumberFormat']
160
+ end
161
+
162
+ if attributes.key?(:'NumberPosition')
163
+ self.number_position = attributes[:'NumberPosition']
164
+ end
165
+
166
+ if attributes.key?(:'NumberStyle')
167
+ self.number_style = attributes[:'NumberStyle']
168
+ end
169
+
170
+ if attributes.key?(:'RestartAfterLevel')
171
+ self.restart_after_level = attributes[:'RestartAfterLevel']
172
+ end
173
+
174
+ if attributes.key?(:'StartAt')
175
+ self.start_at = attributes[:'StartAt']
176
+ end
177
+
178
+ if attributes.key?(:'TabPosition')
179
+ self.tab_position = attributes[:'TabPosition']
180
+ end
181
+
182
+ if attributes.key?(:'TextPosition')
183
+ self.text_position = attributes[:'TextPosition']
184
+ end
185
+
186
+ if attributes.key?(:'TrailingCharacter')
187
+ self.trailing_character = attributes[:'TrailingCharacter']
188
+ end
189
+
190
+ end
191
+
192
+ # Show invalid properties with the reasons. Usually used together with valid?
193
+ # @return Array for valid properies with the reasons
194
+ def list_invalid_properties
195
+ invalid_properties = []
196
+ return invalid_properties
197
+ end
198
+
199
+ # Check to see if the all the properties in the model are valid
200
+ # @return true if the model is valid
201
+ def valid?
202
+ alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
203
+ return false unless alignment_validator.valid?(@alignment)
204
+ number_style_validator = EnumAttributeValidator.new('String', ["Arabic", "UppercaseRoman", "LowercaseRoman", "UppercaseLetter", "LowercaseLetter", "Ordinal", "Number", "OrdinalText", "Hex", "ChicagoManual", "Kanji", "KanjiDigit", "AiueoHalfWidth", "IrohaHalfWidth", "ArabicFullWidth", "ArabicHalfWidth", "KanjiTraditional", "KanjiTraditional2", "NumberInCircle", "DecimalFullWidth", "Aiueo", "Iroha", "LeadingZero", "Bullet", "Ganada", "Chosung", "GB1", "GB2", "GB3", "GB4", "Zodiac1", "Zodiac2", "Zodiac3", "TradChinNum1", "TradChinNum2", "TradChinNum3", "TradChinNum4", "SimpChinNum1", "SimpChinNum2", "SimpChinNum3", "SimpChinNum4", "HanjaRead", "HanjaReadDigit", "Hangul", "Hanja", "Hebrew1", "Arabic1", "Hebrew2", "Arabic2", "HindiLetter1", "HindiLetter2", "HindiArabic", "HindiCardinalText", "ThaiLetter", "ThaiArabic", "ThaiCardinalText", "VietCardinalText", "NumberInDash", "LowercaseRussian", "UppercaseRussian", "None", "Custom"])
205
+ return false unless number_style_validator.valid?(@number_style)
206
+ trailing_character_validator = EnumAttributeValidator.new('String', ["Tab", "Space", "Nothing"])
207
+ return false unless trailing_character_validator.valid?(@trailing_character)
208
+ return true
209
+ end
210
+
211
+ # Custom attribute writer method checking allowed values (enum).
212
+ # @param [Object] alignment Object to be assigned
213
+ def alignment=(alignment)
214
+ validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
215
+ if alignment.to_i == 0
216
+ unless validator.valid?(alignment)
217
+ raise ArgumentError, "invalid value for 'alignment', must be one of #{validator.allowable_values}."
218
+ end
219
+ @alignment = alignment
220
+ else
221
+ @alignment = validator.allowable_values[alignment.to_i]
222
+ end
223
+ end
224
+
225
+ # Custom attribute writer method checking allowed values (enum).
226
+ # @param [Object] number_style Object to be assigned
227
+ def number_style=(number_style)
228
+ validator = EnumAttributeValidator.new('String', ["Arabic", "UppercaseRoman", "LowercaseRoman", "UppercaseLetter", "LowercaseLetter", "Ordinal", "Number", "OrdinalText", "Hex", "ChicagoManual", "Kanji", "KanjiDigit", "AiueoHalfWidth", "IrohaHalfWidth", "ArabicFullWidth", "ArabicHalfWidth", "KanjiTraditional", "KanjiTraditional2", "NumberInCircle", "DecimalFullWidth", "Aiueo", "Iroha", "LeadingZero", "Bullet", "Ganada", "Chosung", "GB1", "GB2", "GB3", "GB4", "Zodiac1", "Zodiac2", "Zodiac3", "TradChinNum1", "TradChinNum2", "TradChinNum3", "TradChinNum4", "SimpChinNum1", "SimpChinNum2", "SimpChinNum3", "SimpChinNum4", "HanjaRead", "HanjaReadDigit", "Hangul", "Hanja", "Hebrew1", "Arabic1", "Hebrew2", "Arabic2", "HindiLetter1", "HindiLetter2", "HindiArabic", "HindiCardinalText", "ThaiLetter", "ThaiArabic", "ThaiCardinalText", "VietCardinalText", "NumberInDash", "LowercaseRussian", "UppercaseRussian", "None", "Custom"])
229
+ if number_style.to_i == 0
230
+ unless validator.valid?(number_style)
231
+ raise ArgumentError, "invalid value for 'number_style', must be one of #{validator.allowable_values}."
232
+ end
233
+ @number_style = number_style
234
+ else
235
+ @number_style = validator.allowable_values[number_style.to_i]
236
+ end
237
+ end
238
+
239
+ # Custom attribute writer method checking allowed values (enum).
240
+ # @param [Object] trailing_character Object to be assigned
241
+ def trailing_character=(trailing_character)
242
+ validator = EnumAttributeValidator.new('String', ["Tab", "Space", "Nothing"])
243
+ if trailing_character.to_i == 0
244
+ unless validator.valid?(trailing_character)
245
+ raise ArgumentError, "invalid value for 'trailing_character', must be one of #{validator.allowable_values}."
246
+ end
247
+ @trailing_character = trailing_character
248
+ else
249
+ @trailing_character = validator.allowable_values[trailing_character.to_i]
250
+ end
251
+ end
252
+
253
+ # Checks equality by comparing each attribute.
254
+ # @param [Object] Object to be compared
255
+ def ==(other)
256
+ return true if self.equal?(other)
257
+ self.class == other.class &&
258
+ link == other.link &&
259
+ alignment == other.alignment &&
260
+ font == other.font &&
261
+ is_legal == other.is_legal &&
262
+ linked_style == other.linked_style &&
263
+ number_format == other.number_format &&
264
+ number_position == other.number_position &&
265
+ number_style == other.number_style &&
266
+ restart_after_level == other.restart_after_level &&
267
+ start_at == other.start_at &&
268
+ tab_position == other.tab_position &&
269
+ text_position == other.text_position &&
270
+ trailing_character == other.trailing_character
271
+ end
272
+
273
+ # @see the `==` method
274
+ # @param [Object] Object to be compared
275
+ def eql?(other)
276
+ self == other
277
+ end
278
+
279
+ # Calculates hash code according to all attributes.
280
+ # @return [Fixnum] Hash code
281
+ def hash
282
+ [link, alignment, font, is_legal, linked_style, number_format, number_position, number_style, restart_after_level, start_at, tab_position, text_position, trailing_character].hash
283
+ end
284
+
285
+ # Builds the object from hash
286
+ # @param [Hash] attributes Model attributes in the form of hash
287
+ # @return [Object] Returns the model itself
288
+ def build_from_hash(attributes)
289
+ return nil unless attributes.is_a?(Hash)
290
+ self.class.swagger_types.each_pair do |key, type|
291
+ if type =~ /\AArray<(.*)>/i
292
+ # check to ensure the input is an array given that the the attribute
293
+ # is documented as an array but the input is not
294
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
295
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
296
+ end
297
+ elsif !attributes[self.class.attribute_map[key]].nil?
298
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
299
+ end
300
+ # or else data not found in attributes(hash), not an issue as the data can be optional
301
+ end
302
+
303
+ self
304
+ end
305
+
306
+ # Deserializes the data based on type
307
+ # @param string type Data type
308
+ # @param string value Value to be deserialized
309
+ # @return [Object] Deserialized data
310
+ def _deserialize(type, value)
311
+ case type.to_sym
312
+ when :DateTime
313
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
314
+ when :Date
315
+ Time.at(/\d/.match(value)[0].to_f).to_date
316
+ when :String
317
+ value.to_s
318
+ when :Integer
319
+ value.to_i
320
+ when :Float
321
+ value.to_f
322
+ when :BOOLEAN
323
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
324
+ true
325
+ else
326
+ false
327
+ end
328
+ when :Object
329
+ # generic object (usually a Hash), return directly
330
+ value
331
+ when /\AArray<(?<inner_type>.+)>\z/
332
+ inner_type = Regexp.last_match[:inner_type]
333
+ value.map { |v| _deserialize(inner_type, v) }
334
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
335
+ k_type = Regexp.last_match[:k_type]
336
+ v_type = Regexp.last_match[:v_type]
337
+ {}.tap do |hash|
338
+ value.each do |k, v|
339
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
340
+ end
341
+ end
342
+ else
343
+ # model
344
+ temp_model = AsposeWordsCloud.const_get(type).new
345
+ temp_model.build_from_hash(value)
346
+ end
347
+ end
348
+
349
+ # Returns the string representation of the object
350
+ # @return [String] String presentation of the object
351
+ def to_s
352
+ to_hash.to_s
353
+ end
354
+
355
+ # to_body is an alias to to_hash (backward compatibility)
356
+ # @return [Hash] Returns the object in the form of hash
357
+ def to_body
358
+ to_hash
359
+ end
360
+
361
+ # Returns the object in the form of hash
362
+ # @return [Hash] Returns the object in the form of hash
363
+ def to_hash
364
+ hash = {}
365
+ self.class.attribute_map.each_pair do |attr, param|
366
+ value = self.send(attr)
367
+ next if value.nil?
368
+ hash[param] = _to_hash(value)
369
+ end
370
+ hash
371
+ end
372
+
373
+ # Outputs non-array value in the form of hash
374
+ # For object, use to_hash. Otherwise, just return the value
375
+ # @param [Object] value Any valid value
376
+ # @return [Hash] Returns the value in the form of hash
377
+ def _to_hash(value)
378
+ if value.is_a?(Array)
379
+ value.compact.map { |v| _to_hash(v) }
380
+ elsif value.is_a?(Hash)
381
+ {}.tap do |hash|
382
+ value.each { |k, v| hash[k] = _to_hash(v) }
383
+ end
384
+ elsif value.respond_to? :to_hash
385
+ value.to_hash
386
+ else
387
+ value
388
+ end
389
+ end
390
+
391
+ end
392
+
393
+ end