aspose_slides_cloud 22.7.0 → 22.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -7
  3. data/README.md +17 -1
  4. data/TestData/calibri.ttf +0 -0
  5. data/TestData/shapes.svg +20 -0
  6. data/TestData/test.pptx +0 -0
  7. data/docker-entrypoint.sh +3 -1
  8. data/lib/aspose_slides_cloud/api/slides_api.rb +953 -51
  9. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +5 -1
  10. data/lib/aspose_slides_cloud/models/data_point.rb +42 -2
  11. data/lib/aspose_slides_cloud/models/export_options.rb +13 -1
  12. data/lib/aspose_slides_cloud/models/font_data.rb +221 -0
  13. data/lib/aspose_slides_cloud/models/font_subst_rule.rb +231 -0
  14. data/lib/aspose_slides_cloud/models/fonts_data.rb +213 -0
  15. data/lib/aspose_slides_cloud/models/gif_export_options.rb +2 -1
  16. data/lib/aspose_slides_cloud/models/html5_export_options.rb +2 -1
  17. data/lib/aspose_slides_cloud/models/html_export_options.rb +2 -1
  18. data/lib/aspose_slides_cloud/models/image_export_options.rb +2 -1
  19. data/lib/aspose_slides_cloud/models/image_export_options_base.rb +2 -1
  20. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +5 -1
  21. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +2 -1
  22. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +2 -1
  23. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +5 -1
  24. data/lib/aspose_slides_cloud/models/svg_export_options.rb +2 -1
  25. data/lib/aspose_slides_cloud/models/swf_export_options.rb +2 -1
  26. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +2 -1
  27. data/lib/aspose_slides_cloud/models/video_export_options.rb +2 -1
  28. data/lib/aspose_slides_cloud/models/xaml_export_options.rb +2 -1
  29. data/lib/aspose_slides_cloud/models/xps_export_options.rb +2 -1
  30. data/lib/aspose_slides_cloud/type_registry.rb +3 -0
  31. data/lib/aspose_slides_cloud/version.rb +1 -1
  32. data/lib/aspose_slides_cloud.rb +3 -0
  33. data/spec/api/slides_api_spec.rb +2414 -4
  34. data/spec/spec_utils.rb +5 -1
  35. data/spec/use_cases/chart_spec.rb +209 -0
  36. data/spec/use_cases/comment_spec.rb +159 -0
  37. data/spec/use_cases/convert_spec.rb +39 -0
  38. data/spec/use_cases/font_spec.rb +143 -0
  39. data/spec/use_cases/layout_slide_spec.rb +18 -0
  40. data/spec/use_cases/master_slide_spec.rb +16 -0
  41. data/spec/use_cases/merge_spec.rb +21 -0
  42. data/spec/use_cases/notes_slide_spec.rb +34 -0
  43. data/spec/use_cases/paragraph_spec.rb +322 -0
  44. data/spec/use_cases/portion_spec.rb +316 -0
  45. data/spec/use_cases/property_spec.rb +37 -1
  46. data/spec/use_cases/shape_spec.rb +193 -0
  47. data/spec/use_cases/slide_spec.rb +197 -0
  48. data/spec/use_cases/text_format_spec.rb +74 -0
  49. data/spec/use_cases/text_spec.rb +39 -0
  50. data/testRules.json +32 -1
  51. metadata +19 -2
@@ -76,6 +76,10 @@ module AsposeSlidesCloud
76
76
  def ==(o)
77
77
  return true if self.equal?(o)
78
78
  self.class == o.class &&
79
+ fill_format == o.fill_format &&
80
+ effect_format == o.effect_format &&
81
+ three_d_format == o.three_d_format &&
82
+ line_format == o.line_format &&
79
83
  x_value == o.x_value &&
80
84
  y_value == o.y_value &&
81
85
  bubble_size == o.bubble_size
@@ -90,7 +94,7 @@ module AsposeSlidesCloud
90
94
  # Calculates hash code according to all attributes.
91
95
  # @return [Fixnum] Hash code
92
96
  def hash
93
- [x_value, y_value, bubble_size].hash
97
+ [fill_format, effect_format, three_d_format, line_format, x_value, y_value, bubble_size].hash
94
98
  end
95
99
 
96
100
  # Builds the object from hash
@@ -25,15 +25,35 @@ require 'date'
25
25
  module AsposeSlidesCloud
26
26
  # Data point.
27
27
  class DataPoint
28
+ # Gets or sets the fill format.
29
+ attr_accessor :fill_format
30
+
31
+ # Gets or sets the effect format.
32
+ attr_accessor :effect_format
33
+
34
+ # Gets or sets the 3D format
35
+ attr_accessor :three_d_format
36
+
37
+ # Gets or sets the line format.
38
+ attr_accessor :line_format
39
+
28
40
  # Attribute mapping from ruby-style variable name to JSON key.
29
41
  def self.attribute_map
30
42
  {
43
+ :'fill_format' => :'FillFormat',
44
+ :'effect_format' => :'EffectFormat',
45
+ :'three_d_format' => :'ThreeDFormat',
46
+ :'line_format' => :'LineFormat',
31
47
  }
32
48
  end
33
49
 
34
50
  # Attribute type mapping.
35
51
  def self.swagger_types
36
52
  {
53
+ :'fill_format' => :'FillFormat',
54
+ :'effect_format' => :'EffectFormat',
55
+ :'three_d_format' => :'ThreeDFormat',
56
+ :'line_format' => :'LineFormat',
37
57
  }
38
58
  end
39
59
 
@@ -44,6 +64,22 @@ module AsposeSlidesCloud
44
64
 
45
65
  # convert string to symbol for hash key
46
66
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
67
+
68
+ if attributes.has_key?(:'FillFormat')
69
+ self.fill_format = attributes[:'FillFormat']
70
+ end
71
+
72
+ if attributes.has_key?(:'EffectFormat')
73
+ self.effect_format = attributes[:'EffectFormat']
74
+ end
75
+
76
+ if attributes.has_key?(:'ThreeDFormat')
77
+ self.three_d_format = attributes[:'ThreeDFormat']
78
+ end
79
+
80
+ if attributes.has_key?(:'LineFormat')
81
+ self.line_format = attributes[:'LineFormat']
82
+ end
47
83
  end
48
84
 
49
85
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -63,7 +99,11 @@ module AsposeSlidesCloud
63
99
  # @param [Object] Object to be compared
64
100
  def ==(o)
65
101
  return true if self.equal?(o)
66
- self.class == o.class
102
+ self.class == o.class &&
103
+ fill_format == o.fill_format &&
104
+ effect_format == o.effect_format &&
105
+ three_d_format == o.three_d_format &&
106
+ line_format == o.line_format
67
107
  end
68
108
 
69
109
  # @see the `==` method
@@ -75,7 +115,7 @@ module AsposeSlidesCloud
75
115
  # Calculates hash code according to all attributes.
76
116
  # @return [Fixnum] Hash code
77
117
  def hash
78
- [].hash
118
+ [fill_format, effect_format, three_d_format, line_format].hash
79
119
  end
80
120
 
81
121
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposeSlidesCloud
31
31
  # Gets of sets list of font fallback rules.
32
32
  attr_accessor :font_fallback_rules
33
33
 
34
+ # Gets of sets list of font substitution rules.
35
+ attr_accessor :font_subst_rules
36
+
34
37
  attr_accessor :format
35
38
 
36
39
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -38,6 +41,7 @@ module AsposeSlidesCloud
38
41
  {
39
42
  :'default_regular_font' => :'DefaultRegularFont',
40
43
  :'font_fallback_rules' => :'FontFallbackRules',
44
+ :'font_subst_rules' => :'FontSubstRules',
41
45
  :'format' => :'Format',
42
46
  }
43
47
  end
@@ -47,6 +51,7 @@ module AsposeSlidesCloud
47
51
  {
48
52
  :'default_regular_font' => :'String',
49
53
  :'font_fallback_rules' => :'Array<FontFallbackRule>',
54
+ :'font_subst_rules' => :'Array<FontSubstRule>',
50
55
  :'format' => :'String',
51
56
  }
52
57
  end
@@ -69,6 +74,12 @@ module AsposeSlidesCloud
69
74
  end
70
75
  end
71
76
 
77
+ if attributes.has_key?(:'FontSubstRules')
78
+ if (value = attributes[:'FontSubstRules']).is_a?(Array)
79
+ self.font_subst_rules = value
80
+ end
81
+ end
82
+
72
83
  if attributes.has_key?(:'Format')
73
84
  self.format = attributes[:'Format']
74
85
  end
@@ -94,6 +105,7 @@ module AsposeSlidesCloud
94
105
  self.class == o.class &&
95
106
  default_regular_font == o.default_regular_font &&
96
107
  font_fallback_rules == o.font_fallback_rules &&
108
+ font_subst_rules == o.font_subst_rules &&
97
109
  format == o.format
98
110
  end
99
111
 
@@ -106,7 +118,7 @@ module AsposeSlidesCloud
106
118
  # Calculates hash code according to all attributes.
107
119
  # @return [Fixnum] Hash code
108
120
  def hash
109
- [default_regular_font, font_fallback_rules, format].hash
121
+ [default_regular_font, font_fallback_rules, font_subst_rules, format].hash
110
122
  end
111
123
 
112
124
  # Builds the object from hash
@@ -0,0 +1,221 @@
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 font info.
27
+ class FontData
28
+ # Font name
29
+ attr_accessor :font_name
30
+
31
+ # Returns true if font is embedded.
32
+ attr_accessor :is_embedded
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'font_name' => :'FontName',
38
+ :'is_embedded' => :'IsEmbedded',
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'font_name' => :'String',
46
+ :'is_embedded' => :'BOOLEAN',
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'FontName')
59
+ self.font_name = attributes[:'FontName']
60
+ end
61
+
62
+ if attributes.has_key?(:'IsEmbedded')
63
+ self.is_embedded = attributes[:'IsEmbedded']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ font_name == o.font_name &&
86
+ is_embedded == o.is_embedded
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [font_name, is_embedded].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ mapKey = self.class.attribute_map[key]
108
+ if !mapKey.nil?
109
+ val = attributes[mapKey]
110
+ if val.nil?
111
+ mapKeyString = mapKey.to_s
112
+ mapKeyString[0] = mapKeyString[0].downcase
113
+ mapKey = mapKeyString.to_sym
114
+ val = attributes[mapKey]
115
+ end
116
+ if !val.nil?
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if val.is_a?(Array)
121
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
122
+ end
123
+ else
124
+ self.send("#{key}=", _deserialize(type, val))
125
+ end
126
+ end
127
+ end
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :BOOLEAN
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
171
+ if registry_type
172
+ type = registry_type
173
+ end
174
+ temp_model = AsposeSlidesCloud.const_get(type).new
175
+ temp_model.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ next if value.nil?
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+ end
221
+ end
@@ -0,0 +1,231 @@
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 font substitution rule.
27
+ class FontSubstRule
28
+ # Font to substitute.
29
+ attr_accessor :source_font
30
+
31
+ # Substitution font.
32
+ attr_accessor :target_font
33
+
34
+ # Substitute when font is not found. Default: true.
35
+ attr_accessor :not_found_only
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'source_font' => :'SourceFont',
41
+ :'target_font' => :'TargetFont',
42
+ :'not_found_only' => :'NotFoundOnly',
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'source_font' => :'String',
50
+ :'target_font' => :'String',
51
+ :'not_found_only' => :'BOOLEAN',
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
+
63
+ if attributes.has_key?(:'SourceFont')
64
+ self.source_font = attributes[:'SourceFont']
65
+ end
66
+
67
+ if attributes.has_key?(:'TargetFont')
68
+ self.target_font = attributes[:'TargetFont']
69
+ end
70
+
71
+ if attributes.has_key?(:'NotFoundOnly')
72
+ self.not_found_only = attributes[:'NotFoundOnly']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ source_font == o.source_font &&
95
+ target_font == o.target_font &&
96
+ not_found_only == o.not_found_only
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [source_font, target_font, not_found_only].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ mapKey = self.class.attribute_map[key]
118
+ if !mapKey.nil?
119
+ val = attributes[mapKey]
120
+ if val.nil?
121
+ mapKeyString = mapKey.to_s
122
+ mapKeyString[0] = mapKeyString[0].downcase
123
+ mapKey = mapKeyString.to_sym
124
+ val = attributes[mapKey]
125
+ end
126
+ if !val.nil?
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if val.is_a?(Array)
131
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
132
+ end
133
+ else
134
+ self.send("#{key}=", _deserialize(type, val))
135
+ end
136
+ end
137
+ end
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :DateTime
150
+ DateTime.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :BOOLEAN
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
181
+ if registry_type
182
+ type = registry_type
183
+ end
184
+ temp_model = AsposeSlidesCloud.const_get(type).new
185
+ temp_model.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ next if value.nil?
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+ end
231
+ end