aspose_slides_cloud 21.8.0 → 22.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +74 -89
  3. data/TestData/TemplatingCVDataWithBase64.xml +22 -22
  4. data/TestData/test-unprotected.pptx +0 -0
  5. data/TestData/test.pptx +0 -0
  6. data/aspose_slides_cloud.gemspec +1 -1
  7. data/lib/aspose_slides_cloud/api/slides_api.rb +18984 -15218
  8. data/lib/aspose_slides_cloud/api_client.rb +439 -439
  9. data/lib/aspose_slides_cloud/configuration.rb +1 -1
  10. data/lib/aspose_slides_cloud/models/accent_element.rb +239 -0
  11. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +244 -244
  12. data/lib/aspose_slides_cloud/models/add_master_slide.rb +259 -259
  13. data/lib/aspose_slides_cloud/models/add_shape.rb +239 -239
  14. data/lib/aspose_slides_cloud/models/add_slide.rb +269 -269
  15. data/lib/aspose_slides_cloud/models/api_info.rb +217 -217
  16. data/lib/aspose_slides_cloud/models/arc_to_path_segment.rb +279 -0
  17. data/lib/aspose_slides_cloud/models/array_element.rb +305 -0
  18. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +285 -285
  19. data/lib/aspose_slides_cloud/models/audio_frame.rb +382 -359
  20. data/lib/aspose_slides_cloud/models/axes.rb +237 -237
  21. data/lib/aspose_slides_cloud/models/axis.rb +699 -699
  22. data/lib/aspose_slides_cloud/models/bar_element.rb +251 -0
  23. data/lib/aspose_slides_cloud/models/base64_input_file.rb +230 -230
  24. data/lib/aspose_slides_cloud/models/block_element.rb +231 -0
  25. data/lib/aspose_slides_cloud/models/blur_effect.rb +227 -227
  26. data/lib/aspose_slides_cloud/models/border_box_element.rb +309 -0
  27. data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +299 -299
  28. data/lib/aspose_slides_cloud/models/box_element.rb +279 -0
  29. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +212 -212
  30. data/lib/aspose_slides_cloud/models/bubble_series.rb +248 -248
  31. data/lib/aspose_slides_cloud/models/camera.rb +291 -0
  32. data/lib/aspose_slides_cloud/models/chart.rb +368 -365
  33. data/lib/aspose_slides_cloud/models/chart_category.rb +271 -271
  34. data/lib/aspose_slides_cloud/models/chart_title.rb +222 -222
  35. data/lib/aspose_slides_cloud/models/chart_wall.rb +281 -281
  36. data/lib/aspose_slides_cloud/models/close_path_segment.rb +219 -0
  37. data/lib/aspose_slides_cloud/models/color_scheme.rb +317 -317
  38. data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +217 -217
  39. data/lib/aspose_slides_cloud/models/connector.rb +278 -275
  40. data/lib/aspose_slides_cloud/models/cubic_bezier_to_path_segment.rb +309 -0
  41. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +209 -209
  42. data/lib/aspose_slides_cloud/models/data_point.rb +197 -197
  43. data/lib/aspose_slides_cloud/models/delimiter_element.rb +293 -0
  44. data/lib/aspose_slides_cloud/models/disc_usage.rb +227 -227
  45. data/lib/aspose_slides_cloud/models/document.rb +257 -257
  46. data/lib/aspose_slides_cloud/models/document_properties.rb +209 -209
  47. data/lib/aspose_slides_cloud/models/document_property.rb +232 -232
  48. data/lib/aspose_slides_cloud/models/document_replace_result.rb +218 -218
  49. data/lib/aspose_slides_cloud/models/effect.rb +434 -424
  50. data/lib/aspose_slides_cloud/models/effect_format.rb +277 -277
  51. data/lib/aspose_slides_cloud/models/entity_exists.rb +212 -212
  52. data/lib/aspose_slides_cloud/models/error.rb +237 -237
  53. data/lib/aspose_slides_cloud/models/error_details.rb +222 -222
  54. data/lib/aspose_slides_cloud/models/export_format.rb +62 -60
  55. data/lib/aspose_slides_cloud/models/export_options.rb +236 -216
  56. data/lib/aspose_slides_cloud/models/file_version.rb +225 -225
  57. data/lib/aspose_slides_cloud/models/file_versions.rb +209 -209
  58. data/lib/aspose_slides_cloud/models/files_list.rb +209 -209
  59. data/lib/aspose_slides_cloud/models/files_upload_result.rb +221 -221
  60. data/lib/aspose_slides_cloud/models/fill_format.rb +240 -240
  61. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +246 -246
  62. data/lib/aspose_slides_cloud/models/font_scheme.rb +227 -227
  63. data/lib/aspose_slides_cloud/models/font_set.rb +227 -227
  64. data/lib/aspose_slides_cloud/models/format_scheme.rb +245 -245
  65. data/lib/aspose_slides_cloud/models/fraction_element.rb +261 -0
  66. data/lib/aspose_slides_cloud/models/function_element.rb +239 -0
  67. data/lib/aspose_slides_cloud/models/geometry_path.rb +263 -0
  68. data/lib/aspose_slides_cloud/models/geometry_paths.rb +209 -0
  69. data/lib/aspose_slides_cloud/models/geometry_shape.rb +263 -260
  70. data/lib/aspose_slides_cloud/models/gif_export_options.rb +230 -0
  71. data/lib/aspose_slides_cloud/models/glow_effect.rb +222 -222
  72. data/lib/aspose_slides_cloud/models/gradient_fill.rb +342 -342
  73. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +222 -222
  74. data/lib/aspose_slides_cloud/models/graphical_object.rb +237 -234
  75. data/lib/aspose_slides_cloud/models/group_shape.rb +237 -234
  76. data/lib/aspose_slides_cloud/models/grouping_character_element.rb +283 -0
  77. data/lib/aspose_slides_cloud/models/header_footer.rb +247 -247
  78. data/lib/aspose_slides_cloud/models/html5_export_options.rb +220 -0
  79. data/lib/aspose_slides_cloud/models/html_export_options.rb +378 -421
  80. data/lib/aspose_slides_cloud/models/hyperlink.rb +348 -0
  81. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +197 -197
  82. data/lib/aspose_slides_cloud/models/image.rb +237 -237
  83. data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -43
  84. data/lib/aspose_slides_cloud/models/image_export_options.rb +286 -299
  85. data/lib/aspose_slides_cloud/models/images.rb +209 -209
  86. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +252 -252
  87. data/lib/aspose_slides_cloud/models/input.rb +227 -227
  88. data/lib/aspose_slides_cloud/models/input_file.rb +250 -250
  89. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +224 -224
  90. data/lib/aspose_slides_cloud/models/layout_slide.rb +278 -278
  91. data/lib/aspose_slides_cloud/models/layout_slides.rb +209 -209
  92. data/lib/aspose_slides_cloud/models/left_sub_superscript_element.rb +249 -0
  93. data/lib/aspose_slides_cloud/models/legend.rb +321 -321
  94. data/lib/aspose_slides_cloud/models/light_rig.rb +293 -0
  95. data/lib/aspose_slides_cloud/models/limit_element.rb +249 -0
  96. data/lib/aspose_slides_cloud/models/line_format.rb +411 -411
  97. data/lib/aspose_slides_cloud/models/line_to_path_segment.rb +249 -0
  98. data/lib/aspose_slides_cloud/models/master_slide.rb +231 -231
  99. data/lib/aspose_slides_cloud/models/master_slides.rb +209 -209
  100. data/lib/aspose_slides_cloud/models/math_element.rb +240 -0
  101. data/lib/aspose_slides_cloud/models/math_paragraph.rb +253 -0
  102. data/lib/aspose_slides_cloud/models/matrix_element.rb +337 -0
  103. data/lib/aspose_slides_cloud/models/merge.rb +231 -231
  104. data/lib/aspose_slides_cloud/models/merging_source.rb +219 -219
  105. data/lib/aspose_slides_cloud/models/move_to_path_segment.rb +249 -0
  106. data/lib/aspose_slides_cloud/models/nary_operator_element.rb +311 -0
  107. data/lib/aspose_slides_cloud/models/no_fill.rb +219 -219
  108. data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +217 -217
  109. data/lib/aspose_slides_cloud/models/notes_slide.rb +217 -217
  110. data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -43
  111. data/lib/aspose_slides_cloud/models/notes_slide_header_footer.rb +267 -267
  112. data/lib/aspose_slides_cloud/models/object_exist.rb +227 -227
  113. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +262 -259
  114. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +210 -210
  115. data/lib/aspose_slides_cloud/models/one_value_series.rb +248 -248
  116. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +209 -209
  117. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +252 -252
  118. data/lib/aspose_slides_cloud/models/output_file.rb +240 -240
  119. data/lib/aspose_slides_cloud/models/paragraph.rb +517 -517
  120. data/lib/aspose_slides_cloud/models/paragraphs.rb +209 -209
  121. data/lib/aspose_slides_cloud/models/path_input_file.rb +240 -240
  122. data/lib/aspose_slides_cloud/models/path_output_file.rb +239 -239
  123. data/lib/aspose_slides_cloud/models/path_segment.rb +240 -0
  124. data/lib/aspose_slides_cloud/models/pattern_fill.rb +266 -266
  125. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +474 -547
  126. data/lib/aspose_slides_cloud/models/picture_fill.rb +351 -351
  127. data/lib/aspose_slides_cloud/models/picture_frame.rb +248 -245
  128. data/lib/aspose_slides_cloud/models/pipeline.rb +219 -219
  129. data/lib/aspose_slides_cloud/models/placeholder.rb +325 -325
  130. data/lib/aspose_slides_cloud/models/placeholders.rb +209 -209
  131. data/lib/aspose_slides_cloud/models/plot_area.rb +311 -311
  132. data/lib/aspose_slides_cloud/models/portion.rb +619 -589
  133. data/lib/aspose_slides_cloud/models/portions.rb +209 -209
  134. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +244 -247
  135. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +273 -273
  136. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +221 -221
  137. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +286 -286
  138. data/lib/aspose_slides_cloud/models/protection_properties.rb +267 -267
  139. data/lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb +279 -0
  140. data/lib/aspose_slides_cloud/models/radical_element.rb +249 -0
  141. data/lib/aspose_slides_cloud/models/reflection_effect.rb +441 -441
  142. data/lib/aspose_slides_cloud/models/remove_shape.rb +229 -229
  143. data/lib/aspose_slides_cloud/models/remove_slide.rb +234 -234
  144. data/lib/aspose_slides_cloud/models/reorder_slide.rb +249 -249
  145. data/lib/aspose_slides_cloud/models/replace_text.rb +269 -269
  146. data/lib/aspose_slides_cloud/models/request_input_file.rb +235 -235
  147. data/lib/aspose_slides_cloud/models/reset_slide.rb +234 -234
  148. data/lib/aspose_slides_cloud/models/resource_base.rb +219 -219
  149. data/lib/aspose_slides_cloud/models/resource_uri.rb +237 -237
  150. data/lib/aspose_slides_cloud/models/response_output_file.rb +219 -219
  151. data/lib/aspose_slides_cloud/models/right_sub_superscript_element.rb +259 -0
  152. data/lib/aspose_slides_cloud/models/save.rb +266 -266
  153. data/lib/aspose_slides_cloud/models/save_shape.rb +276 -276
  154. data/lib/aspose_slides_cloud/models/save_slide.rb +301 -301
  155. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +225 -225
  156. data/lib/aspose_slides_cloud/models/scatter_series.rb +248 -248
  157. data/lib/aspose_slides_cloud/models/section.rb +234 -234
  158. data/lib/aspose_slides_cloud/models/sections.rb +209 -209
  159. data/lib/aspose_slides_cloud/models/series.rb +422 -422
  160. data/lib/aspose_slides_cloud/models/series_marker.rb +281 -281
  161. data/lib/aspose_slides_cloud/models/shape.rb +258 -255
  162. data/lib/aspose_slides_cloud/models/shape_base.rb +405 -375
  163. data/lib/aspose_slides_cloud/models/shape_bevel.rb +261 -0
  164. data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -44
  165. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +271 -286
  166. data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -41
  167. data/lib/aspose_slides_cloud/models/shapes.rb +209 -209
  168. data/lib/aspose_slides_cloud/models/shapes_alignment_type.rb +46 -46
  169. data/lib/aspose_slides_cloud/models/slide.rb +322 -322
  170. data/lib/aspose_slides_cloud/models/slide_animation.rb +221 -221
  171. data/lib/aspose_slides_cloud/models/slide_background.rb +266 -266
  172. data/lib/aspose_slides_cloud/models/slide_comment.rb +239 -239
  173. data/lib/aspose_slides_cloud/models/slide_comments.rb +209 -209
  174. data/lib/aspose_slides_cloud/models/slide_export_format.rb +60 -59
  175. data/lib/aspose_slides_cloud/models/slide_properties.rb +315 -315
  176. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +223 -223
  177. data/lib/aspose_slides_cloud/models/slides.rb +209 -209
  178. data/lib/aspose_slides_cloud/models/smart_art.rb +345 -342
  179. data/lib/aspose_slides_cloud/models/smart_art_node.rb +293 -293
  180. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +238 -235
  181. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +212 -212
  182. data/lib/aspose_slides_cloud/models/solid_fill.rb +229 -229
  183. data/lib/aspose_slides_cloud/models/special_slide_type.rb +41 -0
  184. data/lib/aspose_slides_cloud/models/split_document_result.rb +209 -209
  185. data/lib/aspose_slides_cloud/models/storage_exist.rb +212 -212
  186. data/lib/aspose_slides_cloud/models/storage_file.rb +257 -257
  187. data/lib/aspose_slides_cloud/models/subscript_element.rb +239 -0
  188. data/lib/aspose_slides_cloud/models/superscript_element.rb +239 -0
  189. data/lib/aspose_slides_cloud/models/svg_export_options.rb +336 -379
  190. data/lib/aspose_slides_cloud/models/swf_export_options.rb +446 -529
  191. data/lib/aspose_slides_cloud/models/table.rb +353 -350
  192. data/lib/aspose_slides_cloud/models/table_cell.rb +403 -403
  193. data/lib/aspose_slides_cloud/models/table_column.rb +212 -212
  194. data/lib/aspose_slides_cloud/models/table_row.rb +239 -239
  195. data/lib/aspose_slides_cloud/models/task.rb +240 -240
  196. data/lib/aspose_slides_cloud/models/text_element.rb +229 -0
  197. data/lib/aspose_slides_cloud/models/text_item.rb +217 -217
  198. data/lib/aspose_slides_cloud/models/text_items.rb +209 -209
  199. data/lib/aspose_slides_cloud/models/theme.rb +237 -237
  200. data/lib/aspose_slides_cloud/models/three_d_format.rb +331 -0
  201. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +370 -423
  202. data/lib/aspose_slides_cloud/models/update_background.rb +241 -241
  203. data/lib/aspose_slides_cloud/models/update_shape.rb +239 -239
  204. data/lib/aspose_slides_cloud/models/video_frame.rb +332 -329
  205. data/lib/aspose_slides_cloud/models/view_properties.rb +357 -357
  206. data/lib/aspose_slides_cloud/models/waterfall_chart_data_point.rb +206 -206
  207. data/lib/aspose_slides_cloud/models/waterfall_series.rb +247 -247
  208. data/lib/aspose_slides_cloud/models/xaml_export_options.rb +210 -0
  209. data/lib/aspose_slides_cloud/models/xps_export_options.rb +230 -243
  210. data/lib/aspose_slides_cloud/type_registry.rb +402 -323
  211. data/lib/aspose_slides_cloud/version.rb +25 -25
  212. data/lib/aspose_slides_cloud.rb +251 -212
  213. data/spec/api/slides_api_spec.rb +52044 -40353
  214. data/spec/extra/extra_spec.rb +202 -202
  215. data/spec/spec_utils.rb +188 -182
  216. data/testConfig.json +7 -7
  217. data/testRules.json +522 -517
  218. metadata +45 -6
@@ -0,0 +1,253 @@
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
+ # Mathematical paragraph that is a container for mathematical blocks
27
+ class MathParagraph
28
+ # List of math blocks
29
+ attr_accessor :math_block_list
30
+
31
+ # Justification of the math paragraph
32
+ attr_accessor :justification
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'math_block_list' => :'MathBlockList',
60
+ :'justification' => :'Justification',
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'math_block_list' => :'Array<BlockElement>',
68
+ :'justification' => :'String',
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
79
+
80
+ if attributes.has_key?(:'MathBlockList')
81
+ if (value = attributes[:'MathBlockList']).is_a?(Array)
82
+ self.math_block_list = value
83
+ end
84
+ end
85
+
86
+ if attributes.has_key?(:'Justification')
87
+ self.justification = attributes[:'Justification']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ justification_validator = EnumAttributeValidator.new('String', ['LeftJustified', 'RightJustified', 'Centered', 'CenteredAsGroup'])
102
+ return false unless justification_validator.valid?(@justification)
103
+ true
104
+ end
105
+
106
+ # Custom attribute writer method checking allowed values (enum).
107
+ # @param [Object] justification Object to be assigned
108
+ def justification=(justification)
109
+ validator = EnumAttributeValidator.new('String', ['LeftJustified', 'RightJustified', 'Centered', 'CenteredAsGroup'])
110
+ unless validator.valid?(justification)
111
+ fail ArgumentError, 'invalid value for "justification", must be one of #{validator.allowable_values}.'
112
+ end
113
+ @justification = justification
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ math_block_list == o.math_block_list &&
122
+ justification == o.justification
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Fixnum] Hash code
133
+ def hash
134
+ [math_block_list, justification].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ self.class.swagger_types.each_pair do |key, type|
143
+ mapKey = self.class.attribute_map[key]
144
+ if !mapKey.nil?
145
+ val = attributes[mapKey]
146
+ if val.nil?
147
+ mapKeyString = mapKey.to_s
148
+ mapKeyString[0] = mapKeyString[0].downcase
149
+ mapKey = mapKeyString.to_sym
150
+ val = attributes[mapKey]
151
+ end
152
+ if !val.nil?
153
+ if type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the the attribute
155
+ # is documented as an array but the input is not
156
+ if val.is_a?(Array)
157
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
158
+ end
159
+ else
160
+ self.send("#{key}=", _deserialize(type, val))
161
+ end
162
+ end
163
+ end
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ DateTime.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :BOOLEAN
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ temp_model = AsposeSlidesCloud.const_get(type).new
207
+ temp_model.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ next if value.nil?
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+ end
253
+ end
@@ -0,0 +1,337 @@
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
+ # Specifies the Matrix object,
27
+ class MatrixElement < MathElement
28
+ # Hide the placeholders for empty matrix elements
29
+ attr_accessor :hide_placeholders
30
+
31
+ # Specifies the vertical justification respect to surrounding text.
32
+ attr_accessor :base_justification
33
+
34
+ # Minimum column width in twips (1/20th of a point)
35
+ attr_accessor :min_column_width
36
+
37
+ # The type of horizontal spacing between columns of a matrix.
38
+ attr_accessor :column_gap_rule
39
+
40
+ # The value of horizontal spacing between columns of a matrix
41
+ attr_accessor :column_gap
42
+
43
+ # The type of vertical spacing between rows of a matrix
44
+ attr_accessor :row_gap_rule
45
+
46
+ # The value of vertical spacing between rows of a matrix;
47
+ attr_accessor :row_gap
48
+
49
+ # Matrix items
50
+ attr_accessor :items
51
+
52
+ class EnumAttributeValidator
53
+ attr_reader :datatype
54
+ attr_reader :allowable_values
55
+
56
+ def initialize(datatype, allowable_values)
57
+ @allowable_values = allowable_values.map do |value|
58
+ case datatype.to_s
59
+ when /Integer/i
60
+ value.to_i
61
+ when /Float/i
62
+ value.to_f
63
+ else
64
+ value
65
+ end
66
+ end
67
+ end
68
+
69
+ def valid?(value)
70
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
71
+ end
72
+ end
73
+
74
+ # Attribute mapping from ruby-style variable name to JSON key.
75
+ def self.attribute_map
76
+ super.merge({
77
+ :'hide_placeholders' => :'HidePlaceholders',
78
+ :'base_justification' => :'BaseJustification',
79
+ :'min_column_width' => :'MinColumnWidth',
80
+ :'column_gap_rule' => :'ColumnGapRule',
81
+ :'column_gap' => :'ColumnGap',
82
+ :'row_gap_rule' => :'RowGapRule',
83
+ :'row_gap' => :'RowGap',
84
+ :'items' => :'Items',
85
+ })
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.swagger_types
90
+ super.merge({
91
+ :'hide_placeholders' => :'BOOLEAN',
92
+ :'base_justification' => :'String',
93
+ :'min_column_width' => :'Integer',
94
+ :'column_gap_rule' => :'String',
95
+ :'column_gap' => :'Integer',
96
+ :'row_gap_rule' => :'String',
97
+ :'row_gap' => :'Integer',
98
+ :'items' => :'Array<Array<MathElement>>',
99
+ })
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ super
106
+
107
+ if attributes.has_key?(:'HidePlaceholders')
108
+ self.hide_placeholders = attributes[:'HidePlaceholders']
109
+ end
110
+
111
+ if attributes.has_key?(:'BaseJustification')
112
+ self.base_justification = attributes[:'BaseJustification']
113
+ end
114
+
115
+ if attributes.has_key?(:'MinColumnWidth')
116
+ self.min_column_width = attributes[:'MinColumnWidth']
117
+ end
118
+
119
+ if attributes.has_key?(:'ColumnGapRule')
120
+ self.column_gap_rule = attributes[:'ColumnGapRule']
121
+ end
122
+
123
+ if attributes.has_key?(:'ColumnGap')
124
+ self.column_gap = attributes[:'ColumnGap']
125
+ end
126
+
127
+ if attributes.has_key?(:'RowGapRule')
128
+ self.row_gap_rule = attributes[:'RowGapRule']
129
+ end
130
+
131
+ if attributes.has_key?(:'RowGap')
132
+ self.row_gap = attributes[:'RowGap']
133
+ end
134
+
135
+ if attributes.has_key?(:'Items')
136
+ if (value = attributes[:'Items']).is_a?(Array)
137
+ self.items = value
138
+ end
139
+ end
140
+ self.type = "Matrix"
141
+ end
142
+
143
+ # Show invalid properties with the reasons. Usually used together with valid?
144
+ # @return Array for valid properties with the reasons
145
+ def list_invalid_properties
146
+ invalid_properties = super
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ return false if !super
154
+ base_justification_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Top', 'Center', 'Bottom'])
155
+ return false unless base_justification_validator.valid?(@base_justification)
156
+ column_gap_rule_validator = EnumAttributeValidator.new('String', ['SingleSpacingGap', 'OneAndHalfSpacingGap', 'DoubleSpacingGap', 'Exactly', 'Multiple'])
157
+ return false unless column_gap_rule_validator.valid?(@column_gap_rule)
158
+ row_gap_rule_validator = EnumAttributeValidator.new('String', ['SingleSpacingGap', 'OneAndHalfSpacingGap', 'DoubleSpacingGap', 'Exactly', 'Multiple'])
159
+ return false unless row_gap_rule_validator.valid?(@row_gap_rule)
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method checking allowed values (enum).
164
+ # @param [Object] base_justification Object to be assigned
165
+ def base_justification=(base_justification)
166
+ validator = EnumAttributeValidator.new('String', ['NotDefined', 'Top', 'Center', 'Bottom'])
167
+ unless validator.valid?(base_justification)
168
+ fail ArgumentError, 'invalid value for "base_justification", must be one of #{validator.allowable_values}.'
169
+ end
170
+ @base_justification = base_justification
171
+ end
172
+
173
+ # Custom attribute writer method checking allowed values (enum).
174
+ # @param [Object] column_gap_rule Object to be assigned
175
+ def column_gap_rule=(column_gap_rule)
176
+ validator = EnumAttributeValidator.new('String', ['SingleSpacingGap', 'OneAndHalfSpacingGap', 'DoubleSpacingGap', 'Exactly', 'Multiple'])
177
+ unless validator.valid?(column_gap_rule)
178
+ fail ArgumentError, 'invalid value for "column_gap_rule", must be one of #{validator.allowable_values}.'
179
+ end
180
+ @column_gap_rule = column_gap_rule
181
+ end
182
+
183
+ # Custom attribute writer method checking allowed values (enum).
184
+ # @param [Object] row_gap_rule Object to be assigned
185
+ def row_gap_rule=(row_gap_rule)
186
+ validator = EnumAttributeValidator.new('String', ['SingleSpacingGap', 'OneAndHalfSpacingGap', 'DoubleSpacingGap', 'Exactly', 'Multiple'])
187
+ unless validator.valid?(row_gap_rule)
188
+ fail ArgumentError, 'invalid value for "row_gap_rule", must be one of #{validator.allowable_values}.'
189
+ end
190
+ @row_gap_rule = row_gap_rule
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ type == o.type &&
199
+ hide_placeholders == o.hide_placeholders &&
200
+ base_justification == o.base_justification &&
201
+ min_column_width == o.min_column_width &&
202
+ column_gap_rule == o.column_gap_rule &&
203
+ column_gap == o.column_gap &&
204
+ row_gap_rule == o.row_gap_rule &&
205
+ row_gap == o.row_gap &&
206
+ items == o.items
207
+ end
208
+
209
+ # @see the `==` method
210
+ # @param [Object] Object to be compared
211
+ def eql?(o)
212
+ self == o
213
+ end
214
+
215
+ # Calculates hash code according to all attributes.
216
+ # @return [Fixnum] Hash code
217
+ def hash
218
+ [type, hide_placeholders, base_justification, min_column_width, column_gap_rule, column_gap, row_gap_rule, row_gap, items].hash
219
+ end
220
+
221
+ # Builds the object from hash
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ # @return [Object] Returns the model itself
224
+ def build_from_hash(attributes)
225
+ return nil unless attributes.is_a?(Hash)
226
+ self.class.swagger_types.each_pair do |key, type|
227
+ mapKey = self.class.attribute_map[key]
228
+ if !mapKey.nil?
229
+ val = attributes[mapKey]
230
+ if val.nil?
231
+ mapKeyString = mapKey.to_s
232
+ mapKeyString[0] = mapKeyString[0].downcase
233
+ mapKey = mapKeyString.to_sym
234
+ val = attributes[mapKey]
235
+ end
236
+ if !val.nil?
237
+ if type =~ /\AArray<(.*)>/i
238
+ # check to ensure the input is an array given that the the attribute
239
+ # is documented as an array but the input is not
240
+ if val.is_a?(Array)
241
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
242
+ end
243
+ else
244
+ self.send("#{key}=", _deserialize(type, val))
245
+ end
246
+ end
247
+ end
248
+ end
249
+
250
+ self
251
+ end
252
+
253
+ # Deserializes the data based on type
254
+ # @param string type Data type
255
+ # @param string value Value to be deserialized
256
+ # @return [Object] Deserialized data
257
+ def _deserialize(type, value)
258
+ case type.to_sym
259
+ when :DateTime
260
+ DateTime.parse(value)
261
+ when :Date
262
+ Date.parse(value)
263
+ when :String
264
+ value.to_s
265
+ when :Integer
266
+ value.to_i
267
+ when :Float
268
+ value.to_f
269
+ when :BOOLEAN
270
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
271
+ true
272
+ else
273
+ false
274
+ end
275
+ when :Object
276
+ # generic object (usually a Hash), return directly
277
+ value
278
+ when /\AArray<(?<inner_type>.+)>\z/
279
+ inner_type = Regexp.last_match[:inner_type]
280
+ value.map { |v| _deserialize(inner_type, v) }
281
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
282
+ k_type = Regexp.last_match[:k_type]
283
+ v_type = Regexp.last_match[:v_type]
284
+ {}.tap do |hash|
285
+ value.each do |k, v|
286
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
+ end
288
+ end
289
+ else # model
290
+ temp_model = AsposeSlidesCloud.const_get(type).new
291
+ temp_model.build_from_hash(value)
292
+ end
293
+ end
294
+
295
+ # Returns the string representation of the object
296
+ # @return [String] String presentation of the object
297
+ def to_s
298
+ to_hash.to_s
299
+ end
300
+
301
+ # to_body is an alias to to_hash (backward compatibility)
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_body
304
+ to_hash
305
+ end
306
+
307
+ # Returns the object in the form of hash
308
+ # @return [Hash] Returns the object in the form of hash
309
+ def to_hash
310
+ hash = {}
311
+ self.class.attribute_map.each_pair do |attr, param|
312
+ value = self.send(attr)
313
+ next if value.nil?
314
+ hash[param] = _to_hash(value)
315
+ end
316
+ hash
317
+ end
318
+
319
+ # Outputs non-array value in the form of hash
320
+ # For object, use to_hash. Otherwise, just return the value
321
+ # @param [Object] value Any valid value
322
+ # @return [Hash] Returns the value in the form of hash
323
+ def _to_hash(value)
324
+ if value.is_a?(Array)
325
+ value.compact.map { |v| _to_hash(v) }
326
+ elsif value.is_a?(Hash)
327
+ {}.tap do |hash|
328
+ value.each { |k, v| hash[k] = _to_hash(v) }
329
+ end
330
+ elsif value.respond_to? :to_hash
331
+ value.to_hash
332
+ else
333
+ value
334
+ end
335
+ end
336
+ end
337
+ end