aspose_slides_cloud 20.4.0 → 20.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +61 -61
  3. data/TestData/ChartTest.pptx +0 -0
  4. data/TestData/Sections.pptx +0 -0
  5. data/TestData/TemplatingCVDataWithBase64.xml +22 -22
  6. data/lib/aspose_slides_cloud.rb +212 -205
  7. data/lib/aspose_slides_cloud/api/slides_api.rb +10979 -7974
  8. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +4146 -3099
  9. data/lib/aspose_slides_cloud/api_client.rb +432 -429
  10. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +244 -261
  11. data/lib/aspose_slides_cloud/models/add_master_slide.rb +259 -276
  12. data/lib/aspose_slides_cloud/models/add_shape.rb +239 -256
  13. data/lib/aspose_slides_cloud/models/add_slide.rb +269 -286
  14. data/lib/aspose_slides_cloud/models/api_info.rb +217 -205
  15. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +285 -273
  16. data/lib/aspose_slides_cloud/models/audio_frame.rb +359 -573
  17. data/lib/aspose_slides_cloud/models/axes.rb +237 -225
  18. data/lib/aspose_slides_cloud/models/axis.rb +699 -687
  19. data/lib/aspose_slides_cloud/models/base64_input_file.rb +230 -256
  20. data/lib/aspose_slides_cloud/models/blur_effect.rb +227 -215
  21. data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +299 -0
  22. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +212 -230
  23. data/lib/aspose_slides_cloud/models/bubble_series.rb +248 -428
  24. data/lib/aspose_slides_cloud/models/chart.rb +365 -553
  25. data/lib/aspose_slides_cloud/models/chart_category.rb +271 -0
  26. data/lib/aspose_slides_cloud/models/chart_title.rb +222 -210
  27. data/lib/aspose_slides_cloud/models/chart_wall.rb +281 -269
  28. data/lib/aspose_slides_cloud/models/color_scheme.rb +317 -327
  29. data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +217 -0
  30. data/lib/aspose_slides_cloud/models/connector.rb +275 -487
  31. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +209 -197
  32. data/lib/aspose_slides_cloud/models/{resource_uri_element.rb → data_point.rb} +197 -195
  33. data/lib/aspose_slides_cloud/models/disc_usage.rb +227 -215
  34. data/lib/aspose_slides_cloud/models/document.rb +257 -267
  35. data/lib/aspose_slides_cloud/models/document_properties.rb +209 -219
  36. data/lib/aspose_slides_cloud/models/document_property.rb +232 -242
  37. data/lib/aspose_slides_cloud/models/document_replace_result.rb +218 -282
  38. data/lib/aspose_slides_cloud/models/effect.rb +424 -412
  39. data/lib/aspose_slides_cloud/models/effect_format.rb +277 -265
  40. data/lib/aspose_slides_cloud/models/entity_exists.rb +212 -0
  41. data/lib/aspose_slides_cloud/models/error.rb +237 -225
  42. data/lib/aspose_slides_cloud/models/error_details.rb +222 -210
  43. data/lib/aspose_slides_cloud/models/export_format.rb +60 -59
  44. data/lib/aspose_slides_cloud/models/export_options.rb +216 -194
  45. data/lib/aspose_slides_cloud/models/file_version.rb +225 -270
  46. data/lib/aspose_slides_cloud/models/file_versions.rb +209 -197
  47. data/lib/aspose_slides_cloud/models/files_list.rb +209 -197
  48. data/lib/aspose_slides_cloud/models/files_upload_result.rb +221 -209
  49. data/lib/aspose_slides_cloud/models/fill_format.rb +240 -228
  50. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +246 -234
  51. data/lib/aspose_slides_cloud/models/font_scheme.rb +227 -237
  52. data/lib/aspose_slides_cloud/models/font_set.rb +227 -215
  53. data/lib/aspose_slides_cloud/models/format_scheme.rb +245 -255
  54. data/lib/aspose_slides_cloud/models/geometry_shape.rb +260 -439
  55. data/lib/aspose_slides_cloud/models/glow_effect.rb +222 -210
  56. data/lib/aspose_slides_cloud/models/gradient_fill.rb +342 -359
  57. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +222 -210
  58. data/lib/aspose_slides_cloud/models/graphical_object.rb +234 -422
  59. data/lib/aspose_slides_cloud/models/group_shape.rb +234 -422
  60. data/lib/aspose_slides_cloud/models/header_footer.rb +247 -0
  61. data/lib/aspose_slides_cloud/models/html_export_options.rb +421 -420
  62. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +197 -195
  63. data/lib/aspose_slides_cloud/models/image.rb +237 -247
  64. data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -43
  65. data/lib/aspose_slides_cloud/models/image_export_options.rb +299 -298
  66. data/lib/aspose_slides_cloud/models/images.rb +209 -219
  67. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +252 -240
  68. data/lib/aspose_slides_cloud/models/input.rb +227 -215
  69. data/lib/aspose_slides_cloud/models/input_file.rb +250 -238
  70. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +224 -212
  71. data/lib/aspose_slides_cloud/models/layout_slide.rb +278 -288
  72. data/lib/aspose_slides_cloud/models/layout_slides.rb +209 -219
  73. data/lib/aspose_slides_cloud/models/legend.rb +321 -309
  74. data/lib/aspose_slides_cloud/models/line_format.rb +389 -377
  75. data/lib/aspose_slides_cloud/models/master_slide.rb +231 -241
  76. data/lib/aspose_slides_cloud/models/master_slides.rb +209 -219
  77. data/lib/aspose_slides_cloud/models/merge.rb +231 -248
  78. data/lib/aspose_slides_cloud/models/merging_source.rb +219 -207
  79. data/lib/aspose_slides_cloud/models/no_fill.rb +219 -236
  80. data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +217 -0
  81. data/lib/aspose_slides_cloud/models/notes_slide.rb +217 -227
  82. data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -43
  83. data/lib/aspose_slides_cloud/models/notes_slide_header_footer.rb +267 -0
  84. data/lib/aspose_slides_cloud/models/object_exist.rb +227 -215
  85. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +259 -447
  86. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +210 -200
  87. data/lib/aspose_slides_cloud/models/one_value_series.rb +248 -428
  88. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +209 -197
  89. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +252 -240
  90. data/lib/aspose_slides_cloud/models/output_file.rb +240 -228
  91. data/lib/aspose_slides_cloud/models/paragraph.rb +517 -527
  92. data/lib/aspose_slides_cloud/models/paragraphs.rb +209 -219
  93. data/lib/aspose_slides_cloud/models/path_input_file.rb +240 -266
  94. data/lib/aspose_slides_cloud/models/path_output_file.rb +239 -256
  95. data/lib/aspose_slides_cloud/models/pattern_fill.rb +266 -283
  96. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +547 -519
  97. data/lib/aspose_slides_cloud/models/picture_fill.rb +351 -368
  98. data/lib/aspose_slides_cloud/models/picture_frame.rb +245 -459
  99. data/lib/aspose_slides_cloud/models/pipeline.rb +219 -207
  100. data/lib/aspose_slides_cloud/models/placeholder.rb +325 -335
  101. data/lib/aspose_slides_cloud/models/placeholders.rb +209 -219
  102. data/lib/aspose_slides_cloud/models/plot_area.rb +311 -299
  103. data/lib/aspose_slides_cloud/models/portion.rb +589 -599
  104. data/lib/aspose_slides_cloud/models/portions.rb +209 -219
  105. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +247 -246
  106. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +229 -217
  107. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +221 -209
  108. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +286 -274
  109. data/lib/aspose_slides_cloud/models/reflection_effect.rb +441 -429
  110. data/lib/aspose_slides_cloud/models/remove_shape.rb +229 -246
  111. data/lib/aspose_slides_cloud/models/remove_slide.rb +234 -251
  112. data/lib/aspose_slides_cloud/models/reorder_slide.rb +249 -266
  113. data/lib/aspose_slides_cloud/models/replace_text.rb +269 -286
  114. data/lib/aspose_slides_cloud/models/request_input_file.rb +235 -261
  115. data/lib/aspose_slides_cloud/models/reset_slide.rb +234 -251
  116. data/lib/aspose_slides_cloud/models/resource_base.rb +219 -207
  117. data/lib/aspose_slides_cloud/models/resource_uri.rb +237 -225
  118. data/lib/aspose_slides_cloud/models/response_output_file.rb +219 -236
  119. data/lib/aspose_slides_cloud/models/save.rb +266 -283
  120. data/lib/aspose_slides_cloud/models/save_shape.rb +276 -293
  121. data/lib/aspose_slides_cloud/models/save_slide.rb +301 -318
  122. data/lib/aspose_slides_cloud/models/scale_type.rb +41 -41
  123. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +225 -215
  124. data/lib/aspose_slides_cloud/models/scatter_series.rb +248 -428
  125. data/lib/aspose_slides_cloud/models/section.rb +234 -0
  126. data/lib/aspose_slides_cloud/models/sections.rb +209 -0
  127. data/lib/aspose_slides_cloud/models/series.rb +422 -389
  128. data/lib/aspose_slides_cloud/models/series_marker.rb +281 -269
  129. data/lib/aspose_slides_cloud/models/shape.rb +255 -467
  130. data/lib/aspose_slides_cloud/models/shape_base.rb +375 -406
  131. data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -44
  132. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +286 -274
  133. data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -41
  134. data/lib/aspose_slides_cloud/models/shapes.rb +209 -219
  135. data/lib/aspose_slides_cloud/models/size_type.rb +55 -55
  136. data/lib/aspose_slides_cloud/models/slide.rb +322 -332
  137. data/lib/aspose_slides_cloud/models/slide_animation.rb +221 -231
  138. data/lib/aspose_slides_cloud/models/slide_background.rb +266 -276
  139. data/lib/aspose_slides_cloud/models/slide_comment.rb +239 -227
  140. data/lib/aspose_slides_cloud/models/slide_comments.rb +209 -219
  141. data/lib/aspose_slides_cloud/models/slide_export_format.rb +59 -58
  142. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +223 -347
  143. data/lib/aspose_slides_cloud/models/slides.rb +209 -219
  144. data/lib/aspose_slides_cloud/models/smart_art.rb +342 -530
  145. data/lib/aspose_slides_cloud/models/smart_art_node.rb +293 -281
  146. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +235 -422
  147. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +212 -200
  148. data/lib/aspose_slides_cloud/models/solid_fill.rb +229 -246
  149. data/lib/aspose_slides_cloud/models/split_document_result.rb +209 -219
  150. data/lib/aspose_slides_cloud/models/storage_exist.rb +212 -200
  151. data/lib/aspose_slides_cloud/models/storage_file.rb +257 -245
  152. data/lib/aspose_slides_cloud/models/svg_export_options.rb +379 -378
  153. data/lib/aspose_slides_cloud/models/swf_export_options.rb +529 -528
  154. data/lib/aspose_slides_cloud/models/table.rb +350 -538
  155. data/lib/aspose_slides_cloud/models/table_cell.rb +403 -391
  156. data/lib/aspose_slides_cloud/models/table_column.rb +212 -200
  157. data/lib/aspose_slides_cloud/models/table_row.rb +239 -227
  158. data/lib/aspose_slides_cloud/models/task.rb +240 -228
  159. data/lib/aspose_slides_cloud/models/text_item.rb +217 -205
  160. data/lib/aspose_slides_cloud/models/text_items.rb +209 -219
  161. data/lib/aspose_slides_cloud/models/theme.rb +237 -247
  162. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +423 -422
  163. data/lib/aspose_slides_cloud/models/update_background.rb +241 -258
  164. data/lib/aspose_slides_cloud/models/update_shape.rb +239 -256
  165. data/lib/aspose_slides_cloud/models/video_frame.rb +329 -543
  166. data/lib/aspose_slides_cloud/models/view_properties.rb +357 -0
  167. data/lib/aspose_slides_cloud/models/waterfall_chart_data_point.rb +206 -0
  168. data/lib/aspose_slides_cloud/models/waterfall_series.rb +247 -0
  169. data/lib/aspose_slides_cloud/models/xps_export_options.rb +243 -242
  170. data/lib/aspose_slides_cloud/type_registry.rb +320 -0
  171. data/lib/aspose_slides_cloud/version.rb +25 -25
  172. data/spec/api/slides_api_spec.rb +35926 -24406
  173. data/spec/extra/extra_spec.rb +235 -101
  174. data/spec/spec_utils.rb +183 -176
  175. data/testConfig.json +7 -7
  176. data/testRules.json +472 -340
  177. metadata +18 -3
@@ -1,347 +1,223 @@
1
- =begin
2
- Copyright (c) 2019 Aspose Pty Ltd
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
21
- =end
22
-
23
- require 'date'
24
-
25
- module AsposeSlidesCloud
26
- # Represents slide replace result DTO.
27
- class SlideReplaceResult
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
- # Gets or sets the width.
35
- attr_accessor :width
36
-
37
- # Gets or sets the height.
38
- attr_accessor :height
39
-
40
- # Specifies if shapes of the master slide should be shown on the slide. True by default.
41
- attr_accessor :show_master_shapes
42
-
43
- # Gets or sets the link to the layout slide.
44
- attr_accessor :layout_slide
45
-
46
- # Gets or sets the link to list of top-level shapes.
47
- attr_accessor :shapes
48
-
49
- # Gets or sets the link to theme.
50
- attr_accessor :theme
51
-
52
- # Gets or sets the link to placeholders.
53
- attr_accessor :placeholders
54
-
55
- # Gets or sets the link to images.
56
- attr_accessor :images
57
-
58
- # Gets or sets the link to comments.
59
- attr_accessor :comments
60
-
61
- # Get or sets the link to slide's background
62
- attr_accessor :background
63
-
64
- # Get or sets the link to notes slide.
65
- attr_accessor :notes_slide
66
-
67
- # Gets or sets the number of matches
68
- attr_accessor :matches
69
-
70
- # Attribute mapping from ruby-style variable name to JSON key.
71
- def self.attribute_map
72
- {
73
- :'self_uri' => :'SelfUri',
74
- :'alternate_links' => :'AlternateLinks',
75
- :'width' => :'Width',
76
- :'height' => :'Height',
77
- :'show_master_shapes' => :'ShowMasterShapes',
78
- :'layout_slide' => :'LayoutSlide',
79
- :'shapes' => :'Shapes',
80
- :'theme' => :'Theme',
81
- :'placeholders' => :'Placeholders',
82
- :'images' => :'Images',
83
- :'comments' => :'Comments',
84
- :'background' => :'Background',
85
- :'notes_slide' => :'NotesSlide',
86
- :'matches' => :'Matches'
87
- }
88
- end
89
-
90
- # Attribute type mapping.
91
- def self.swagger_types
92
- {
93
- :'self_uri' => :'ResourceUri',
94
- :'alternate_links' => :'Array<ResourceUri>',
95
- :'width' => :'Float',
96
- :'height' => :'Float',
97
- :'show_master_shapes' => :'BOOLEAN',
98
- :'layout_slide' => :'ResourceUriElement',
99
- :'shapes' => :'ResourceUriElement',
100
- :'theme' => :'ResourceUriElement',
101
- :'placeholders' => :'ResourceUriElement',
102
- :'images' => :'ResourceUriElement',
103
- :'comments' => :'ResourceUriElement',
104
- :'background' => :'ResourceUriElement',
105
- :'notes_slide' => :'ResourceUriElement',
106
- :'matches' => :'Integer'
107
- }
108
- end
109
-
110
- # Initializes the object
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- def initialize(attributes = {})
113
- return unless attributes.is_a?(Hash)
114
-
115
- # convert string to symbol for hash key
116
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
117
-
118
- if attributes.has_key?(:'SelfUri')
119
- self.self_uri = attributes[:'SelfUri']
120
- end
121
-
122
- if attributes.has_key?(:'AlternateLinks')
123
- if (value = attributes[:'AlternateLinks']).is_a?(Array)
124
- self.alternate_links = value
125
- end
126
- end
127
-
128
- if attributes.has_key?(:'Width')
129
- self.width = attributes[:'Width']
130
- end
131
-
132
- if attributes.has_key?(:'Height')
133
- self.height = attributes[:'Height']
134
- end
135
-
136
- if attributes.has_key?(:'ShowMasterShapes')
137
- self.show_master_shapes = attributes[:'ShowMasterShapes']
138
- end
139
-
140
- if attributes.has_key?(:'LayoutSlide')
141
- self.layout_slide = attributes[:'LayoutSlide']
142
- end
143
-
144
- if attributes.has_key?(:'Shapes')
145
- self.shapes = attributes[:'Shapes']
146
- end
147
-
148
- if attributes.has_key?(:'Theme')
149
- self.theme = attributes[:'Theme']
150
- end
151
-
152
- if attributes.has_key?(:'Placeholders')
153
- self.placeholders = attributes[:'Placeholders']
154
- end
155
-
156
- if attributes.has_key?(:'Images')
157
- self.images = attributes[:'Images']
158
- end
159
-
160
- if attributes.has_key?(:'Comments')
161
- self.comments = attributes[:'Comments']
162
- end
163
-
164
- if attributes.has_key?(:'Background')
165
- self.background = attributes[:'Background']
166
- end
167
-
168
- if attributes.has_key?(:'NotesSlide')
169
- self.notes_slide = attributes[:'NotesSlide']
170
- end
171
-
172
- if attributes.has_key?(:'Matches')
173
- self.matches = attributes[:'Matches']
174
- end
175
- end
176
-
177
- # Show invalid properties with the reasons. Usually used together with valid?
178
- # @return Array for valid properties with the reasons
179
- def list_invalid_properties
180
- invalid_properties = Array.new
181
- if @width.nil?
182
- invalid_properties.push('invalid value for "width", width cannot be nil.')
183
- end
184
-
185
- if @height.nil?
186
- invalid_properties.push('invalid value for "height", height cannot be nil.')
187
- end
188
-
189
- if @show_master_shapes.nil?
190
- invalid_properties.push('invalid value for "show_master_shapes", show_master_shapes cannot be nil.')
191
- end
192
-
193
- if @matches.nil?
194
- invalid_properties.push('invalid value for "matches", matches cannot be nil.')
195
- end
196
-
197
- invalid_properties
198
- end
199
-
200
- # Check to see if the all the properties in the model are valid
201
- # @return true if the model is valid
202
- def valid?
203
- return false if @width.nil?
204
- return false if @height.nil?
205
- return false if @show_master_shapes.nil?
206
- return false if @matches.nil?
207
- true
208
- end
209
-
210
- # Checks equality by comparing each attribute.
211
- # @param [Object] Object to be compared
212
- def ==(o)
213
- return true if self.equal?(o)
214
- self.class == o.class &&
215
- self_uri == o.self_uri &&
216
- alternate_links == o.alternate_links &&
217
- width == o.width &&
218
- height == o.height &&
219
- show_master_shapes == o.show_master_shapes &&
220
- layout_slide == o.layout_slide &&
221
- shapes == o.shapes &&
222
- theme == o.theme &&
223
- placeholders == o.placeholders &&
224
- images == o.images &&
225
- comments == o.comments &&
226
- background == o.background &&
227
- notes_slide == o.notes_slide &&
228
- matches == o.matches
229
- end
230
-
231
- # @see the `==` method
232
- # @param [Object] Object to be compared
233
- def eql?(o)
234
- self == o
235
- end
236
-
237
- # Calculates hash code according to all attributes.
238
- # @return [Fixnum] Hash code
239
- def hash
240
- [self_uri, alternate_links, width, height, show_master_shapes, layout_slide, shapes, theme, placeholders, images, comments, background, notes_slide, matches].hash
241
- end
242
-
243
- # Builds the object from hash
244
- # @param [Hash] attributes Model attributes in the form of hash
245
- # @return [Object] Returns the model itself
246
- def build_from_hash(attributes)
247
- return nil unless attributes.is_a?(Hash)
248
- self.class.swagger_types.each_pair do |key, type|
249
- if type =~ /\AArray<(.*)>/i
250
- # check to ensure the input is an array given that the the attribute
251
- # is documented as an array but the input is not
252
- if attributes[self.class.attribute_map[key]].is_a?(Array)
253
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
254
- end
255
- elsif !attributes[self.class.attribute_map[key]].nil?
256
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
257
- end # or else data not found in attributes(hash), not an issue as the data can be optional
258
- end
259
-
260
- self
261
- end
262
-
263
- # Deserializes the data based on type
264
- # @param string type Data type
265
- # @param string value Value to be deserialized
266
- # @return [Object] Deserialized data
267
- def _deserialize(type, value)
268
- case type.to_sym
269
- when :DateTime
270
- DateTime.parse(value)
271
- when :Date
272
- Date.parse(value)
273
- when :String
274
- value.to_s
275
- when :Integer
276
- value.to_i
277
- when :Float
278
- value.to_f
279
- when :BOOLEAN
280
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
281
- true
282
- else
283
- false
284
- end
285
- when :Object
286
- # generic object (usually a Hash), return directly
287
- value
288
- when /\AArray<(?<inner_type>.+)>\z/
289
- inner_type = Regexp.last_match[:inner_type]
290
- value.map { |v| _deserialize(inner_type, v) }
291
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
292
- k_type = Regexp.last_match[:k_type]
293
- v_type = Regexp.last_match[:v_type]
294
- {}.tap do |hash|
295
- value.each do |k, v|
296
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
297
- end
298
- end
299
- else # model
300
- temp_model = AsposeSlidesCloud.const_get(type).new
301
- temp_model.build_from_hash(value)
302
- end
303
- end
304
-
305
- # Returns the string representation of the object
306
- # @return [String] String presentation of the object
307
- def to_s
308
- to_hash.to_s
309
- end
310
-
311
- # to_body is an alias to to_hash (backward compatibility)
312
- # @return [Hash] Returns the object in the form of hash
313
- def to_body
314
- to_hash
315
- end
316
-
317
- # Returns the object in the form of hash
318
- # @return [Hash] Returns the object in the form of hash
319
- def to_hash
320
- hash = {}
321
- self.class.attribute_map.each_pair do |attr, param|
322
- value = self.send(attr)
323
- next if value.nil?
324
- hash[param] = _to_hash(value)
325
- end
326
- hash
327
- end
328
-
329
- # Outputs non-array value in the form of hash
330
- # For object, use to_hash. Otherwise, just return the value
331
- # @param [Object] value Any valid value
332
- # @return [Hash] Returns the value in the form of hash
333
- def _to_hash(value)
334
- if value.is_a?(Array)
335
- value.compact.map { |v| _to_hash(v) }
336
- elsif value.is_a?(Hash)
337
- {}.tap do |hash|
338
- value.each { |k, v| hash[k] = _to_hash(v) }
339
- end
340
- elsif value.respond_to? :to_hash
341
- value.to_hash
342
- else
343
- value
344
- end
345
- end
346
- end
347
- end
1
+ =begin
2
+ Copyright (c) 2019 Aspose Pty Ltd
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeSlidesCloud
26
+ # Represents slide replace result DTO.
27
+ class SlideReplaceResult < Slide
28
+ # Gets or sets the number of matches
29
+ attr_accessor :matches
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ super.merge({
34
+ :'matches' => :'Matches',
35
+ })
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ super.merge({
41
+ :'matches' => :'Integer',
42
+ })
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ super
49
+
50
+ if attributes.has_key?(:'Matches')
51
+ self.matches = attributes[:'Matches']
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = super
59
+ if @matches.nil?
60
+ invalid_properties.push('invalid value for "matches", matches cannot be nil.')
61
+ end
62
+
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ return false if !super
70
+ return false if @matches.nil?
71
+ true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ self_uri == o.self_uri &&
80
+ alternate_links == o.alternate_links &&
81
+ width == o.width &&
82
+ height == o.height &&
83
+ show_master_shapes == o.show_master_shapes &&
84
+ layout_slide == o.layout_slide &&
85
+ shapes == o.shapes &&
86
+ theme == o.theme &&
87
+ placeholders == o.placeholders &&
88
+ images == o.images &&
89
+ comments == o.comments &&
90
+ background == o.background &&
91
+ notes_slide == o.notes_slide &&
92
+ matches == o.matches
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Fixnum] Hash code
103
+ def hash
104
+ [self_uri, alternate_links, width, height, show_master_shapes, layout_slide, shapes, theme, placeholders, images, comments, background, notes_slide, matches].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ self.class.swagger_types.each_pair do |key, type|
113
+ mapKey = self.class.attribute_map[key]
114
+ if !mapKey.nil?
115
+ val = attributes[mapKey]
116
+ if val.nil?
117
+ mapKeyString = mapKey.to_s
118
+ mapKeyString[0] = mapKeyString[0].downcase
119
+ mapKey = mapKeyString.to_sym
120
+ val = attributes[mapKey]
121
+ end
122
+ if !val.nil?
123
+ if type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the the attribute
125
+ # is documented as an array but the input is not
126
+ if val.is_a?(Array)
127
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
128
+ end
129
+ else
130
+ self.send("#{key}=", _deserialize(type, val))
131
+ end
132
+ end
133
+ end
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :BOOLEAN
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ temp_model = AsposeSlidesCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end