aspose_slides_cloud 19.12.0 → 20.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/aspose_slides_cloud.rb +8 -0
  4. data/lib/aspose_slides_cloud/api/slides_api.rb +2156 -525
  5. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +792 -124
  6. data/lib/aspose_slides_cloud/api_client.rb +7 -3
  7. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +20 -8
  8. data/lib/aspose_slides_cloud/models/add_master_slide.rb +20 -8
  9. data/lib/aspose_slides_cloud/models/add_shape.rb +20 -8
  10. data/lib/aspose_slides_cloud/models/add_slide.rb +20 -8
  11. data/lib/aspose_slides_cloud/models/api_info.rb +20 -8
  12. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +20 -23
  13. data/lib/aspose_slides_cloud/models/audio_frame.rb +20 -8
  14. data/lib/aspose_slides_cloud/models/axes.rb +20 -8
  15. data/lib/aspose_slides_cloud/models/axis.rb +20 -168
  16. data/lib/aspose_slides_cloud/models/base64_input_file.rb +20 -8
  17. data/lib/aspose_slides_cloud/models/blur_effect.rb +20 -8
  18. data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +504 -0
  19. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +20 -8
  20. data/lib/aspose_slides_cloud/models/bubble_series.rb +24 -45
  21. data/lib/aspose_slides_cloud/models/chart.rb +23 -11
  22. data/lib/aspose_slides_cloud/models/chart_category.rb +249 -0
  23. data/lib/aspose_slides_cloud/models/chart_title.rb +20 -8
  24. data/lib/aspose_slides_cloud/models/chart_wall.rb +20 -18
  25. data/lib/aspose_slides_cloud/models/color_scheme.rb +20 -8
  26. data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +217 -0
  27. data/lib/aspose_slides_cloud/models/connector.rb +20 -8
  28. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +20 -8
  29. data/lib/aspose_slides_cloud/models/disc_usage.rb +20 -8
  30. data/lib/aspose_slides_cloud/models/document.rb +31 -9
  31. data/lib/aspose_slides_cloud/models/document_properties.rb +20 -8
  32. data/lib/aspose_slides_cloud/models/document_property.rb +20 -8
  33. data/lib/aspose_slides_cloud/models/document_replace_result.rb +31 -9
  34. data/lib/aspose_slides_cloud/models/effect.rb +20 -8
  35. data/lib/aspose_slides_cloud/models/effect_format.rb +20 -8
  36. data/lib/aspose_slides_cloud/models/entity_exists.rb +212 -0
  37. data/lib/aspose_slides_cloud/models/error.rb +20 -8
  38. data/lib/aspose_slides_cloud/models/error_details.rb +20 -8
  39. data/lib/aspose_slides_cloud/models/export_format.rb +1 -0
  40. data/lib/aspose_slides_cloud/models/export_options.rb +20 -8
  41. data/lib/aspose_slides_cloud/models/file_version.rb +20 -8
  42. data/lib/aspose_slides_cloud/models/file_versions.rb +20 -8
  43. data/lib/aspose_slides_cloud/models/files_list.rb +20 -8
  44. data/lib/aspose_slides_cloud/models/files_upload_result.rb +20 -8
  45. data/lib/aspose_slides_cloud/models/fill_format.rb +20 -8
  46. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +20 -8
  47. data/lib/aspose_slides_cloud/models/font_scheme.rb +20 -8
  48. data/lib/aspose_slides_cloud/models/font_set.rb +20 -8
  49. data/lib/aspose_slides_cloud/models/format_scheme.rb +20 -8
  50. data/lib/aspose_slides_cloud/models/geometry_shape.rb +20 -8
  51. data/lib/aspose_slides_cloud/models/glow_effect.rb +20 -8
  52. data/lib/aspose_slides_cloud/models/gradient_fill.rb +20 -8
  53. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +20 -8
  54. data/lib/aspose_slides_cloud/models/graphical_object.rb +20 -8
  55. data/lib/aspose_slides_cloud/models/group_shape.rb +20 -8
  56. data/lib/aspose_slides_cloud/models/html_export_options.rb +20 -8
  57. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +20 -8
  58. data/lib/aspose_slides_cloud/models/image.rb +20 -8
  59. data/lib/aspose_slides_cloud/models/image_export_options.rb +20 -8
  60. data/lib/aspose_slides_cloud/models/images.rb +20 -8
  61. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +20 -8
  62. data/lib/aspose_slides_cloud/models/input.rb +20 -8
  63. data/lib/aspose_slides_cloud/models/input_file.rb +20 -8
  64. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +20 -8
  65. data/lib/aspose_slides_cloud/models/layout_slide.rb +20 -8
  66. data/lib/aspose_slides_cloud/models/layout_slides.rb +20 -8
  67. data/lib/aspose_slides_cloud/models/legend.rb +20 -38
  68. data/lib/aspose_slides_cloud/models/line_format.rb +20 -43
  69. data/lib/aspose_slides_cloud/models/master_slide.rb +20 -8
  70. data/lib/aspose_slides_cloud/models/master_slides.rb +20 -8
  71. data/lib/aspose_slides_cloud/models/merge.rb +20 -8
  72. data/lib/aspose_slides_cloud/models/merging_source.rb +20 -8
  73. data/lib/aspose_slides_cloud/models/no_fill.rb +20 -8
  74. data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +217 -0
  75. data/lib/aspose_slides_cloud/models/notes_slide.rb +20 -8
  76. data/lib/aspose_slides_cloud/models/object_exist.rb +20 -8
  77. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +20 -8
  78. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +20 -8
  79. data/lib/aspose_slides_cloud/models/one_value_series.rb +24 -45
  80. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +20 -8
  81. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +20 -8
  82. data/lib/aspose_slides_cloud/models/output_file.rb +20 -8
  83. data/lib/aspose_slides_cloud/models/paragraph.rb +21 -9
  84. data/lib/aspose_slides_cloud/models/paragraphs.rb +20 -8
  85. data/lib/aspose_slides_cloud/models/path_input_file.rb +20 -8
  86. data/lib/aspose_slides_cloud/models/path_output_file.rb +20 -8
  87. data/lib/aspose_slides_cloud/models/pattern_fill.rb +20 -8
  88. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +53 -14
  89. data/lib/aspose_slides_cloud/models/picture_fill.rb +20 -8
  90. data/lib/aspose_slides_cloud/models/picture_frame.rb +20 -8
  91. data/lib/aspose_slides_cloud/models/pipeline.rb +20 -8
  92. data/lib/aspose_slides_cloud/models/placeholder.rb +20 -8
  93. data/lib/aspose_slides_cloud/models/placeholders.rb +20 -8
  94. data/lib/aspose_slides_cloud/models/plot_area.rb +20 -33
  95. data/lib/aspose_slides_cloud/models/portion.rb +20 -8
  96. data/lib/aspose_slides_cloud/models/portions.rb +28 -16
  97. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +20 -8
  98. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +20 -8
  99. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +20 -8
  100. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +20 -8
  101. data/lib/aspose_slides_cloud/models/reflection_effect.rb +20 -8
  102. data/lib/aspose_slides_cloud/models/remove_shape.rb +20 -8
  103. data/lib/aspose_slides_cloud/models/remove_slide.rb +20 -8
  104. data/lib/aspose_slides_cloud/models/reorder_slide.rb +20 -8
  105. data/lib/aspose_slides_cloud/models/replace_text.rb +20 -8
  106. data/lib/aspose_slides_cloud/models/request_input_file.rb +20 -8
  107. data/lib/aspose_slides_cloud/models/reset_slide.rb +20 -8
  108. data/lib/aspose_slides_cloud/models/resource_base.rb +20 -8
  109. data/lib/aspose_slides_cloud/models/resource_uri.rb +20 -8
  110. data/lib/aspose_slides_cloud/models/resource_uri_element.rb +20 -8
  111. data/lib/aspose_slides_cloud/models/response_output_file.rb +20 -8
  112. data/lib/aspose_slides_cloud/models/save.rb +22 -10
  113. data/lib/aspose_slides_cloud/models/save_shape.rb +20 -8
  114. data/lib/aspose_slides_cloud/models/save_slide.rb +22 -10
  115. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +20 -8
  116. data/lib/aspose_slides_cloud/models/scatter_series.rb +24 -45
  117. data/lib/aspose_slides_cloud/models/series.rb +47 -49
  118. data/lib/aspose_slides_cloud/models/series_marker.rb +20 -18
  119. data/lib/aspose_slides_cloud/models/shape.rb +20 -8
  120. data/lib/aspose_slides_cloud/models/shape_base.rb +20 -8
  121. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +20 -8
  122. data/lib/aspose_slides_cloud/models/shapes.rb +20 -8
  123. data/lib/aspose_slides_cloud/models/slide.rb +20 -8
  124. data/lib/aspose_slides_cloud/models/slide_animation.rb +20 -8
  125. data/lib/aspose_slides_cloud/models/slide_background.rb +20 -8
  126. data/lib/aspose_slides_cloud/models/slide_comment.rb +20 -8
  127. data/lib/aspose_slides_cloud/models/slide_comments.rb +20 -8
  128. data/lib/aspose_slides_cloud/models/slide_export_format.rb +1 -0
  129. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +20 -8
  130. data/lib/aspose_slides_cloud/models/slides.rb +20 -8
  131. data/lib/aspose_slides_cloud/models/smart_art.rb +20 -8
  132. data/lib/aspose_slides_cloud/models/smart_art_node.rb +20 -8
  133. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +20 -8
  134. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +20 -8
  135. data/lib/aspose_slides_cloud/models/solid_fill.rb +20 -8
  136. data/lib/aspose_slides_cloud/models/split_document_result.rb +20 -8
  137. data/lib/aspose_slides_cloud/models/storage_exist.rb +20 -8
  138. data/lib/aspose_slides_cloud/models/storage_file.rb +20 -8
  139. data/lib/aspose_slides_cloud/models/svg_export_options.rb +20 -8
  140. data/lib/aspose_slides_cloud/models/swf_export_options.rb +20 -8
  141. data/lib/aspose_slides_cloud/models/table.rb +20 -48
  142. data/lib/aspose_slides_cloud/models/table_cell.rb +20 -48
  143. data/lib/aspose_slides_cloud/models/table_column.rb +20 -8
  144. data/lib/aspose_slides_cloud/models/table_row.rb +20 -8
  145. data/lib/aspose_slides_cloud/models/task.rb +20 -8
  146. data/lib/aspose_slides_cloud/models/text_item.rb +20 -8
  147. data/lib/aspose_slides_cloud/models/text_items.rb +20 -8
  148. data/lib/aspose_slides_cloud/models/theme.rb +20 -8
  149. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +20 -8
  150. data/lib/aspose_slides_cloud/models/update_background.rb +20 -8
  151. data/lib/aspose_slides_cloud/models/update_shape.rb +20 -8
  152. data/lib/aspose_slides_cloud/models/video_frame.rb +20 -8
  153. data/lib/aspose_slides_cloud/models/view_properties.rb +379 -0
  154. data/lib/aspose_slides_cloud/models/waterfall_series.rb +452 -0
  155. data/lib/aspose_slides_cloud/models/xps_export_options.rb +20 -8
  156. data/lib/aspose_slides_cloud/version.rb +1 -1
  157. data/spec/api/slides_api_spec.rb +17214 -12046
  158. data/spec/extra/extra_spec.rb +111 -9
  159. data/spec/spec_utils.rb +8 -1
  160. data/testRules.json +80 -8
  161. metadata +9 -2
@@ -109,15 +109,27 @@ module AsposeSlidesCloud
109
109
  def build_from_hash(attributes)
110
110
  return nil unless attributes.is_a?(Hash)
111
111
  self.class.swagger_types.each_pair do |key, type|
112
- if type =~ /\AArray<(.*)>/i
113
- # check to ensure the input is an array given that the the attribute
114
- # is documented as an array but the input is not
115
- if attributes[self.class.attribute_map[key]].is_a?(Array)
116
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ mapKey = self.class.attribute_map[key]
113
+ if !mapKey.nil?
114
+ val = attributes[mapKey]
115
+ if val.nil?
116
+ mapKeyString = mapKey.to_s
117
+ mapKeyString[0] = mapKeyString[0].downcase
118
+ mapKey = mapKeyString.to_sym
119
+ val = attributes[mapKey]
117
120
  end
118
- elsif !attributes[self.class.attribute_map[key]].nil?
119
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
- end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ if !val.nil?
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the the attribute
124
+ # is documented as an array but the input is not
125
+ if val.is_a?(Array)
126
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
127
+ end
128
+ else
129
+ self.send("#{key}=", _deserialize(type, val))
130
+ end
131
+ end
132
+ end
121
133
  end
122
134
 
123
135
  self
@@ -117,22 +117,12 @@ module AsposeSlidesCloud
117
117
  # @return Array for valid properties with the reasons
118
118
  def list_invalid_properties
119
119
  invalid_properties = Array.new
120
- if @thickness.nil?
121
- invalid_properties.push('invalid value for "thickness", thickness cannot be nil.')
122
- end
123
-
124
- if @picture_type.nil?
125
- invalid_properties.push('invalid value for "picture_type", picture_type cannot be nil.')
126
- end
127
-
128
120
  invalid_properties
129
121
  end
130
122
 
131
123
  # Check to see if the all the properties in the model are valid
132
124
  # @return true if the model is valid
133
125
  def valid?
134
- return false if @thickness.nil?
135
- return false if @picture_type.nil?
136
126
  picture_type_validator = EnumAttributeValidator.new('String', ['Stack', 'StackScale', 'Stretch', 'NotDefined'])
137
127
  return false unless picture_type_validator.valid?(@picture_type)
138
128
  true
@@ -178,15 +168,27 @@ module AsposeSlidesCloud
178
168
  def build_from_hash(attributes)
179
169
  return nil unless attributes.is_a?(Hash)
180
170
  self.class.swagger_types.each_pair do |key, type|
181
- if type =~ /\AArray<(.*)>/i
182
- # check to ensure the input is an array given that the the attribute
183
- # is documented as an array but the input is not
184
- if attributes[self.class.attribute_map[key]].is_a?(Array)
185
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
171
+ mapKey = self.class.attribute_map[key]
172
+ if !mapKey.nil?
173
+ val = attributes[mapKey]
174
+ if val.nil?
175
+ mapKeyString = mapKey.to_s
176
+ mapKeyString[0] = mapKeyString[0].downcase
177
+ mapKey = mapKeyString.to_sym
178
+ val = attributes[mapKey]
179
+ end
180
+ if !val.nil?
181
+ if type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the the attribute
183
+ # is documented as an array but the input is not
184
+ if val.is_a?(Array)
185
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
186
+ end
187
+ else
188
+ self.send("#{key}=", _deserialize(type, val))
189
+ end
186
190
  end
187
- elsif !attributes[self.class.attribute_map[key]].nil?
188
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
189
- end # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ end
190
192
  end
191
193
 
192
194
  self
@@ -226,15 +226,27 @@ module AsposeSlidesCloud
226
226
  def build_from_hash(attributes)
227
227
  return nil unless attributes.is_a?(Hash)
228
228
  self.class.swagger_types.each_pair do |key, type|
229
- if type =~ /\AArray<(.*)>/i
230
- # check to ensure the input is an array given that the the attribute
231
- # is documented as an array but the input is not
232
- if attributes[self.class.attribute_map[key]].is_a?(Array)
233
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
229
+ mapKey = self.class.attribute_map[key]
230
+ if !mapKey.nil?
231
+ val = attributes[mapKey]
232
+ if val.nil?
233
+ mapKeyString = mapKey.to_s
234
+ mapKeyString[0] = mapKeyString[0].downcase
235
+ mapKey = mapKeyString.to_sym
236
+ val = attributes[mapKey]
234
237
  end
235
- elsif !attributes[self.class.attribute_map[key]].nil?
236
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
237
- end # or else data not found in attributes(hash), not an issue as the data can be optional
238
+ if !val.nil?
239
+ if type =~ /\AArray<(.*)>/i
240
+ # check to ensure the input is an array given that the the attribute
241
+ # is documented as an array but the input is not
242
+ if val.is_a?(Array)
243
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
244
+ end
245
+ else
246
+ self.send("#{key}=", _deserialize(type, val))
247
+ end
248
+ end
249
+ end
238
250
  end
239
251
 
240
252
  self
@@ -0,0 +1,217 @@
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
+ # Slide view properties.
27
+ class CommonSlideViewProperties
28
+ # The view scaling ratio (percentage).
29
+ attr_accessor :scale
30
+
31
+ # True if the view content should automatically scale to best fit the current window size.
32
+ attr_accessor :variable_scale
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'scale' => :'Scale',
38
+ :'variable_scale' => :'VariableScale'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'scale' => :'Integer',
46
+ :'variable_scale' => :'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?(:'Scale')
59
+ self.scale = attributes[:'Scale']
60
+ end
61
+
62
+ if attributes.has_key?(:'VariableScale')
63
+ self.variable_scale = attributes[:'VariableScale']
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
+ scale == o.scale &&
86
+ variable_scale == o.variable_scale
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
+ [scale, variable_scale].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
+ temp_model = AsposeSlidesCloud.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+ end
217
+ end
@@ -386,15 +386,27 @@ module AsposeSlidesCloud
386
386
  def build_from_hash(attributes)
387
387
  return nil unless attributes.is_a?(Hash)
388
388
  self.class.swagger_types.each_pair do |key, type|
389
- if type =~ /\AArray<(.*)>/i
390
- # check to ensure the input is an array given that the the attribute
391
- # is documented as an array but the input is not
392
- if attributes[self.class.attribute_map[key]].is_a?(Array)
393
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
389
+ mapKey = self.class.attribute_map[key]
390
+ if !mapKey.nil?
391
+ val = attributes[mapKey]
392
+ if val.nil?
393
+ mapKeyString = mapKey.to_s
394
+ mapKeyString[0] = mapKeyString[0].downcase
395
+ mapKey = mapKeyString.to_sym
396
+ val = attributes[mapKey]
394
397
  end
395
- elsif !attributes[self.class.attribute_map[key]].nil?
396
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
397
- end # or else data not found in attributes(hash), not an issue as the data can be optional
398
+ if !val.nil?
399
+ if type =~ /\AArray<(.*)>/i
400
+ # check to ensure the input is an array given that the the attribute
401
+ # is documented as an array but the input is not
402
+ if val.is_a?(Array)
403
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
404
+ end
405
+ else
406
+ self.send("#{key}=", _deserialize(type, val))
407
+ end
408
+ end
409
+ end
398
410
  end
399
411
 
400
412
  self
@@ -96,15 +96,27 @@ module AsposeSlidesCloud
96
96
  def build_from_hash(attributes)
97
97
  return nil unless attributes.is_a?(Hash)
98
98
  self.class.swagger_types.each_pair do |key, type|
99
- if type =~ /\AArray<(.*)>/i
100
- # check to ensure the input is an array given that the the attribute
101
- # is documented as an array but the input is not
102
- if attributes[self.class.attribute_map[key]].is_a?(Array)
103
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ mapKey = self.class.attribute_map[key]
100
+ if !mapKey.nil?
101
+ val = attributes[mapKey]
102
+ if val.nil?
103
+ mapKeyString = mapKey.to_s
104
+ mapKeyString[0] = mapKeyString[0].downcase
105
+ mapKey = mapKeyString.to_sym
106
+ val = attributes[mapKey]
104
107
  end
105
- elsif !attributes[self.class.attribute_map[key]].nil?
106
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
- end # or else data not found in attributes(hash), not an issue as the data can be optional
108
+ if !val.nil?
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the the attribute
111
+ # is documented as an array but the input is not
112
+ if val.is_a?(Array)
113
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
114
+ end
115
+ else
116
+ self.send("#{key}=", _deserialize(type, val))
117
+ end
118
+ end
119
+ end
108
120
  end
109
121
 
110
122
  self
@@ -114,15 +114,27 @@ module AsposeSlidesCloud
114
114
  def build_from_hash(attributes)
115
115
  return nil unless attributes.is_a?(Hash)
116
116
  self.class.swagger_types.each_pair do |key, type|
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 attributes[self.class.attribute_map[key]].is_a?(Array)
121
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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]
122
125
  end
123
- elsif !attributes[self.class.attribute_map[key]].nil?
124
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
- end # or else data not found in attributes(hash), not an issue as the data can be optional
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
126
138
  end
127
139
 
128
140
  self