aspose_words_cloud 22.1.0 → 22.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud/api_client.rb +1 -0
  3. data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +12 -14
  4. data/lib/aspose_words_cloud/models/doc_save_options_data.rb +9 -11
  5. data/lib/aspose_words_cloud/models/{ooxml_save_options_data.rb → docm_save_options_data.rb} +15 -17
  6. data/lib/aspose_words_cloud/models/docx_save_options_data.rb +440 -0
  7. data/lib/aspose_words_cloud/models/dot_save_options_data.rb +426 -0
  8. data/lib/aspose_words_cloud/models/dotm_save_options_data.rb +440 -0
  9. data/lib/aspose_words_cloud/models/dotx_save_options_data.rb +440 -0
  10. data/lib/aspose_words_cloud/models/emf_save_options_data.rb +12 -14
  11. data/lib/aspose_words_cloud/models/epub_save_options_data.rb +12 -14
  12. data/lib/aspose_words_cloud/models/flat_opc_macro_save_options_data.rb +440 -0
  13. data/lib/aspose_words_cloud/models/{txt_save_options_base_data.rb → flat_opc_save_options_data.rb} +50 -54
  14. data/lib/aspose_words_cloud/models/flat_opc_template_macro_save_options_data.rb +440 -0
  15. data/lib/aspose_words_cloud/models/flat_opc_template_save_options_data.rb +440 -0
  16. data/lib/aspose_words_cloud/models/gif_save_options_data.rb +12 -14
  17. data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +9 -11
  18. data/lib/aspose_words_cloud/models/html_save_options_data.rb +9 -11
  19. data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +12 -14
  20. data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +9 -11
  21. data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +12 -14
  22. data/lib/aspose_words_cloud/models/odt_save_options_data.rb +12 -14
  23. data/lib/aspose_words_cloud/models/{fixed_page_save_options_data.rb → open_xps_save_options_data.rb} +55 -17
  24. data/lib/aspose_words_cloud/models/ott_save_options_data.rb +441 -0
  25. data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +12 -14
  26. data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +9 -11
  27. data/lib/aspose_words_cloud/models/png_save_options_data.rb +12 -14
  28. data/lib/aspose_words_cloud/models/ps_save_options_data.rb +9 -11
  29. data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +9 -11
  30. data/lib/aspose_words_cloud/models/svg_save_options_data.rb +9 -11
  31. data/lib/aspose_words_cloud/models/text_save_options_data.rb +9 -11
  32. data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +9 -11
  33. data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +12 -14
  34. data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +12 -14
  35. data/lib/aspose_words_cloud/models/{save_options_data.rb → xaml_flow_pack_save_options_data.rb} +35 -17
  36. data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +12 -14
  37. data/lib/aspose_words_cloud/models/xps_save_options_data.rb +9 -11
  38. data/lib/aspose_words_cloud/version.rb +1 -1
  39. data/lib/aspose_words_cloud.rb +12 -10
  40. metadata +14 -12
  41. data/lib/aspose_words_cloud/models/comment_base.rb +0 -251
  42. data/lib/aspose_words_cloud/models/document_property_base.rb +0 -201
  43. data/lib/aspose_words_cloud/models/field_base.rb +0 -211
  44. data/lib/aspose_words_cloud/models/footnote_base.rb +0 -273
  45. data/lib/aspose_words_cloud/models/image_save_options_data.rb +0 -585
  46. data/lib/aspose_words_cloud/models/run_base.rb +0 -201
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_words_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.1.0
4
+ version: 22.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YaroslawEkimov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-19 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -105,7 +105,6 @@ files:
105
105
  - lib/aspose_words_cloud/models/classification_response.rb
106
106
  - lib/aspose_words_cloud/models/classification_result.rb
107
107
  - lib/aspose_words_cloud/models/comment.rb
108
- - lib/aspose_words_cloud/models/comment_base.rb
109
108
  - lib/aspose_words_cloud/models/comment_insert.rb
110
109
  - lib/aspose_words_cloud/models/comment_link.rb
111
110
  - lib/aspose_words_cloud/models/comment_response.rb
@@ -123,6 +122,7 @@ files:
123
122
  - lib/aspose_words_cloud/models/custom_xml_parts_collection.rb
124
123
  - lib/aspose_words_cloud/models/custom_xml_parts_response.rb
125
124
  - lib/aspose_words_cloud/models/doc_save_options_data.rb
125
+ - lib/aspose_words_cloud/models/docm_save_options_data.rb
126
126
  - lib/aspose_words_cloud/models/document.rb
127
127
  - lib/aspose_words_cloud/models/document_entry.rb
128
128
  - lib/aspose_words_cloud/models/document_entry_list.rb
@@ -130,11 +130,14 @@ files:
130
130
  - lib/aspose_words_cloud/models/document_properties.rb
131
131
  - lib/aspose_words_cloud/models/document_properties_response.rb
132
132
  - lib/aspose_words_cloud/models/document_property.rb
133
- - lib/aspose_words_cloud/models/document_property_base.rb
134
133
  - lib/aspose_words_cloud/models/document_property_create_or_update.rb
135
134
  - lib/aspose_words_cloud/models/document_property_response.rb
136
135
  - lib/aspose_words_cloud/models/document_response.rb
137
136
  - lib/aspose_words_cloud/models/document_stat_data.rb
137
+ - lib/aspose_words_cloud/models/docx_save_options_data.rb
138
+ - lib/aspose_words_cloud/models/dot_save_options_data.rb
139
+ - lib/aspose_words_cloud/models/dotm_save_options_data.rb
140
+ - lib/aspose_words_cloud/models/dotx_save_options_data.rb
138
141
  - lib/aspose_words_cloud/models/downsample_options_data.rb
139
142
  - lib/aspose_words_cloud/models/drawing_object.rb
140
143
  - lib/aspose_words_cloud/models/drawing_object_collection.rb
@@ -148,7 +151,6 @@ files:
148
151
  - lib/aspose_words_cloud/models/error.rb
149
152
  - lib/aspose_words_cloud/models/error_details.rb
150
153
  - lib/aspose_words_cloud/models/field.rb
151
- - lib/aspose_words_cloud/models/field_base.rb
152
154
  - lib/aspose_words_cloud/models/field_collection.rb
153
155
  - lib/aspose_words_cloud/models/field_insert.rb
154
156
  - lib/aspose_words_cloud/models/field_link.rb
@@ -161,13 +163,15 @@ files:
161
163
  - lib/aspose_words_cloud/models/file_link.rb
162
164
  - lib/aspose_words_cloud/models/files_list.rb
163
165
  - lib/aspose_words_cloud/models/files_upload_result.rb
164
- - lib/aspose_words_cloud/models/fixed_page_save_options_data.rb
166
+ - lib/aspose_words_cloud/models/flat_opc_macro_save_options_data.rb
167
+ - lib/aspose_words_cloud/models/flat_opc_save_options_data.rb
168
+ - lib/aspose_words_cloud/models/flat_opc_template_macro_save_options_data.rb
169
+ - lib/aspose_words_cloud/models/flat_opc_template_save_options_data.rb
165
170
  - lib/aspose_words_cloud/models/font.rb
166
171
  - lib/aspose_words_cloud/models/font_dto.rb
167
172
  - lib/aspose_words_cloud/models/font_info.rb
168
173
  - lib/aspose_words_cloud/models/font_response.rb
169
174
  - lib/aspose_words_cloud/models/footnote.rb
170
- - lib/aspose_words_cloud/models/footnote_base.rb
171
175
  - lib/aspose_words_cloud/models/footnote_collection.rb
172
176
  - lib/aspose_words_cloud/models/footnote_insert.rb
173
177
  - lib/aspose_words_cloud/models/footnote_link.rb
@@ -194,7 +198,6 @@ files:
194
198
  - lib/aspose_words_cloud/models/hyperlink_response.rb
195
199
  - lib/aspose_words_cloud/models/hyperlinks.rb
196
200
  - lib/aspose_words_cloud/models/hyperlinks_response.rb
197
- - lib/aspose_words_cloud/models/image_save_options_data.rb
198
201
  - lib/aspose_words_cloud/models/info_additional_item.rb
199
202
  - lib/aspose_words_cloud/models/info_response.rb
200
203
  - lib/aspose_words_cloud/models/jpeg_save_options_data.rb
@@ -224,8 +227,9 @@ files:
224
227
  - lib/aspose_words_cloud/models/office_math_object_response.rb
225
228
  - lib/aspose_words_cloud/models/office_math_objects_collection.rb
226
229
  - lib/aspose_words_cloud/models/office_math_objects_response.rb
227
- - lib/aspose_words_cloud/models/ooxml_save_options_data.rb
230
+ - lib/aspose_words_cloud/models/open_xps_save_options_data.rb
228
231
  - lib/aspose_words_cloud/models/optimization_options.rb
232
+ - lib/aspose_words_cloud/models/ott_save_options_data.rb
229
233
  - lib/aspose_words_cloud/models/outline_options_data.rb
230
234
  - lib/aspose_words_cloud/models/page_number.rb
231
235
  - lib/aspose_words_cloud/models/page_setup.rb
@@ -634,14 +638,12 @@ files:
634
638
  - lib/aspose_words_cloud/models/revisions_modification_response.rb
635
639
  - lib/aspose_words_cloud/models/rtf_save_options_data.rb
636
640
  - lib/aspose_words_cloud/models/run.rb
637
- - lib/aspose_words_cloud/models/run_base.rb
638
641
  - lib/aspose_words_cloud/models/run_insert.rb
639
642
  - lib/aspose_words_cloud/models/run_link.rb
640
643
  - lib/aspose_words_cloud/models/run_response.rb
641
644
  - lib/aspose_words_cloud/models/run_update.rb
642
645
  - lib/aspose_words_cloud/models/runs.rb
643
646
  - lib/aspose_words_cloud/models/runs_response.rb
644
- - lib/aspose_words_cloud/models/save_options_data.rb
645
647
  - lib/aspose_words_cloud/models/save_response.rb
646
648
  - lib/aspose_words_cloud/models/save_result.rb
647
649
  - lib/aspose_words_cloud/models/search_response.rb
@@ -698,7 +700,6 @@ files:
698
700
  - lib/aspose_words_cloud/models/text_save_options_data.rb
699
701
  - lib/aspose_words_cloud/models/tiff_save_options_data.rb
700
702
  - lib/aspose_words_cloud/models/time_zone_info_data.rb
701
- - lib/aspose_words_cloud/models/txt_save_options_base_data.rb
702
703
  - lib/aspose_words_cloud/models/user_information.rb
703
704
  - lib/aspose_words_cloud/models/watermark_text.rb
704
705
  - lib/aspose_words_cloud/models/word_ml_save_options_data.rb
@@ -706,6 +707,7 @@ files:
706
707
  - lib/aspose_words_cloud/models/words_api_link.rb
707
708
  - lib/aspose_words_cloud/models/words_response.rb
708
709
  - lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb
710
+ - lib/aspose_words_cloud/models/xaml_flow_pack_save_options_data.rb
709
711
  - lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb
710
712
  - lib/aspose_words_cloud/models/xml_color.rb
711
713
  - lib/aspose_words_cloud/models/xml_data_load_options.rb
@@ -1,251 +0,0 @@
1
- # ------------------------------------------------------------------------------------
2
- # <copyright company="Aspose" file="comment_base.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
- # Comment.
31
- class CommentBase
32
- # Gets or sets the author name for a comment.
33
- attr_accessor :author
34
-
35
- # Gets or sets the date and time that the comment was made.
36
- attr_accessor :date_time
37
-
38
- # Gets or sets the initials of the user associated with a specific comment.
39
- attr_accessor :initial
40
-
41
- # Gets or sets the link to comment range end node.
42
- attr_accessor :range_end
43
-
44
- # Gets or sets the link to comment range start node.
45
- attr_accessor :range_start
46
-
47
- # Gets or sets text of the comment.
48
- attr_accessor :text
49
- # Attribute mapping from ruby-style variable name to JSON key.
50
- def self.attribute_map
51
- {
52
- :'author' => :'Author',
53
- :'date_time' => :'DateTime',
54
- :'initial' => :'Initial',
55
- :'range_end' => :'RangeEnd',
56
- :'range_start' => :'RangeStart',
57
- :'text' => :'Text'
58
- }
59
- end
60
-
61
- # Attribute type mapping.
62
- def self.swagger_types
63
- {
64
- :'author' => :'String',
65
- :'date_time' => :'DateTime',
66
- :'initial' => :'String',
67
- :'range_end' => :'DocumentPosition',
68
- :'range_start' => :'DocumentPosition',
69
- :'text' => :'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?(:'Author')
82
- self.author = attributes[:'Author']
83
- end
84
-
85
- if attributes.key?(:'DateTime')
86
- self.date_time = attributes[:'DateTime']
87
- end
88
-
89
- if attributes.key?(:'Initial')
90
- self.initial = attributes[:'Initial']
91
- end
92
-
93
- if attributes.key?(:'RangeEnd')
94
- self.range_end = attributes[:'RangeEnd']
95
- end
96
-
97
- if attributes.key?(:'RangeStart')
98
- self.range_start = attributes[:'RangeStart']
99
- end
100
-
101
- if attributes.key?(:'Text')
102
- self.text = attributes[:'Text']
103
- end
104
- end
105
-
106
- # Show invalid properties with the reasons. Usually used together with valid?
107
- # @return Array for valid properies with the reasons
108
- def list_invalid_properties
109
- invalid_properties = []
110
- return invalid_properties
111
- end
112
-
113
- # Check to see if the all the properties in the model are valid
114
- # @return true if the model is valid
115
- def valid?
116
- return true
117
- end
118
-
119
- # Checks equality by comparing each attribute.
120
- # @param [Object] Object to be compared
121
- def ==(other)
122
- return true if self.equal?(other)
123
- self.class == other.class &&
124
- author == other.author &&
125
- date_time == other.date_time &&
126
- initial == other.initial &&
127
- range_end == other.range_end &&
128
- range_start == other.range_start &&
129
- text == other.text
130
- end
131
-
132
- # @see the `==` method
133
- # @param [Object] Object to be compared
134
- def eql?(other)
135
- self == other
136
- end
137
-
138
- # Calculates hash code according to all attributes.
139
- # @return [Fixnum] Hash code
140
- def hash
141
- [author, date_time, initial, range_end, range_start, text].hash
142
- end
143
-
144
- # Builds the object from hash
145
- # @param [Hash] attributes Model attributes in the form of hash
146
- # @return [Object] Returns the model itself
147
- def build_from_hash(attributes)
148
- return nil unless attributes.is_a?(Hash)
149
- self.class.swagger_types.each_pair do |key, type|
150
- if type =~ /\AArray<(.*)>/i
151
- # check to ensure the input is an array given that the the attribute
152
- # is documented as an array but the input is not
153
- if attributes[self.class.attribute_map[key]].is_a?(Array)
154
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
- end
156
- elsif !attributes[self.class.attribute_map[key]].nil?
157
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
- end
159
- # or else data not found in attributes(hash), not an issue as the data can be optional
160
- end
161
-
162
- self
163
- end
164
-
165
- # Deserializes the data based on type
166
- # @param string type Data type
167
- # @param string value Value to be deserialized
168
- # @return [Object] Deserialized data
169
- def _deserialize(type, value)
170
- case type.to_sym
171
- when :DateTime
172
- Time.at(/\d/.match(value)[0].to_f).to_datetime
173
- when :Date
174
- Time.at(/\d/.match(value)[0].to_f).to_date
175
- when :String
176
- value.to_s
177
- when :Integer
178
- value.to_i
179
- when :Float
180
- value.to_f
181
- when :BOOLEAN
182
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
- true
184
- else
185
- false
186
- end
187
- when :Object
188
- # generic object (usually a Hash), return directly
189
- value
190
- when /\AArray<(?<inner_type>.+)>\z/
191
- inner_type = Regexp.last_match[:inner_type]
192
- value.map { |v| _deserialize(inner_type, v) }
193
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
- k_type = Regexp.last_match[:k_type]
195
- v_type = Regexp.last_match[:v_type]
196
- {}.tap do |hash|
197
- value.each do |k, v|
198
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
- end
200
- end
201
- else
202
- # model
203
- temp_model = AsposeWordsCloud.const_get(type).new
204
- temp_model.build_from_hash(value)
205
- end
206
- end
207
-
208
- # Returns the string representation of the object
209
- # @return [String] String presentation of the object
210
- def to_s
211
- to_hash.to_s
212
- end
213
-
214
- # to_body is an alias to to_hash (backward compatibility)
215
- # @return [Hash] Returns the object in the form of hash
216
- def to_body
217
- to_hash
218
- end
219
-
220
- # Returns the object in the form of hash
221
- # @return [Hash] Returns the object in the form of hash
222
- def to_hash
223
- hash = {}
224
- self.class.attribute_map.each_pair do |attr, param|
225
- value = self.send(attr)
226
- next if value.nil?
227
- hash[param] = _to_hash(value)
228
- end
229
- hash
230
- end
231
-
232
- # Outputs non-array value in the form of hash
233
- # For object, use to_hash. Otherwise, just return the value
234
- # @param [Object] value Any valid value
235
- # @return [Hash] Returns the value in the form of hash
236
- def _to_hash(value)
237
- if value.is_a?(Array)
238
- value.compact.map { |v| _to_hash(v) }
239
- elsif value.is_a?(Hash)
240
- {}.tap do |hash|
241
- value.each { |k, v| hash[k] = _to_hash(v) }
242
- end
243
- elsif value.respond_to? :to_hash
244
- value.to_hash
245
- else
246
- value
247
- end
248
- end
249
-
250
- end
251
- end
@@ -1,201 +0,0 @@
1
- # ------------------------------------------------------------------------------------
2
- # <copyright company="Aspose" file="document_property_base.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
- # Words document property DTO base class.
31
- class DocumentPropertyBase
32
- # Gets or sets the value of the document property.
33
- attr_accessor :value
34
- # Attribute mapping from ruby-style variable name to JSON key.
35
- def self.attribute_map
36
- {
37
- :'value' => :'Value'
38
- }
39
- end
40
-
41
- # Attribute type mapping.
42
- def self.swagger_types
43
- {
44
- :'value' => :'String'
45
- }
46
- end
47
-
48
- # Initializes the object
49
- # @param [Hash] attributes Model attributes in the form of hash
50
- def initialize(attributes = {})
51
- return unless attributes.is_a?(Hash)
52
-
53
- # convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
-
56
- if attributes.key?(:'Value')
57
- self.value = attributes[:'Value']
58
- end
59
- end
60
-
61
- # Show invalid properties with the reasons. Usually used together with valid?
62
- # @return Array for valid properies with the reasons
63
- def list_invalid_properties
64
- invalid_properties = []
65
- return invalid_properties
66
- end
67
-
68
- # Check to see if the all the properties in the model are valid
69
- # @return true if the model is valid
70
- def valid?
71
- return true
72
- end
73
-
74
- # Checks equality by comparing each attribute.
75
- # @param [Object] Object to be compared
76
- def ==(other)
77
- return true if self.equal?(other)
78
- self.class == other.class &&
79
- value == other.value
80
- end
81
-
82
- # @see the `==` method
83
- # @param [Object] Object to be compared
84
- def eql?(other)
85
- self == other
86
- end
87
-
88
- # Calculates hash code according to all attributes.
89
- # @return [Fixnum] Hash code
90
- def hash
91
- [value].hash
92
- end
93
-
94
- # Builds the object from hash
95
- # @param [Hash] attributes Model attributes in the form of hash
96
- # @return [Object] Returns the model itself
97
- def build_from_hash(attributes)
98
- return nil unless attributes.is_a?(Hash)
99
- self.class.swagger_types.each_pair do |key, type|
100
- if type =~ /\AArray<(.*)>/i
101
- # check to ensure the input is an array given that the the attribute
102
- # is documented as an array but the input is not
103
- if attributes[self.class.attribute_map[key]].is_a?(Array)
104
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
105
- end
106
- elsif !attributes[self.class.attribute_map[key]].nil?
107
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
108
- end
109
- # or else data not found in attributes(hash), not an issue as the data can be optional
110
- end
111
-
112
- self
113
- end
114
-
115
- # Deserializes the data based on type
116
- # @param string type Data type
117
- # @param string value Value to be deserialized
118
- # @return [Object] Deserialized data
119
- def _deserialize(type, value)
120
- case type.to_sym
121
- when :DateTime
122
- Time.at(/\d/.match(value)[0].to_f).to_datetime
123
- when :Date
124
- Time.at(/\d/.match(value)[0].to_f).to_date
125
- when :String
126
- value.to_s
127
- when :Integer
128
- value.to_i
129
- when :Float
130
- value.to_f
131
- when :BOOLEAN
132
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
- true
134
- else
135
- false
136
- end
137
- when :Object
138
- # generic object (usually a Hash), return directly
139
- value
140
- when /\AArray<(?<inner_type>.+)>\z/
141
- inner_type = Regexp.last_match[:inner_type]
142
- value.map { |v| _deserialize(inner_type, v) }
143
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
- k_type = Regexp.last_match[:k_type]
145
- v_type = Regexp.last_match[:v_type]
146
- {}.tap do |hash|
147
- value.each do |k, v|
148
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
- end
150
- end
151
- else
152
- # model
153
- temp_model = AsposeWordsCloud.const_get(type).new
154
- temp_model.build_from_hash(value)
155
- end
156
- end
157
-
158
- # Returns the string representation of the object
159
- # @return [String] String presentation of the object
160
- def to_s
161
- to_hash.to_s
162
- end
163
-
164
- # to_body is an alias to to_hash (backward compatibility)
165
- # @return [Hash] Returns the object in the form of hash
166
- def to_body
167
- to_hash
168
- end
169
-
170
- # Returns the object in the form of hash
171
- # @return [Hash] Returns the object in the form of hash
172
- def to_hash
173
- hash = {}
174
- self.class.attribute_map.each_pair do |attr, param|
175
- value = self.send(attr)
176
- next if value.nil?
177
- hash[param] = _to_hash(value)
178
- end
179
- hash
180
- end
181
-
182
- # Outputs non-array value in the form of hash
183
- # For object, use to_hash. Otherwise, just return the value
184
- # @param [Object] value Any valid value
185
- # @return [Hash] Returns the value in the form of hash
186
- def _to_hash(value)
187
- if value.is_a?(Array)
188
- value.compact.map { |v| _to_hash(v) }
189
- elsif value.is_a?(Hash)
190
- {}.tap do |hash|
191
- value.each { |k, v| hash[k] = _to_hash(v) }
192
- end
193
- elsif value.respond_to? :to_hash
194
- value.to_hash
195
- else
196
- value
197
- end
198
- end
199
-
200
- end
201
- end