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,282 +1,218 @@
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 Document properties.
38
- attr_accessor :view_properties
39
-
40
- # Link to slides collection.
41
- attr_accessor :slides
42
-
43
- # Link to images collection.
44
- attr_accessor :images
45
-
46
- # Link to layout slides collection.
47
- attr_accessor :layout_slides
48
-
49
- # Link to master slides collection.
50
- attr_accessor :master_slides
51
-
52
- # Gets or sets the number of matches
53
- attr_accessor :matches
54
-
55
- # Attribute mapping from ruby-style variable name to JSON key.
56
- def self.attribute_map
57
- {
58
- :'self_uri' => :'SelfUri',
59
- :'alternate_links' => :'AlternateLinks',
60
- :'document_properties' => :'DocumentProperties',
61
- :'view_properties' => :'ViewProperties',
62
- :'slides' => :'Slides',
63
- :'images' => :'Images',
64
- :'layout_slides' => :'LayoutSlides',
65
- :'master_slides' => :'MasterSlides',
66
- :'matches' => :'Matches'
67
- }
68
- end
69
-
70
- # Attribute type mapping.
71
- def self.swagger_types
72
- {
73
- :'self_uri' => :'ResourceUri',
74
- :'alternate_links' => :'Array<ResourceUri>',
75
- :'document_properties' => :'ResourceUriElement',
76
- :'view_properties' => :'ResourceUriElement',
77
- :'slides' => :'ResourceUriElement',
78
- :'images' => :'ResourceUriElement',
79
- :'layout_slides' => :'ResourceUriElement',
80
- :'master_slides' => :'ResourceUriElement',
81
- :'matches' => :'Integer'
82
- }
83
- end
84
-
85
- # Initializes the object
86
- # @param [Hash] attributes Model attributes in the form of hash
87
- def initialize(attributes = {})
88
- return unless attributes.is_a?(Hash)
89
-
90
- # convert string to symbol for hash key
91
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
92
-
93
- if attributes.has_key?(:'SelfUri')
94
- self.self_uri = attributes[:'SelfUri']
95
- end
96
-
97
- if attributes.has_key?(:'AlternateLinks')
98
- if (value = attributes[:'AlternateLinks']).is_a?(Array)
99
- self.alternate_links = value
100
- end
101
- end
102
-
103
- if attributes.has_key?(:'DocumentProperties')
104
- self.document_properties = attributes[:'DocumentProperties']
105
- end
106
-
107
- if attributes.has_key?(:'ViewProperties')
108
- self.view_properties = attributes[:'ViewProperties']
109
- end
110
-
111
- if attributes.has_key?(:'Slides')
112
- self.slides = attributes[:'Slides']
113
- end
114
-
115
- if attributes.has_key?(:'Images')
116
- self.images = attributes[:'Images']
117
- end
118
-
119
- if attributes.has_key?(:'LayoutSlides')
120
- self.layout_slides = attributes[:'LayoutSlides']
121
- end
122
-
123
- if attributes.has_key?(:'MasterSlides')
124
- self.master_slides = attributes[:'MasterSlides']
125
- end
126
-
127
- if attributes.has_key?(:'Matches')
128
- self.matches = attributes[:'Matches']
129
- end
130
- end
131
-
132
- # Show invalid properties with the reasons. Usually used together with valid?
133
- # @return Array for valid properties with the reasons
134
- def list_invalid_properties
135
- invalid_properties = Array.new
136
- if @matches.nil?
137
- invalid_properties.push('invalid value for "matches", matches cannot be nil.')
138
- end
139
-
140
- invalid_properties
141
- end
142
-
143
- # Check to see if the all the properties in the model are valid
144
- # @return true if the model is valid
145
- def valid?
146
- return false if @matches.nil?
147
- true
148
- end
149
-
150
- # Checks equality by comparing each attribute.
151
- # @param [Object] Object to be compared
152
- def ==(o)
153
- return true if self.equal?(o)
154
- self.class == o.class &&
155
- self_uri == o.self_uri &&
156
- alternate_links == o.alternate_links &&
157
- document_properties == o.document_properties &&
158
- view_properties == o.view_properties &&
159
- slides == o.slides &&
160
- images == o.images &&
161
- layout_slides == o.layout_slides &&
162
- master_slides == o.master_slides &&
163
- matches == o.matches
164
- end
165
-
166
- # @see the `==` method
167
- # @param [Object] Object to be compared
168
- def eql?(o)
169
- self == o
170
- end
171
-
172
- # Calculates hash code according to all attributes.
173
- # @return [Fixnum] Hash code
174
- def hash
175
- [self_uri, alternate_links, document_properties, view_properties, slides, images, layout_slides, master_slides, matches].hash
176
- end
177
-
178
- # Builds the object from hash
179
- # @param [Hash] attributes Model attributes in the form of hash
180
- # @return [Object] Returns the model itself
181
- def build_from_hash(attributes)
182
- return nil unless attributes.is_a?(Hash)
183
- self.class.swagger_types.each_pair do |key, type|
184
- if type =~ /\AArray<(.*)>/i
185
- # check to ensure the input is an array given that the the attribute
186
- # is documented as an array but the input is not
187
- if attributes[self.class.attribute_map[key]].is_a?(Array)
188
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
- end
190
- elsif !attributes[self.class.attribute_map[key]].nil?
191
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
- end # or else data not found in attributes(hash), not an issue as the data can be optional
193
- end
194
-
195
- self
196
- end
197
-
198
- # Deserializes the data based on type
199
- # @param string type Data type
200
- # @param string value Value to be deserialized
201
- # @return [Object] Deserialized data
202
- def _deserialize(type, value)
203
- case type.to_sym
204
- when :DateTime
205
- DateTime.parse(value)
206
- when :Date
207
- Date.parse(value)
208
- when :String
209
- value.to_s
210
- when :Integer
211
- value.to_i
212
- when :Float
213
- value.to_f
214
- when :BOOLEAN
215
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
- true
217
- else
218
- false
219
- end
220
- when :Object
221
- # generic object (usually a Hash), return directly
222
- value
223
- when /\AArray<(?<inner_type>.+)>\z/
224
- inner_type = Regexp.last_match[:inner_type]
225
- value.map { |v| _deserialize(inner_type, v) }
226
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
- k_type = Regexp.last_match[:k_type]
228
- v_type = Regexp.last_match[:v_type]
229
- {}.tap do |hash|
230
- value.each do |k, v|
231
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
- end
233
- end
234
- else # model
235
- temp_model = AsposeSlidesCloud.const_get(type).new
236
- temp_model.build_from_hash(value)
237
- end
238
- end
239
-
240
- # Returns the string representation of the object
241
- # @return [String] String presentation of the object
242
- def to_s
243
- to_hash.to_s
244
- end
245
-
246
- # to_body is an alias to to_hash (backward compatibility)
247
- # @return [Hash] Returns the object in the form of hash
248
- def to_body
249
- to_hash
250
- end
251
-
252
- # Returns the object in the form of hash
253
- # @return [Hash] Returns the object in the form of hash
254
- def to_hash
255
- hash = {}
256
- self.class.attribute_map.each_pair do |attr, param|
257
- value = self.send(attr)
258
- next if value.nil?
259
- hash[param] = _to_hash(value)
260
- end
261
- hash
262
- end
263
-
264
- # Outputs non-array value in the form of hash
265
- # For object, use to_hash. Otherwise, just return the value
266
- # @param [Object] value Any valid value
267
- # @return [Hash] Returns the value in the form of hash
268
- def _to_hash(value)
269
- if value.is_a?(Array)
270
- value.compact.map { |v| _to_hash(v) }
271
- elsif value.is_a?(Hash)
272
- {}.tap do |hash|
273
- value.each { |k, v| hash[k] = _to_hash(v) }
274
- end
275
- elsif value.respond_to? :to_hash
276
- value.to_hash
277
- else
278
- value
279
- end
280
- end
281
- end
282
- 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 document replace result DTO.
27
+ class DocumentReplaceResult < Document
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
+ document_properties == o.document_properties &&
82
+ view_properties == o.view_properties &&
83
+ slides == o.slides &&
84
+ images == o.images &&
85
+ layout_slides == o.layout_slides &&
86
+ master_slides == o.master_slides &&
87
+ matches == o.matches
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [self_uri, alternate_links, document_properties, view_properties, slides, images, layout_slides, master_slides, matches].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.swagger_types.each_pair do |key, type|
108
+ mapKey = self.class.attribute_map[key]
109
+ if !mapKey.nil?
110
+ val = attributes[mapKey]
111
+ if val.nil?
112
+ mapKeyString = mapKey.to_s
113
+ mapKeyString[0] = mapKeyString[0].downcase
114
+ mapKey = mapKeyString.to_sym
115
+ val = attributes[mapKey]
116
+ end
117
+ if !val.nil?
118
+ if type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the the attribute
120
+ # is documented as an array but the input is not
121
+ if val.is_a?(Array)
122
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
123
+ end
124
+ else
125
+ self.send("#{key}=", _deserialize(type, val))
126
+ end
127
+ end
128
+ end
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :BOOLEAN
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ temp_model = AsposeSlidesCloud.const_get(type).new
172
+ temp_model.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ next if value.nil?
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+ end
218
+ end