aspose_slides_cloud 22.2.0 → 22.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/TestData/test.pptx +0 -0
  3. data/lib/aspose_slides_cloud/api/slides_api.rb +192 -13
  4. data/lib/aspose_slides_cloud/models/axis.rb +22 -2
  5. data/lib/aspose_slides_cloud/models/chart_lines_format.rb +221 -0
  6. data/lib/aspose_slides_cloud/models/export_options.rb +13 -1
  7. data/lib/aspose_slides_cloud/models/font_fallback_rule.rb +243 -0
  8. data/lib/aspose_slides_cloud/models/gif_export_options.rb +2 -1
  9. data/lib/aspose_slides_cloud/models/html5_export_options.rb +2 -1
  10. data/lib/aspose_slides_cloud/models/html_export_options.rb +2 -1
  11. data/lib/aspose_slides_cloud/models/image_export_options.rb +2 -1
  12. data/lib/aspose_slides_cloud/models/legend.rb +12 -2
  13. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +2 -1
  14. data/lib/aspose_slides_cloud/models/portion.rb +32 -2
  15. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +2 -1
  16. data/lib/aspose_slides_cloud/models/shape_type.rb +54 -0
  17. data/lib/aspose_slides_cloud/models/slide_comment.rb +32 -48
  18. data/lib/aspose_slides_cloud/models/slide_comment_base.rb +286 -0
  19. data/lib/aspose_slides_cloud/models/slide_comments.rb +1 -1
  20. data/lib/aspose_slides_cloud/models/slide_modern_comment.rb +269 -0
  21. data/lib/aspose_slides_cloud/models/svg_export_options.rb +2 -1
  22. data/lib/aspose_slides_cloud/models/swf_export_options.rb +2 -1
  23. data/lib/aspose_slides_cloud/models/text_bounds.rb +261 -0
  24. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +2 -1
  25. data/lib/aspose_slides_cloud/models/video_export_options.rb +2 -1
  26. data/lib/aspose_slides_cloud/models/xaml_export_options.rb +2 -1
  27. data/lib/aspose_slides_cloud/models/xps_export_options.rb +2 -1
  28. data/lib/aspose_slides_cloud/models/zoom_object.rb +1 -0
  29. data/lib/aspose_slides_cloud/type_registry.rb +9 -1
  30. data/lib/aspose_slides_cloud/version.rb +1 -1
  31. data/lib/aspose_slides_cloud.rb +7 -1
  32. data/spec/api/slides_api_spec.rb +585 -33
  33. data/spec/use_cases/merge_spec.rb +0 -1
  34. data/spec/use_cases/shape_spec.rb +0 -2
  35. data/testRules.json +5 -3
  36. metadata +8 -2
@@ -24,76 +24,59 @@ require 'date'
24
24
 
25
25
  module AsposeSlidesCloud
26
26
  # Represents comment of slide
27
- class SlideComment
28
- # Author.
29
- attr_accessor :author
30
-
31
- # Text.
32
- attr_accessor :text
33
-
34
- # Creation time.
35
- attr_accessor :created_time
27
+ class SlideComment < SlideCommentBase
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
36
44
 
37
- # Child comments.
38
- attr_accessor :child_comments
45
+ def valid?(value)
46
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
47
+ end
48
+ end
39
49
 
40
50
  # Attribute mapping from ruby-style variable name to JSON key.
41
51
  def self.attribute_map
42
- {
43
- :'author' => :'Author',
44
- :'text' => :'Text',
45
- :'created_time' => :'CreatedTime',
46
- :'child_comments' => :'ChildComments',
47
- }
52
+ super.merge({
53
+ })
48
54
  end
49
55
 
50
56
  # Attribute type mapping.
51
57
  def self.swagger_types
52
- {
53
- :'author' => :'String',
54
- :'text' => :'String',
55
- :'created_time' => :'String',
56
- :'child_comments' => :'Array<SlideComment>',
57
- }
58
+ super.merge({
59
+ })
58
60
  end
59
61
 
60
62
  # Initializes the object
61
63
  # @param [Hash] attributes Model attributes in the form of hash
62
64
  def initialize(attributes = {})
63
- return unless attributes.is_a?(Hash)
64
-
65
- # convert string to symbol for hash key
66
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
67
-
68
- if attributes.has_key?(:'Author')
69
- self.author = attributes[:'Author']
70
- end
71
-
72
- if attributes.has_key?(:'Text')
73
- self.text = attributes[:'Text']
74
- end
75
-
76
- if attributes.has_key?(:'CreatedTime')
77
- self.created_time = attributes[:'CreatedTime']
78
- end
79
-
80
- if attributes.has_key?(:'ChildComments')
81
- if (value = attributes[:'ChildComments']).is_a?(Array)
82
- self.child_comments = value
83
- end
84
- end
65
+ super
66
+ self.type = "Regular"
85
67
  end
86
68
 
87
69
  # Show invalid properties with the reasons. Usually used together with valid?
88
70
  # @return Array for valid properties with the reasons
89
71
  def list_invalid_properties
90
- invalid_properties = Array.new
72
+ invalid_properties = super
91
73
  invalid_properties
92
74
  end
93
75
 
94
76
  # Check to see if the all the properties in the model are valid
95
77
  # @return true if the model is valid
96
78
  def valid?
79
+ return false if !super
97
80
  true
98
81
  end
99
82
 
@@ -105,7 +88,8 @@ module AsposeSlidesCloud
105
88
  author == o.author &&
106
89
  text == o.text &&
107
90
  created_time == o.created_time &&
108
- child_comments == o.child_comments
91
+ child_comments == o.child_comments &&
92
+ type == o.type
109
93
  end
110
94
 
111
95
  # @see the `==` method
@@ -117,7 +101,7 @@ module AsposeSlidesCloud
117
101
  # Calculates hash code according to all attributes.
118
102
  # @return [Fixnum] Hash code
119
103
  def hash
120
- [author, text, created_time, child_comments].hash
104
+ [author, text, created_time, child_comments, type].hash
121
105
  end
122
106
 
123
107
  # Builds the object from hash
@@ -0,0 +1,286 @@
1
+ =begin
2
+ Copyright (c) 2019 Aspose Pty Ltd
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeSlidesCloud
26
+ # Represents slide comment
27
+ class SlideCommentBase
28
+ # Author.
29
+ attr_accessor :author
30
+
31
+ # Text.
32
+ attr_accessor :text
33
+
34
+ # Creation time.
35
+ attr_accessor :created_time
36
+
37
+ # Child comments.
38
+ attr_accessor :child_comments
39
+
40
+ attr_accessor :type
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'author' => :'Author',
68
+ :'text' => :'Text',
69
+ :'created_time' => :'CreatedTime',
70
+ :'child_comments' => :'ChildComments',
71
+ :'type' => :'Type',
72
+ }
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.swagger_types
77
+ {
78
+ :'author' => :'String',
79
+ :'text' => :'String',
80
+ :'created_time' => :'String',
81
+ :'child_comments' => :'Array<SlideCommentBase>',
82
+ :'type' => :'String',
83
+ }
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ return unless attributes.is_a?(Hash)
90
+
91
+ # convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
93
+
94
+ if attributes.has_key?(:'Author')
95
+ self.author = attributes[:'Author']
96
+ end
97
+
98
+ if attributes.has_key?(:'Text')
99
+ self.text = attributes[:'Text']
100
+ end
101
+
102
+ if attributes.has_key?(:'CreatedTime')
103
+ self.created_time = attributes[:'CreatedTime']
104
+ end
105
+
106
+ if attributes.has_key?(:'ChildComments')
107
+ if (value = attributes[:'ChildComments']).is_a?(Array)
108
+ self.child_comments = value
109
+ end
110
+ end
111
+
112
+ if attributes.has_key?(:'Type')
113
+ self.type = attributes[:'Type']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ invalid_properties = Array.new
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ type_validator = EnumAttributeValidator.new('String', ['Regular', 'Modern'])
128
+ return false unless type_validator.valid?(@type)
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method checking allowed values (enum).
133
+ # @param [Object] type Object to be assigned
134
+ def type=(type)
135
+ validator = EnumAttributeValidator.new('String', ['Regular', 'Modern'])
136
+ unless validator.valid?(type)
137
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
138
+ end
139
+ @type = type
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ author == o.author &&
148
+ text == o.text &&
149
+ created_time == o.created_time &&
150
+ child_comments == o.child_comments &&
151
+ type == o.type
152
+ end
153
+
154
+ # @see the `==` method
155
+ # @param [Object] Object to be compared
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Fixnum] Hash code
162
+ def hash
163
+ [author, text, created_time, child_comments, type].hash
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ self.class.swagger_types.each_pair do |key, type|
172
+ mapKey = self.class.attribute_map[key]
173
+ if !mapKey.nil?
174
+ val = attributes[mapKey]
175
+ if val.nil?
176
+ mapKeyString = mapKey.to_s
177
+ mapKeyString[0] = mapKeyString[0].downcase
178
+ mapKey = mapKeyString.to_sym
179
+ val = attributes[mapKey]
180
+ end
181
+ if !val.nil?
182
+ if type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the the attribute
184
+ # is documented as an array but the input is not
185
+ if val.is_a?(Array)
186
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
187
+ end
188
+ else
189
+ self.send("#{key}=", _deserialize(type, val))
190
+ end
191
+ end
192
+ end
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :BOOLEAN
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
236
+ if registry_type
237
+ type = registry_type
238
+ end
239
+ temp_model = AsposeSlidesCloud.const_get(type).new
240
+ temp_model.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ next if value.nil?
263
+ hash[param] = _to_hash(value)
264
+ end
265
+ hash
266
+ end
267
+
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+ end
286
+ end
@@ -38,7 +38,7 @@ module AsposeSlidesCloud
38
38
  # Attribute type mapping.
39
39
  def self.swagger_types
40
40
  super.merge({
41
- :'list' => :'Array<SlideComment>',
41
+ :'list' => :'Array<SlideCommentBase>',
42
42
  })
43
43
  end
44
44
 
@@ -0,0 +1,269 @@
1
+ =begin
2
+ Copyright (c) 2019 Aspose Pty Ltd
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeSlidesCloud
26
+ # Represents modern comment of slide
27
+ class SlideModernComment < SlideCommentBase
28
+ # Returns or sets starting position of text selection in text frame if the comment associated with AutoShape. Read/write Int32.
29
+ attr_accessor :text_selection_start
30
+
31
+ # Returns or sets text selection length in text frame if the comment associated with AutoShape. Read/write Int32.
32
+ attr_accessor :text_selection_length
33
+
34
+ # Returns or sets the status of the comment. Read/write ModernCommentStatus.
35
+ attr_accessor :status
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.any?{ |s| s.casecmp(value) == 0 }
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ super.merge({
62
+ :'text_selection_start' => :'TextSelectionStart',
63
+ :'text_selection_length' => :'TextSelectionLength',
64
+ :'status' => :'Status',
65
+ })
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ super.merge({
71
+ :'text_selection_start' => :'Integer',
72
+ :'text_selection_length' => :'Integer',
73
+ :'status' => :'String',
74
+ })
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ super
81
+
82
+ if attributes.has_key?(:'TextSelectionStart')
83
+ self.text_selection_start = attributes[:'TextSelectionStart']
84
+ end
85
+
86
+ if attributes.has_key?(:'TextSelectionLength')
87
+ self.text_selection_length = attributes[:'TextSelectionLength']
88
+ end
89
+
90
+ if attributes.has_key?(:'Status')
91
+ self.status = attributes[:'Status']
92
+ end
93
+ self.type = "Modern"
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = super
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ return false if !super
107
+ status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])
108
+ return false unless status_validator.valid?(@status)
109
+ true
110
+ end
111
+
112
+ # Custom attribute writer method checking allowed values (enum).
113
+ # @param [Object] status Object to be assigned
114
+ def status=(status)
115
+ validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])
116
+ unless validator.valid?(status)
117
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
118
+ end
119
+ @status = status
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ author == o.author &&
128
+ text == o.text &&
129
+ created_time == o.created_time &&
130
+ child_comments == o.child_comments &&
131
+ type == o.type &&
132
+ text_selection_start == o.text_selection_start &&
133
+ text_selection_length == o.text_selection_length &&
134
+ status == o.status
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Fixnum] Hash code
145
+ def hash
146
+ [author, text, created_time, child_comments, type, text_selection_start, text_selection_length, status].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.swagger_types.each_pair do |key, type|
155
+ mapKey = self.class.attribute_map[key]
156
+ if !mapKey.nil?
157
+ val = attributes[mapKey]
158
+ if val.nil?
159
+ mapKeyString = mapKey.to_s
160
+ mapKeyString[0] = mapKeyString[0].downcase
161
+ mapKey = mapKeyString.to_sym
162
+ val = attributes[mapKey]
163
+ end
164
+ if !val.nil?
165
+ if type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the the attribute
167
+ # is documented as an array but the input is not
168
+ if val.is_a?(Array)
169
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
170
+ end
171
+ else
172
+ self.send("#{key}=", _deserialize(type, val))
173
+ end
174
+ end
175
+ end
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :BOOLEAN
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
219
+ if registry_type
220
+ type = registry_type
221
+ end
222
+ temp_model = AsposeSlidesCloud.const_get(type).new
223
+ temp_model.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ next if value.nil?
246
+ hash[param] = _to_hash(value)
247
+ end
248
+ hash
249
+ end
250
+
251
+ # Outputs non-array value in the form of hash
252
+ # For object, use to_hash. Otherwise, just return the value
253
+ # @param [Object] value Any valid value
254
+ # @return [Hash] Returns the value in the form of hash
255
+ def _to_hash(value)
256
+ if value.is_a?(Array)
257
+ value.compact.map { |v| _to_hash(v) }
258
+ elsif value.is_a?(Hash)
259
+ {}.tap do |hash|
260
+ value.each { |k, v| hash[k] = _to_hash(v) }
261
+ end
262
+ elsif value.respond_to? :to_hash
263
+ value.to_hash
264
+ else
265
+ value
266
+ end
267
+ end
268
+ end
269
+ end
@@ -193,6 +193,7 @@ module AsposeSlidesCloud
193
193
  default_regular_font == o.default_regular_font &&
194
194
  height == o.height &&
195
195
  width == o.width &&
196
+ font_fallback_rules == o.font_fallback_rules &&
196
197
  format == o.format &&
197
198
  vectorize_text == o.vectorize_text &&
198
199
  metafile_rasterization_dpi == o.metafile_rasterization_dpi &&
@@ -214,7 +215,7 @@ module AsposeSlidesCloud
214
215
  # Calculates hash code according to all attributes.
215
216
  # @return [Fixnum] Hash code
216
217
  def hash
217
- [default_regular_font, height, width, format, vectorize_text, metafile_rasterization_dpi, disable3_d_text, disable_gradient_split, disable_line_end_cropping, jpeg_quality, pictures_compression, delete_pictures_cropped_areas, external_fonts_handling].hash
218
+ [default_regular_font, height, width, font_fallback_rules, format, vectorize_text, metafile_rasterization_dpi, disable3_d_text, disable_gradient_split, disable_line_end_cropping, jpeg_quality, pictures_compression, delete_pictures_cropped_areas, external_fonts_handling].hash
218
219
  end
219
220
 
220
221
  # Builds the object from hash