aspose_slides_cloud 1.0.3 → 19.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE +2 -3
  5. data/README.md +7 -39
  6. data/Rakefile +8 -0
  7. data/TestData/TemplateCV.pptx +0 -0
  8. data/TestData/TemplatingCVDataWithBase64.xml +23 -0
  9. data/TestData/placeholders.pptx +0 -0
  10. data/TestData/test-unprotected.ppt +0 -0
  11. data/TestData/test.ppt +0 -0
  12. data/aspose_slides_cloud.gemspec +42 -14
  13. data/lib/aspose_slides_cloud.rb +183 -78
  14. data/lib/aspose_slides_cloud/api/slides_api.rb +6906 -2256
  15. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +3067 -0
  16. data/lib/aspose_slides_cloud/api_client.rb +273 -183
  17. data/lib/aspose_slides_cloud/api_error.rb +29 -5
  18. data/lib/aspose_slides_cloud/configuration.rb +93 -81
  19. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +261 -0
  20. data/lib/aspose_slides_cloud/models/add_master_slide.rb +276 -0
  21. data/lib/aspose_slides_cloud/models/add_shape.rb +256 -0
  22. data/lib/aspose_slides_cloud/models/add_slide.rb +286 -0
  23. data/lib/aspose_slides_cloud/models/api_info.rb +205 -0
  24. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +257 -22
  25. data/lib/aspose_slides_cloud/models/audio_frame.rb +573 -0
  26. data/lib/aspose_slides_cloud/models/axes.rb +225 -0
  27. data/lib/aspose_slides_cloud/models/axis.rb +847 -0
  28. data/lib/aspose_slides_cloud/models/base64_input_file.rb +256 -0
  29. data/lib/aspose_slides_cloud/models/blur_effect.rb +215 -0
  30. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +230 -0
  31. data/lib/aspose_slides_cloud/models/bubble_series.rb +463 -0
  32. data/lib/aspose_slides_cloud/models/chart.rb +543 -0
  33. data/lib/aspose_slides_cloud/models/chart_title.rb +210 -0
  34. data/lib/aspose_slides_cloud/models/chart_wall.rb +279 -0
  35. data/lib/aspose_slides_cloud/models/color_scheme.rb +258 -84
  36. data/lib/aspose_slides_cloud/models/connector.rb +487 -0
  37. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +171 -13
  38. data/lib/aspose_slides_cloud/models/disc_usage.rb +215 -0
  39. data/lib/aspose_slides_cloud/models/document.rb +222 -46
  40. data/lib/aspose_slides_cloud/models/document_properties.rb +188 -36
  41. data/lib/aspose_slides_cloud/models/document_property.rb +209 -48
  42. data/lib/aspose_slides_cloud/models/document_replace_result.rb +272 -0
  43. data/lib/aspose_slides_cloud/models/effect.rb +412 -0
  44. data/lib/aspose_slides_cloud/models/effect_format.rb +265 -0
  45. data/lib/aspose_slides_cloud/models/error.rb +225 -0
  46. data/lib/aspose_slides_cloud/models/error_details.rb +210 -0
  47. data/lib/aspose_slides_cloud/models/export_format.rb +59 -0
  48. data/lib/aspose_slides_cloud/models/export_options.rb +194 -0
  49. data/lib/aspose_slides_cloud/models/file_version.rb +270 -0
  50. data/lib/aspose_slides_cloud/models/file_versions.rb +197 -0
  51. data/lib/aspose_slides_cloud/models/files_list.rb +197 -0
  52. data/lib/aspose_slides_cloud/models/files_upload_result.rb +209 -0
  53. data/lib/aspose_slides_cloud/models/fill_format.rb +204 -13
  54. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +234 -0
  55. data/lib/aspose_slides_cloud/models/font_scheme.rb +204 -48
  56. data/lib/aspose_slides_cloud/models/font_set.rb +184 -22
  57. data/lib/aspose_slides_cloud/models/format_scheme.rb +210 -52
  58. data/lib/aspose_slides_cloud/models/geometry_shape.rb +439 -0
  59. data/lib/aspose_slides_cloud/models/glow_effect.rb +210 -0
  60. data/lib/aspose_slides_cloud/models/gradient_fill.rb +359 -0
  61. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +210 -0
  62. data/lib/aspose_slides_cloud/models/graphical_object.rb +422 -0
  63. data/lib/aspose_slides_cloud/models/group_shape.rb +422 -0
  64. data/lib/aspose_slides_cloud/models/html_export_options.rb +392 -25
  65. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +195 -0
  66. data/lib/aspose_slides_cloud/models/image.rb +216 -42
  67. data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -0
  68. data/lib/aspose_slides_cloud/models/image_export_options.rb +298 -0
  69. data/lib/aspose_slides_cloud/models/images.rb +188 -36
  70. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +240 -0
  71. data/lib/aspose_slides_cloud/models/input.rb +215 -0
  72. data/lib/aspose_slides_cloud/models/input_file.rb +238 -0
  73. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +212 -0
  74. data/lib/aspose_slides_cloud/models/layout_slide.rb +288 -0
  75. data/lib/aspose_slides_cloud/models/layout_slides.rb +219 -0
  76. data/lib/aspose_slides_cloud/models/legend.rb +339 -0
  77. data/lib/aspose_slides_cloud/models/line_format.rb +349 -54
  78. data/lib/aspose_slides_cloud/models/master_slide.rb +241 -0
  79. data/lib/aspose_slides_cloud/models/master_slides.rb +219 -0
  80. data/lib/aspose_slides_cloud/models/merge.rb +248 -0
  81. data/lib/aspose_slides_cloud/models/merging_source.rb +207 -0
  82. data/lib/aspose_slides_cloud/models/no_fill.rb +236 -0
  83. data/lib/aspose_slides_cloud/models/notes_slide.rb +227 -0
  84. data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -0
  85. data/lib/aspose_slides_cloud/models/object_exist.rb +215 -0
  86. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +447 -0
  87. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +200 -0
  88. data/lib/aspose_slides_cloud/models/one_value_series.rb +463 -0
  89. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +171 -13
  90. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +240 -0
  91. data/lib/aspose_slides_cloud/models/output_file.rb +228 -0
  92. data/lib/aspose_slides_cloud/models/paragraph.rb +494 -34
  93. data/lib/aspose_slides_cloud/models/paragraphs.rb +187 -35
  94. data/lib/aspose_slides_cloud/models/path_input_file.rb +266 -0
  95. data/lib/aspose_slides_cloud/models/path_output_file.rb +256 -0
  96. data/lib/aspose_slides_cloud/models/pattern_fill.rb +283 -0
  97. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +467 -49
  98. data/lib/aspose_slides_cloud/models/picture_fill.rb +368 -0
  99. data/lib/aspose_slides_cloud/models/picture_frame.rb +459 -0
  100. data/lib/aspose_slides_cloud/models/pipeline.rb +207 -0
  101. data/lib/aspose_slides_cloud/models/placeholder.rb +294 -56
  102. data/lib/aspose_slides_cloud/models/placeholders.rb +188 -36
  103. data/lib/aspose_slides_cloud/models/plot_area.rb +324 -0
  104. data/lib/aspose_slides_cloud/models/portion.rb +564 -46
  105. data/lib/aspose_slides_cloud/models/portions.rb +219 -0
  106. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +246 -0
  107. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +188 -18
  108. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +185 -15
  109. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +274 -0
  110. data/lib/aspose_slides_cloud/models/reflection_effect.rb +429 -0
  111. data/lib/aspose_slides_cloud/models/remove_shape.rb +246 -0
  112. data/lib/aspose_slides_cloud/models/remove_slide.rb +251 -0
  113. data/lib/aspose_slides_cloud/models/reorder_slide.rb +266 -0
  114. data/lib/aspose_slides_cloud/models/replace_text.rb +286 -0
  115. data/lib/aspose_slides_cloud/models/request_input_file.rb +261 -0
  116. data/lib/aspose_slides_cloud/models/reset_slide.rb +251 -0
  117. data/lib/aspose_slides_cloud/models/resource_base.rb +207 -0
  118. data/lib/aspose_slides_cloud/models/resource_uri.rb +190 -26
  119. data/lib/aspose_slides_cloud/models/resource_uri_element.rb +171 -13
  120. data/lib/aspose_slides_cloud/models/response_output_file.rb +236 -0
  121. data/lib/aspose_slides_cloud/models/save.rb +283 -0
  122. data/lib/aspose_slides_cloud/models/save_shape.rb +293 -0
  123. data/lib/aspose_slides_cloud/models/save_slide.rb +318 -0
  124. data/lib/aspose_slides_cloud/models/scale_type.rb +41 -0
  125. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +215 -0
  126. data/lib/aspose_slides_cloud/models/scatter_series.rb +463 -0
  127. data/lib/aspose_slides_cloud/models/series.rb +424 -0
  128. data/lib/aspose_slides_cloud/models/series_marker.rb +279 -0
  129. data/lib/aspose_slides_cloud/models/shape.rb +398 -100
  130. data/lib/aspose_slides_cloud/models/shape_base.rb +406 -0
  131. data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -0
  132. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +274 -0
  133. data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -0
  134. data/lib/aspose_slides_cloud/models/shapes.rb +219 -0
  135. data/lib/aspose_slides_cloud/models/size_type.rb +55 -0
  136. data/lib/aspose_slides_cloud/models/slide.rb +277 -66
  137. data/lib/aspose_slides_cloud/models/slide_animation.rb +231 -0
  138. data/lib/aspose_slides_cloud/models/slide_background.rb +245 -42
  139. data/lib/aspose_slides_cloud/models/slide_comment.rb +198 -24
  140. data/lib/aspose_slides_cloud/models/slide_comments.rb +188 -36
  141. data/lib/aspose_slides_cloud/models/slide_export_format.rb +58 -0
  142. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +347 -0
  143. data/lib/aspose_slides_cloud/models/slides.rb +188 -36
  144. data/lib/aspose_slides_cloud/models/smart_art.rb +530 -0
  145. data/lib/aspose_slides_cloud/models/smart_art_node.rb +281 -0
  146. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +422 -0
  147. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +200 -0
  148. data/lib/aspose_slides_cloud/models/solid_fill.rb +246 -0
  149. data/lib/aspose_slides_cloud/models/split_document_result.rb +188 -36
  150. data/lib/aspose_slides_cloud/models/storage_exist.rb +200 -0
  151. data/lib/aspose_slides_cloud/models/storage_file.rb +245 -0
  152. data/lib/aspose_slides_cloud/models/svg_export_options.rb +378 -0
  153. data/lib/aspose_slides_cloud/models/swf_export_options.rb +528 -0
  154. data/lib/aspose_slides_cloud/models/table.rb +578 -0
  155. data/lib/aspose_slides_cloud/models/table_cell.rb +431 -0
  156. data/lib/aspose_slides_cloud/models/table_column.rb +200 -0
  157. data/lib/aspose_slides_cloud/models/table_row.rb +227 -0
  158. data/lib/aspose_slides_cloud/models/task.rb +228 -0
  159. data/lib/aspose_slides_cloud/models/text_item.rb +178 -18
  160. data/lib/aspose_slides_cloud/models/text_items.rb +188 -36
  161. data/lib/aspose_slides_cloud/models/theme.rb +210 -52
  162. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +385 -40
  163. data/lib/aspose_slides_cloud/models/update_background.rb +258 -0
  164. data/lib/aspose_slides_cloud/models/update_shape.rb +256 -0
  165. data/lib/aspose_slides_cloud/models/video_frame.rb +543 -0
  166. data/lib/aspose_slides_cloud/models/xps_export_options.rb +242 -0
  167. data/lib/aspose_slides_cloud/version.rb +23 -1
  168. data/spec/api/slides_api_spec.rb +24188 -0
  169. data/spec/extra/extra_spec.rb +84 -0
  170. data/spec/spec_helper.rb +122 -0
  171. data/spec/spec_utils.rb +154 -0
  172. data/testConfig.json +7 -0
  173. data/testRules.json +333 -0
  174. metadata +273 -61
  175. data/lib/aspose_slides_cloud/models/base_object.rb +0 -86
  176. data/lib/aspose_slides_cloud/models/base_response.rb +0 -53
  177. data/lib/aspose_slides_cloud/models/color.rb +0 -29
  178. data/lib/aspose_slides_cloud/models/color_scheme_response.rb +0 -61
  179. data/lib/aspose_slides_cloud/models/common_response.rb +0 -53
  180. data/lib/aspose_slides_cloud/models/document_properties_response.rb +0 -61
  181. data/lib/aspose_slides_cloud/models/document_property_response.rb +0 -61
  182. data/lib/aspose_slides_cloud/models/document_response.rb +0 -61
  183. data/lib/aspose_slides_cloud/models/font_scheme_response.rb +0 -61
  184. data/lib/aspose_slides_cloud/models/format_scheme_response.rb +0 -61
  185. data/lib/aspose_slides_cloud/models/images_response.rb +0 -61
  186. data/lib/aspose_slides_cloud/models/new_shape_response.rb +0 -61
  187. data/lib/aspose_slides_cloud/models/paragraph_portion_response.rb +0 -61
  188. data/lib/aspose_slides_cloud/models/placeholder_response.rb +0 -61
  189. data/lib/aspose_slides_cloud/models/placeholders_response.rb +0 -61
  190. data/lib/aspose_slides_cloud/models/presentation_string_replace_response.rb +0 -69
  191. data/lib/aspose_slides_cloud/models/shape_list.rb +0 -67
  192. data/lib/aspose_slides_cloud/models/shape_paragraph_response.rb +0 -61
  193. data/lib/aspose_slides_cloud/models/shape_paragraphs_response.rb +0 -61
  194. data/lib/aspose_slides_cloud/models/shape_response.rb +0 -61
  195. data/lib/aspose_slides_cloud/models/slide_background_response.rb +0 -61
  196. data/lib/aspose_slides_cloud/models/slide_comments_response.rb +0 -61
  197. data/lib/aspose_slides_cloud/models/slide_list_response.rb +0 -61
  198. data/lib/aspose_slides_cloud/models/slide_response.rb +0 -61
  199. data/lib/aspose_slides_cloud/models/slide_string_replace_response.rb +0 -69
  200. data/lib/aspose_slides_cloud/models/split_document_response.rb +0 -61
  201. data/lib/aspose_slides_cloud/models/text_items_response.rb +0 -61
  202. data/lib/aspose_slides_cloud/models/theme_response.rb +0 -61
  203. data/test/slides_tests.rb +0 -580
@@ -0,0 +1,272 @@
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 document replace result DTO.
27
+ class DocumentReplaceResult
28
+ # Gets or sets the link to this resource.
29
+ attr_accessor :self_uri
30
+
31
+ # List of alternate links.
32
+ attr_accessor :alternate_links
33
+
34
+ # Link to Document properties.
35
+ attr_accessor :document_properties
36
+
37
+ # Link to slides collection.
38
+ attr_accessor :slides
39
+
40
+ # Link to images collection.
41
+ attr_accessor :images
42
+
43
+ # Link to layout slides collection.
44
+ attr_accessor :layout_slides
45
+
46
+ # Link to master slides collection.
47
+ attr_accessor :master_slides
48
+
49
+ # Gets or sets the number of matches
50
+ attr_accessor :matches
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'self_uri' => :'SelfUri',
56
+ :'alternate_links' => :'AlternateLinks',
57
+ :'document_properties' => :'DocumentProperties',
58
+ :'slides' => :'Slides',
59
+ :'images' => :'Images',
60
+ :'layout_slides' => :'LayoutSlides',
61
+ :'master_slides' => :'MasterSlides',
62
+ :'matches' => :'Matches'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'self_uri' => :'ResourceUri',
70
+ :'alternate_links' => :'Array<ResourceUri>',
71
+ :'document_properties' => :'ResourceUriElement',
72
+ :'slides' => :'ResourceUriElement',
73
+ :'images' => :'ResourceUriElement',
74
+ :'layout_slides' => :'ResourceUriElement',
75
+ :'master_slides' => :'ResourceUriElement',
76
+ :'matches' => :'Integer'
77
+ }
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ return unless attributes.is_a?(Hash)
84
+
85
+ # convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
87
+
88
+ if attributes.has_key?(:'SelfUri')
89
+ self.self_uri = attributes[:'SelfUri']
90
+ end
91
+
92
+ if attributes.has_key?(:'AlternateLinks')
93
+ if (value = attributes[:'AlternateLinks']).is_a?(Array)
94
+ self.alternate_links = value
95
+ end
96
+ end
97
+
98
+ if attributes.has_key?(:'DocumentProperties')
99
+ self.document_properties = attributes[:'DocumentProperties']
100
+ end
101
+
102
+ if attributes.has_key?(:'Slides')
103
+ self.slides = attributes[:'Slides']
104
+ end
105
+
106
+ if attributes.has_key?(:'Images')
107
+ self.images = attributes[:'Images']
108
+ end
109
+
110
+ if attributes.has_key?(:'LayoutSlides')
111
+ self.layout_slides = attributes[:'LayoutSlides']
112
+ end
113
+
114
+ if attributes.has_key?(:'MasterSlides')
115
+ self.master_slides = attributes[:'MasterSlides']
116
+ end
117
+
118
+ if attributes.has_key?(:'Matches')
119
+ self.matches = attributes[:'Matches']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ invalid_properties = Array.new
127
+ if @matches.nil?
128
+ invalid_properties.push('invalid value for "matches", matches cannot be nil.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ return false if @matches.nil?
138
+ true
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ self_uri == o.self_uri &&
147
+ alternate_links == o.alternate_links &&
148
+ document_properties == o.document_properties &&
149
+ slides == o.slides &&
150
+ images == o.images &&
151
+ layout_slides == o.layout_slides &&
152
+ master_slides == o.master_slides &&
153
+ matches == o.matches
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Fixnum] Hash code
164
+ def hash
165
+ [self_uri, alternate_links, document_properties, slides, images, layout_slides, master_slides, matches].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ self.class.swagger_types.each_pair do |key, type|
174
+ if type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
178
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
179
+ end
180
+ elsif !attributes[self.class.attribute_map[key]].nil?
181
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
182
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
183
+ end
184
+
185
+ self
186
+ end
187
+
188
+ # Deserializes the data based on type
189
+ # @param string type Data type
190
+ # @param string value Value to be deserialized
191
+ # @return [Object] Deserialized data
192
+ def _deserialize(type, value)
193
+ case type.to_sym
194
+ when :DateTime
195
+ DateTime.parse(value)
196
+ when :Date
197
+ Date.parse(value)
198
+ when :String
199
+ value.to_s
200
+ when :Integer
201
+ value.to_i
202
+ when :Float
203
+ value.to_f
204
+ when :BOOLEAN
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ true
207
+ else
208
+ false
209
+ end
210
+ when :Object
211
+ # generic object (usually a Hash), return directly
212
+ value
213
+ when /\AArray<(?<inner_type>.+)>\z/
214
+ inner_type = Regexp.last_match[:inner_type]
215
+ value.map { |v| _deserialize(inner_type, v) }
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ k_type = Regexp.last_match[:k_type]
218
+ v_type = Regexp.last_match[:v_type]
219
+ {}.tap do |hash|
220
+ value.each do |k, v|
221
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
222
+ end
223
+ end
224
+ else # model
225
+ temp_model = AsposeSlidesCloud.const_get(type).new
226
+ temp_model.build_from_hash(value)
227
+ end
228
+ end
229
+
230
+ # Returns the string representation of the object
231
+ # @return [String] String presentation of the object
232
+ def to_s
233
+ to_hash.to_s
234
+ end
235
+
236
+ # to_body is an alias to to_hash (backward compatibility)
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_body
239
+ to_hash
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ next if value.nil?
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+ end
272
+ end
@@ -0,0 +1,412 @@
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 comment of slide
27
+ class Effect
28
+ # Effect type.
29
+ attr_accessor :type
30
+
31
+ # Effect subtype.
32
+ attr_accessor :subtype
33
+
34
+ # Preset class type.
35
+ attr_accessor :preset_class_type
36
+
37
+ # Shape index.
38
+ attr_accessor :shape_index
39
+
40
+ # Effect trigger type.
41
+ attr_accessor :trigger_type
42
+
43
+ # The percentage of duration accelerate behavior effect.
44
+ attr_accessor :accelerate
45
+
46
+ # True to automatically play the animation in reverse after playing it in the forward direction.
47
+ attr_accessor :auto_reverse
48
+
49
+ # The percentage of duration decelerate behavior effect.
50
+ attr_accessor :decelerate
51
+
52
+ # The duration of animation effect.
53
+ attr_accessor :duration
54
+
55
+ # The number of times the effect should repeat.
56
+ attr_accessor :repeat_count
57
+
58
+ # The number of times the effect should repeat.
59
+ attr_accessor :repeat_duration
60
+
61
+ # The way for a effect to restart after complete.
62
+ attr_accessor :restart
63
+
64
+ # The percentage by which to speed up (or slow down) the timing.
65
+ attr_accessor :speed
66
+
67
+ # Delay time after trigger.
68
+ attr_accessor :trigger_delay_time
69
+
70
+ class EnumAttributeValidator
71
+ attr_reader :datatype
72
+ attr_reader :allowable_values
73
+
74
+ def initialize(datatype, allowable_values)
75
+ @allowable_values = allowable_values.map do |value|
76
+ case datatype.to_s
77
+ when /Integer/i
78
+ value.to_i
79
+ when /Float/i
80
+ value.to_f
81
+ else
82
+ value
83
+ end
84
+ end
85
+ end
86
+
87
+ def valid?(value)
88
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
89
+ end
90
+ end
91
+
92
+ # Attribute mapping from ruby-style variable name to JSON key.
93
+ def self.attribute_map
94
+ {
95
+ :'type' => :'Type',
96
+ :'subtype' => :'Subtype',
97
+ :'preset_class_type' => :'PresetClassType',
98
+ :'shape_index' => :'ShapeIndex',
99
+ :'trigger_type' => :'TriggerType',
100
+ :'accelerate' => :'Accelerate',
101
+ :'auto_reverse' => :'AutoReverse',
102
+ :'decelerate' => :'Decelerate',
103
+ :'duration' => :'Duration',
104
+ :'repeat_count' => :'RepeatCount',
105
+ :'repeat_duration' => :'RepeatDuration',
106
+ :'restart' => :'Restart',
107
+ :'speed' => :'Speed',
108
+ :'trigger_delay_time' => :'TriggerDelayTime'
109
+ }
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.swagger_types
114
+ {
115
+ :'type' => :'String',
116
+ :'subtype' => :'String',
117
+ :'preset_class_type' => :'String',
118
+ :'shape_index' => :'Integer',
119
+ :'trigger_type' => :'String',
120
+ :'accelerate' => :'Float',
121
+ :'auto_reverse' => :'BOOLEAN',
122
+ :'decelerate' => :'Float',
123
+ :'duration' => :'Float',
124
+ :'repeat_count' => :'Float',
125
+ :'repeat_duration' => :'Float',
126
+ :'restart' => :'String',
127
+ :'speed' => :'Float',
128
+ :'trigger_delay_time' => :'Float'
129
+ }
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ return unless attributes.is_a?(Hash)
136
+
137
+ # convert string to symbol for hash key
138
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
139
+
140
+ if attributes.has_key?(:'Type')
141
+ self.type = attributes[:'Type']
142
+ end
143
+
144
+ if attributes.has_key?(:'Subtype')
145
+ self.subtype = attributes[:'Subtype']
146
+ end
147
+
148
+ if attributes.has_key?(:'PresetClassType')
149
+ self.preset_class_type = attributes[:'PresetClassType']
150
+ end
151
+
152
+ if attributes.has_key?(:'ShapeIndex')
153
+ self.shape_index = attributes[:'ShapeIndex']
154
+ end
155
+
156
+ if attributes.has_key?(:'TriggerType')
157
+ self.trigger_type = attributes[:'TriggerType']
158
+ end
159
+
160
+ if attributes.has_key?(:'Accelerate')
161
+ self.accelerate = attributes[:'Accelerate']
162
+ end
163
+
164
+ if attributes.has_key?(:'AutoReverse')
165
+ self.auto_reverse = attributes[:'AutoReverse']
166
+ end
167
+
168
+ if attributes.has_key?(:'Decelerate')
169
+ self.decelerate = attributes[:'Decelerate']
170
+ end
171
+
172
+ if attributes.has_key?(:'Duration')
173
+ self.duration = attributes[:'Duration']
174
+ end
175
+
176
+ if attributes.has_key?(:'RepeatCount')
177
+ self.repeat_count = attributes[:'RepeatCount']
178
+ end
179
+
180
+ if attributes.has_key?(:'RepeatDuration')
181
+ self.repeat_duration = attributes[:'RepeatDuration']
182
+ end
183
+
184
+ if attributes.has_key?(:'Restart')
185
+ self.restart = attributes[:'Restart']
186
+ end
187
+
188
+ if attributes.has_key?(:'Speed')
189
+ self.speed = attributes[:'Speed']
190
+ end
191
+
192
+ if attributes.has_key?(:'TriggerDelayTime')
193
+ self.trigger_delay_time = attributes[:'TriggerDelayTime']
194
+ end
195
+ end
196
+
197
+ # Show invalid properties with the reasons. Usually used together with valid?
198
+ # @return Array for valid properties with the reasons
199
+ def list_invalid_properties
200
+ invalid_properties = Array.new
201
+ if @shape_index.nil?
202
+ invalid_properties.push('invalid value for "shape_index", shape_index cannot be nil.')
203
+ end
204
+
205
+ invalid_properties
206
+ end
207
+
208
+ # Check to see if the all the properties in the model are valid
209
+ # @return true if the model is valid
210
+ def valid?
211
+ type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])
212
+ return false unless type_validator.valid?(@type)
213
+ subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])
214
+ return false unless subtype_validator.valid?(@subtype)
215
+ preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])
216
+ return false unless preset_class_type_validator.valid?(@preset_class_type)
217
+ return false if @shape_index.nil?
218
+ trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])
219
+ return false unless trigger_type_validator.valid?(@trigger_type)
220
+ restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])
221
+ return false unless restart_validator.valid?(@restart)
222
+ true
223
+ end
224
+
225
+ # Custom attribute writer method checking allowed values (enum).
226
+ # @param [Object] type Object to be assigned
227
+ def type=(type)
228
+ validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])
229
+ unless validator.valid?(type)
230
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
231
+ end
232
+ @type = type
233
+ end
234
+
235
+ # Custom attribute writer method checking allowed values (enum).
236
+ # @param [Object] subtype Object to be assigned
237
+ def subtype=(subtype)
238
+ validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])
239
+ unless validator.valid?(subtype)
240
+ fail ArgumentError, 'invalid value for "subtype", must be one of #{validator.allowable_values}.'
241
+ end
242
+ @subtype = subtype
243
+ end
244
+
245
+ # Custom attribute writer method checking allowed values (enum).
246
+ # @param [Object] preset_class_type Object to be assigned
247
+ def preset_class_type=(preset_class_type)
248
+ validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])
249
+ unless validator.valid?(preset_class_type)
250
+ fail ArgumentError, 'invalid value for "preset_class_type", must be one of #{validator.allowable_values}.'
251
+ end
252
+ @preset_class_type = preset_class_type
253
+ end
254
+
255
+ # Custom attribute writer method checking allowed values (enum).
256
+ # @param [Object] trigger_type Object to be assigned
257
+ def trigger_type=(trigger_type)
258
+ validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])
259
+ unless validator.valid?(trigger_type)
260
+ fail ArgumentError, 'invalid value for "trigger_type", must be one of #{validator.allowable_values}.'
261
+ end
262
+ @trigger_type = trigger_type
263
+ end
264
+
265
+ # Custom attribute writer method checking allowed values (enum).
266
+ # @param [Object] restart Object to be assigned
267
+ def restart=(restart)
268
+ validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])
269
+ unless validator.valid?(restart)
270
+ fail ArgumentError, 'invalid value for "restart", must be one of #{validator.allowable_values}.'
271
+ end
272
+ @restart = restart
273
+ end
274
+
275
+ # Checks equality by comparing each attribute.
276
+ # @param [Object] Object to be compared
277
+ def ==(o)
278
+ return true if self.equal?(o)
279
+ self.class == o.class &&
280
+ type == o.type &&
281
+ subtype == o.subtype &&
282
+ preset_class_type == o.preset_class_type &&
283
+ shape_index == o.shape_index &&
284
+ trigger_type == o.trigger_type &&
285
+ accelerate == o.accelerate &&
286
+ auto_reverse == o.auto_reverse &&
287
+ decelerate == o.decelerate &&
288
+ duration == o.duration &&
289
+ repeat_count == o.repeat_count &&
290
+ repeat_duration == o.repeat_duration &&
291
+ restart == o.restart &&
292
+ speed == o.speed &&
293
+ trigger_delay_time == o.trigger_delay_time
294
+ end
295
+
296
+ # @see the `==` method
297
+ # @param [Object] Object to be compared
298
+ def eql?(o)
299
+ self == o
300
+ end
301
+
302
+ # Calculates hash code according to all attributes.
303
+ # @return [Fixnum] Hash code
304
+ def hash
305
+ [type, subtype, preset_class_type, shape_index, trigger_type, accelerate, auto_reverse, decelerate, duration, repeat_count, repeat_duration, restart, speed, trigger_delay_time].hash
306
+ end
307
+
308
+ # Builds the object from hash
309
+ # @param [Hash] attributes Model attributes in the form of hash
310
+ # @return [Object] Returns the model itself
311
+ def build_from_hash(attributes)
312
+ return nil unless attributes.is_a?(Hash)
313
+ self.class.swagger_types.each_pair do |key, type|
314
+ if type =~ /\AArray<(.*)>/i
315
+ # check to ensure the input is an array given that the the attribute
316
+ # is documented as an array but the input is not
317
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
318
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
319
+ end
320
+ elsif !attributes[self.class.attribute_map[key]].nil?
321
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
322
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
323
+ end
324
+
325
+ self
326
+ end
327
+
328
+ # Deserializes the data based on type
329
+ # @param string type Data type
330
+ # @param string value Value to be deserialized
331
+ # @return [Object] Deserialized data
332
+ def _deserialize(type, value)
333
+ case type.to_sym
334
+ when :DateTime
335
+ DateTime.parse(value)
336
+ when :Date
337
+ Date.parse(value)
338
+ when :String
339
+ value.to_s
340
+ when :Integer
341
+ value.to_i
342
+ when :Float
343
+ value.to_f
344
+ when :BOOLEAN
345
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
346
+ true
347
+ else
348
+ false
349
+ end
350
+ when :Object
351
+ # generic object (usually a Hash), return directly
352
+ value
353
+ when /\AArray<(?<inner_type>.+)>\z/
354
+ inner_type = Regexp.last_match[:inner_type]
355
+ value.map { |v| _deserialize(inner_type, v) }
356
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
357
+ k_type = Regexp.last_match[:k_type]
358
+ v_type = Regexp.last_match[:v_type]
359
+ {}.tap do |hash|
360
+ value.each do |k, v|
361
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
362
+ end
363
+ end
364
+ else # model
365
+ temp_model = AsposeSlidesCloud.const_get(type).new
366
+ temp_model.build_from_hash(value)
367
+ end
368
+ end
369
+
370
+ # Returns the string representation of the object
371
+ # @return [String] String presentation of the object
372
+ def to_s
373
+ to_hash.to_s
374
+ end
375
+
376
+ # to_body is an alias to to_hash (backward compatibility)
377
+ # @return [Hash] Returns the object in the form of hash
378
+ def to_body
379
+ to_hash
380
+ end
381
+
382
+ # Returns the object in the form of hash
383
+ # @return [Hash] Returns the object in the form of hash
384
+ def to_hash
385
+ hash = {}
386
+ self.class.attribute_map.each_pair do |attr, param|
387
+ value = self.send(attr)
388
+ next if value.nil?
389
+ hash[param] = _to_hash(value)
390
+ end
391
+ hash
392
+ end
393
+
394
+ # Outputs non-array value in the form of hash
395
+ # For object, use to_hash. Otherwise, just return the value
396
+ # @param [Object] value Any valid value
397
+ # @return [Hash] Returns the value in the form of hash
398
+ def _to_hash(value)
399
+ if value.is_a?(Array)
400
+ value.compact.map { |v| _to_hash(v) }
401
+ elsif value.is_a?(Hash)
402
+ {}.tap do |hash|
403
+ value.each { |k, v| hash[k] = _to_hash(v) }
404
+ end
405
+ elsif value.respond_to? :to_hash
406
+ value.to_hash
407
+ else
408
+ value
409
+ end
410
+ end
411
+ end
412
+ end