aspose_slides_cloud 22.2.0 → 22.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -7
  3. data/LICENSE +20 -20
  4. data/README.md +27 -0
  5. data/Rakefile +8 -8
  6. data/TestData/oleObject.xlsx +0 -0
  7. data/TestData/test.pptx +0 -0
  8. data/aspose_slides_cloud.gemspec +56 -56
  9. data/lib/aspose_slides_cloud/api/slides_api.rb +192 -13
  10. data/lib/aspose_slides_cloud/api_error.rb +48 -48
  11. data/lib/aspose_slides_cloud/configuration.rb +188 -188
  12. data/lib/aspose_slides_cloud/models/access_permissions.rb +321 -0
  13. data/lib/aspose_slides_cloud/models/{waterfall_series.rb → alpha_bi_level_effect.rb} +16 -26
  14. data/lib/aspose_slides_cloud/models/alpha_ceiling_effect.rb +223 -0
  15. data/lib/aspose_slides_cloud/models/alpha_floor_effect.rb +223 -0
  16. data/lib/aspose_slides_cloud/models/alpha_inverse_effect.rb +223 -0
  17. data/lib/aspose_slides_cloud/models/alpha_modulate_effect.rb +223 -0
  18. data/lib/aspose_slides_cloud/models/alpha_modulate_fixed_effect.rb +238 -0
  19. data/lib/aspose_slides_cloud/models/alpha_replace_effect.rb +238 -0
  20. data/lib/aspose_slides_cloud/models/audio_frame.rb +12 -3
  21. data/lib/aspose_slides_cloud/models/axis.rb +22 -2
  22. data/lib/aspose_slides_cloud/models/bi_level_effect.rb +238 -0
  23. data/lib/aspose_slides_cloud/models/blur_image_effect.rb +253 -0
  24. data/lib/aspose_slides_cloud/models/chart.rb +1 -2
  25. data/lib/aspose_slides_cloud/models/chart_lines_format.rb +221 -0
  26. data/lib/aspose_slides_cloud/models/color_change_effect.rb +243 -0
  27. data/lib/aspose_slides_cloud/models/color_replace_effect.rb +233 -0
  28. data/lib/aspose_slides_cloud/models/connector.rb +1 -2
  29. data/lib/aspose_slides_cloud/models/duotone_effect.rb +243 -0
  30. data/lib/aspose_slides_cloud/models/export_options.rb +10 -18
  31. data/lib/aspose_slides_cloud/models/fill_overlay_image_effect.rb +260 -0
  32. data/lib/aspose_slides_cloud/models/font_fallback_rule.rb +243 -0
  33. data/lib/aspose_slides_cloud/models/geometry_shape.rb +1 -2
  34. data/lib/aspose_slides_cloud/models/gif_export_options.rb +4 -3
  35. data/lib/aspose_slides_cloud/models/graphical_object.rb +1 -2
  36. data/lib/aspose_slides_cloud/models/{waterfall_chart_data_point.rb → gray_scale_effect.rb} +26 -13
  37. data/lib/aspose_slides_cloud/models/group_shape.rb +12 -3
  38. data/lib/aspose_slides_cloud/models/hsl_effect.rb +268 -0
  39. data/lib/aspose_slides_cloud/models/html5_export_options.rb +2 -3
  40. data/lib/aspose_slides_cloud/models/html_export_options.rb +2 -3
  41. data/lib/aspose_slides_cloud/models/image_export_options.rb +4 -3
  42. data/lib/aspose_slides_cloud/models/image_export_options_base.rb +222 -0
  43. data/lib/aspose_slides_cloud/models/image_transform_effect.rb +244 -0
  44. data/lib/aspose_slides_cloud/models/legend.rb +12 -2
  45. data/lib/aspose_slides_cloud/models/luminance_effect.rb +253 -0
  46. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +72 -3
  47. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +12 -2
  48. data/lib/aspose_slides_cloud/models/one_value_series.rb +74 -2
  49. data/lib/aspose_slides_cloud/models/paragraph.rb +12 -2
  50. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +3 -16
  51. data/lib/aspose_slides_cloud/models/picture_fill.rb +14 -2
  52. data/lib/aspose_slides_cloud/models/picture_frame.rb +1 -2
  53. data/lib/aspose_slides_cloud/models/portion.rb +32 -2
  54. data/lib/aspose_slides_cloud/models/portion_format.rb +633 -0
  55. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +2 -3
  56. data/lib/aspose_slides_cloud/models/resource_uri.rb +22 -2
  57. data/lib/aspose_slides_cloud/models/section_zoom_frame.rb +1 -2
  58. data/lib/aspose_slides_cloud/models/shape.rb +1 -2
  59. data/lib/aspose_slides_cloud/models/shape_base.rb +1 -11
  60. data/lib/aspose_slides_cloud/models/shape_type.rb +54 -0
  61. data/lib/aspose_slides_cloud/models/slide_comment.rb +32 -48
  62. data/lib/aspose_slides_cloud/models/slide_comment_base.rb +286 -0
  63. data/lib/aspose_slides_cloud/models/slide_comments.rb +1 -1
  64. data/lib/aspose_slides_cloud/models/{box_and_whisker_series.rb → slide_modern_comment.rb} +37 -68
  65. data/lib/aspose_slides_cloud/models/smart_art.rb +1 -2
  66. data/lib/aspose_slides_cloud/models/smart_art_node.rb +12 -2
  67. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +1 -2
  68. data/lib/aspose_slides_cloud/models/summary_zoom_frame.rb +1 -2
  69. data/lib/aspose_slides_cloud/models/summary_zoom_section.rb +1 -2
  70. data/lib/aspose_slides_cloud/models/svg_export_options.rb +2 -3
  71. data/lib/aspose_slides_cloud/models/swf_export_options.rb +2 -3
  72. data/lib/aspose_slides_cloud/models/table.rb +1 -2
  73. data/lib/aspose_slides_cloud/models/table_cell.rb +22 -2
  74. data/lib/aspose_slides_cloud/models/text_bounds.rb +261 -0
  75. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +4 -3
  76. data/lib/aspose_slides_cloud/models/tint_effect.rb +253 -0
  77. data/lib/aspose_slides_cloud/models/video_export_options.rb +35 -4
  78. data/lib/aspose_slides_cloud/models/video_frame.rb +12 -3
  79. data/lib/aspose_slides_cloud/models/xaml_export_options.rb +2 -3
  80. data/lib/aspose_slides_cloud/models/xps_export_options.rb +2 -3
  81. data/lib/aspose_slides_cloud/models/zoom_frame.rb +1 -2
  82. data/lib/aspose_slides_cloud/models/zoom_object.rb +2 -2
  83. data/lib/aspose_slides_cloud/type_registry.rb +54 -13
  84. data/lib/aspose_slides_cloud/version.rb +1 -1
  85. data/lib/aspose_slides_cloud.rb +31 -7
  86. data/spec/api/slides_api_spec.rb +585 -33
  87. data/spec/spec_helper.rb +122 -122
  88. data/spec/use_cases/merge_spec.rb +0 -1
  89. data/spec/use_cases/shape_spec.rb +0 -2
  90. data/testRules.json +6 -4
  91. metadata +30 -7
  92. data/Dockerfile +0 -16
  93. data/docker-entrypoint.sh +0 -7
@@ -0,0 +1,243 @@
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 a Duotone effect.
27
+ class DuotoneEffect < ImageTransformEffect
28
+ # Returns target color format for dark pixels.
29
+ attr_accessor :color1
30
+
31
+ # Returns target color format for light pixels.
32
+ attr_accessor :color2
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ super.merge({
59
+ :'color1' => :'Color1',
60
+ :'color2' => :'Color2',
61
+ })
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ super.merge({
67
+ :'color1' => :'String',
68
+ :'color2' => :'String',
69
+ })
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ super
76
+
77
+ if attributes.has_key?(:'Color1')
78
+ self.color1 = attributes[:'Color1']
79
+ end
80
+
81
+ if attributes.has_key?(:'Color2')
82
+ self.color2 = attributes[:'Color2']
83
+ end
84
+ self.type = "Duotone"
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = super
91
+ 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
+ return false if !super
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ type == o.type &&
107
+ color1 == o.color1 &&
108
+ color2 == o.color2
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [type, color1, color2].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+ mapKey = self.class.attribute_map[key]
130
+ if !mapKey.nil?
131
+ val = attributes[mapKey]
132
+ if val.nil?
133
+ mapKeyString = mapKey.to_s
134
+ mapKeyString[0] = mapKeyString[0].downcase
135
+ mapKey = mapKeyString.to_sym
136
+ val = attributes[mapKey]
137
+ end
138
+ if !val.nil?
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if val.is_a?(Array)
143
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
144
+ end
145
+ else
146
+ self.send("#{key}=", _deserialize(type, val))
147
+ end
148
+ end
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :DateTime
162
+ DateTime.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :BOOLEAN
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
193
+ if registry_type
194
+ type = registry_type
195
+ end
196
+ temp_model = AsposeSlidesCloud.const_get(type).new
197
+ temp_model.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ next if value.nil?
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+ end
243
+ end
@@ -28,11 +28,8 @@ module AsposeSlidesCloud
28
28
  # Default regular font for rendering the presentation.
29
29
  attr_accessor :default_regular_font
30
30
 
31
- # Gets or sets the height of slides in the output format, e.g. image size, pdf page size etc.
32
- attr_accessor :height
33
-
34
- # Gets or sets the height of slides in the output format, e.g. image size, pdf page size etc.
35
- attr_accessor :width
31
+ # Gets of sets list of font fallback rules.
32
+ attr_accessor :font_fallback_rules
36
33
 
37
34
  attr_accessor :format
38
35
 
@@ -40,8 +37,7 @@ module AsposeSlidesCloud
40
37
  def self.attribute_map
41
38
  {
42
39
  :'default_regular_font' => :'DefaultRegularFont',
43
- :'height' => :'Height',
44
- :'width' => :'Width',
40
+ :'font_fallback_rules' => :'FontFallbackRules',
45
41
  :'format' => :'Format',
46
42
  }
47
43
  end
@@ -50,8 +46,7 @@ module AsposeSlidesCloud
50
46
  def self.swagger_types
51
47
  {
52
48
  :'default_regular_font' => :'String',
53
- :'height' => :'Integer',
54
- :'width' => :'Integer',
49
+ :'font_fallback_rules' => :'Array<FontFallbackRule>',
55
50
  :'format' => :'String',
56
51
  }
57
52
  end
@@ -68,12 +63,10 @@ module AsposeSlidesCloud
68
63
  self.default_regular_font = attributes[:'DefaultRegularFont']
69
64
  end
70
65
 
71
- if attributes.has_key?(:'Height')
72
- self.height = attributes[:'Height']
73
- end
74
-
75
- if attributes.has_key?(:'Width')
76
- self.width = attributes[:'Width']
66
+ if attributes.has_key?(:'FontFallbackRules')
67
+ if (value = attributes[:'FontFallbackRules']).is_a?(Array)
68
+ self.font_fallback_rules = value
69
+ end
77
70
  end
78
71
 
79
72
  if attributes.has_key?(:'Format')
@@ -100,8 +93,7 @@ module AsposeSlidesCloud
100
93
  return true if self.equal?(o)
101
94
  self.class == o.class &&
102
95
  default_regular_font == o.default_regular_font &&
103
- height == o.height &&
104
- width == o.width &&
96
+ font_fallback_rules == o.font_fallback_rules &&
105
97
  format == o.format
106
98
  end
107
99
 
@@ -114,7 +106,7 @@ module AsposeSlidesCloud
114
106
  # Calculates hash code according to all attributes.
115
107
  # @return [Fixnum] Hash code
116
108
  def hash
117
- [default_regular_font, height, width, format].hash
109
+ [default_regular_font, font_fallback_rules, format].hash
118
110
  end
119
111
 
120
112
  # Builds the object from hash
@@ -0,0 +1,260 @@
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 a Fill Overlay effect. A fill overlay may be used to specify an additional fill for an object and blend the two fills together.
27
+ class FillOverlayImageEffect < ImageTransformEffect
28
+ # FillBlendMode.
29
+ attr_accessor :blend
30
+
31
+ # Fill format.
32
+ attr_accessor :fill_format
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ super.merge({
59
+ :'blend' => :'Blend',
60
+ :'fill_format' => :'FillFormat',
61
+ })
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ super.merge({
67
+ :'blend' => :'String',
68
+ :'fill_format' => :'FillFormat',
69
+ })
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ super
76
+
77
+ if attributes.has_key?(:'Blend')
78
+ self.blend = attributes[:'Blend']
79
+ end
80
+
81
+ if attributes.has_key?(:'FillFormat')
82
+ self.fill_format = attributes[:'FillFormat']
83
+ end
84
+ self.type = "FillOverlay"
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = super
91
+ if @blend.nil?
92
+ invalid_properties.push('invalid value for "blend", blend cannot be nil.')
93
+ end
94
+
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ return false if !super
102
+ return false if @blend.nil?
103
+ blend_validator = EnumAttributeValidator.new('String', ['Darken', 'Lighten', 'Multiply', 'Overlay', 'Screen'])
104
+ return false unless blend_validator.valid?(@blend)
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method checking allowed values (enum).
109
+ # @param [Object] blend Object to be assigned
110
+ def blend=(blend)
111
+ validator = EnumAttributeValidator.new('String', ['Darken', 'Lighten', 'Multiply', 'Overlay', 'Screen'])
112
+ unless validator.valid?(blend)
113
+ fail ArgumentError, 'invalid value for "blend", must be one of #{validator.allowable_values}.'
114
+ end
115
+ @blend = blend
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ type == o.type &&
124
+ blend == o.blend &&
125
+ fill_format == o.fill_format
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [type, blend, fill_format].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.swagger_types.each_pair do |key, type|
146
+ mapKey = self.class.attribute_map[key]
147
+ if !mapKey.nil?
148
+ val = attributes[mapKey]
149
+ if val.nil?
150
+ mapKeyString = mapKey.to_s
151
+ mapKeyString[0] = mapKeyString[0].downcase
152
+ mapKey = mapKeyString.to_sym
153
+ val = attributes[mapKey]
154
+ end
155
+ if !val.nil?
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the the attribute
158
+ # is documented as an array but the input is not
159
+ if val.is_a?(Array)
160
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
161
+ end
162
+ else
163
+ self.send("#{key}=", _deserialize(type, val))
164
+ end
165
+ end
166
+ end
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :BOOLEAN
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
210
+ if registry_type
211
+ type = registry_type
212
+ end
213
+ temp_model = AsposeSlidesCloud.const_get(type).new
214
+ temp_model.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ next if value.nil?
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+ end
260
+ end