aspose_slides_cloud 1.0.3 → 19.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE +2 -3
  5. data/README.md +7 -39
  6. data/Rakefile +8 -0
  7. data/TestData/TemplateCV.pptx +0 -0
  8. data/TestData/TemplatingCVDataWithBase64.xml +23 -0
  9. data/TestData/placeholders.pptx +0 -0
  10. data/TestData/test-unprotected.ppt +0 -0
  11. data/TestData/test.ppt +0 -0
  12. data/aspose_slides_cloud.gemspec +42 -14
  13. data/lib/aspose_slides_cloud.rb +183 -78
  14. data/lib/aspose_slides_cloud/api/slides_api.rb +6906 -2256
  15. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +3067 -0
  16. data/lib/aspose_slides_cloud/api_client.rb +273 -183
  17. data/lib/aspose_slides_cloud/api_error.rb +29 -5
  18. data/lib/aspose_slides_cloud/configuration.rb +93 -81
  19. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +261 -0
  20. data/lib/aspose_slides_cloud/models/add_master_slide.rb +276 -0
  21. data/lib/aspose_slides_cloud/models/add_shape.rb +256 -0
  22. data/lib/aspose_slides_cloud/models/add_slide.rb +286 -0
  23. data/lib/aspose_slides_cloud/models/api_info.rb +205 -0
  24. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +257 -22
  25. data/lib/aspose_slides_cloud/models/audio_frame.rb +573 -0
  26. data/lib/aspose_slides_cloud/models/axes.rb +225 -0
  27. data/lib/aspose_slides_cloud/models/axis.rb +847 -0
  28. data/lib/aspose_slides_cloud/models/base64_input_file.rb +256 -0
  29. data/lib/aspose_slides_cloud/models/blur_effect.rb +215 -0
  30. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +230 -0
  31. data/lib/aspose_slides_cloud/models/bubble_series.rb +463 -0
  32. data/lib/aspose_slides_cloud/models/chart.rb +543 -0
  33. data/lib/aspose_slides_cloud/models/chart_title.rb +210 -0
  34. data/lib/aspose_slides_cloud/models/chart_wall.rb +279 -0
  35. data/lib/aspose_slides_cloud/models/color_scheme.rb +258 -84
  36. data/lib/aspose_slides_cloud/models/connector.rb +487 -0
  37. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +171 -13
  38. data/lib/aspose_slides_cloud/models/disc_usage.rb +215 -0
  39. data/lib/aspose_slides_cloud/models/document.rb +222 -46
  40. data/lib/aspose_slides_cloud/models/document_properties.rb +188 -36
  41. data/lib/aspose_slides_cloud/models/document_property.rb +209 -48
  42. data/lib/aspose_slides_cloud/models/document_replace_result.rb +272 -0
  43. data/lib/aspose_slides_cloud/models/effect.rb +412 -0
  44. data/lib/aspose_slides_cloud/models/effect_format.rb +265 -0
  45. data/lib/aspose_slides_cloud/models/error.rb +225 -0
  46. data/lib/aspose_slides_cloud/models/error_details.rb +210 -0
  47. data/lib/aspose_slides_cloud/models/export_format.rb +59 -0
  48. data/lib/aspose_slides_cloud/models/export_options.rb +194 -0
  49. data/lib/aspose_slides_cloud/models/file_version.rb +270 -0
  50. data/lib/aspose_slides_cloud/models/file_versions.rb +197 -0
  51. data/lib/aspose_slides_cloud/models/files_list.rb +197 -0
  52. data/lib/aspose_slides_cloud/models/files_upload_result.rb +209 -0
  53. data/lib/aspose_slides_cloud/models/fill_format.rb +204 -13
  54. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +234 -0
  55. data/lib/aspose_slides_cloud/models/font_scheme.rb +204 -48
  56. data/lib/aspose_slides_cloud/models/font_set.rb +184 -22
  57. data/lib/aspose_slides_cloud/models/format_scheme.rb +210 -52
  58. data/lib/aspose_slides_cloud/models/geometry_shape.rb +439 -0
  59. data/lib/aspose_slides_cloud/models/glow_effect.rb +210 -0
  60. data/lib/aspose_slides_cloud/models/gradient_fill.rb +359 -0
  61. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +210 -0
  62. data/lib/aspose_slides_cloud/models/graphical_object.rb +422 -0
  63. data/lib/aspose_slides_cloud/models/group_shape.rb +422 -0
  64. data/lib/aspose_slides_cloud/models/html_export_options.rb +392 -25
  65. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +195 -0
  66. data/lib/aspose_slides_cloud/models/image.rb +216 -42
  67. data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -0
  68. data/lib/aspose_slides_cloud/models/image_export_options.rb +298 -0
  69. data/lib/aspose_slides_cloud/models/images.rb +188 -36
  70. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +240 -0
  71. data/lib/aspose_slides_cloud/models/input.rb +215 -0
  72. data/lib/aspose_slides_cloud/models/input_file.rb +238 -0
  73. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +212 -0
  74. data/lib/aspose_slides_cloud/models/layout_slide.rb +288 -0
  75. data/lib/aspose_slides_cloud/models/layout_slides.rb +219 -0
  76. data/lib/aspose_slides_cloud/models/legend.rb +339 -0
  77. data/lib/aspose_slides_cloud/models/line_format.rb +349 -54
  78. data/lib/aspose_slides_cloud/models/master_slide.rb +241 -0
  79. data/lib/aspose_slides_cloud/models/master_slides.rb +219 -0
  80. data/lib/aspose_slides_cloud/models/merge.rb +248 -0
  81. data/lib/aspose_slides_cloud/models/merging_source.rb +207 -0
  82. data/lib/aspose_slides_cloud/models/no_fill.rb +236 -0
  83. data/lib/aspose_slides_cloud/models/notes_slide.rb +227 -0
  84. data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -0
  85. data/lib/aspose_slides_cloud/models/object_exist.rb +215 -0
  86. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +447 -0
  87. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +200 -0
  88. data/lib/aspose_slides_cloud/models/one_value_series.rb +463 -0
  89. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +171 -13
  90. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +240 -0
  91. data/lib/aspose_slides_cloud/models/output_file.rb +228 -0
  92. data/lib/aspose_slides_cloud/models/paragraph.rb +494 -34
  93. data/lib/aspose_slides_cloud/models/paragraphs.rb +187 -35
  94. data/lib/aspose_slides_cloud/models/path_input_file.rb +266 -0
  95. data/lib/aspose_slides_cloud/models/path_output_file.rb +256 -0
  96. data/lib/aspose_slides_cloud/models/pattern_fill.rb +283 -0
  97. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +467 -49
  98. data/lib/aspose_slides_cloud/models/picture_fill.rb +368 -0
  99. data/lib/aspose_slides_cloud/models/picture_frame.rb +459 -0
  100. data/lib/aspose_slides_cloud/models/pipeline.rb +207 -0
  101. data/lib/aspose_slides_cloud/models/placeholder.rb +294 -56
  102. data/lib/aspose_slides_cloud/models/placeholders.rb +188 -36
  103. data/lib/aspose_slides_cloud/models/plot_area.rb +324 -0
  104. data/lib/aspose_slides_cloud/models/portion.rb +564 -46
  105. data/lib/aspose_slides_cloud/models/portions.rb +219 -0
  106. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +246 -0
  107. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +188 -18
  108. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +185 -15
  109. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +274 -0
  110. data/lib/aspose_slides_cloud/models/reflection_effect.rb +429 -0
  111. data/lib/aspose_slides_cloud/models/remove_shape.rb +246 -0
  112. data/lib/aspose_slides_cloud/models/remove_slide.rb +251 -0
  113. data/lib/aspose_slides_cloud/models/reorder_slide.rb +266 -0
  114. data/lib/aspose_slides_cloud/models/replace_text.rb +286 -0
  115. data/lib/aspose_slides_cloud/models/request_input_file.rb +261 -0
  116. data/lib/aspose_slides_cloud/models/reset_slide.rb +251 -0
  117. data/lib/aspose_slides_cloud/models/resource_base.rb +207 -0
  118. data/lib/aspose_slides_cloud/models/resource_uri.rb +190 -26
  119. data/lib/aspose_slides_cloud/models/resource_uri_element.rb +171 -13
  120. data/lib/aspose_slides_cloud/models/response_output_file.rb +236 -0
  121. data/lib/aspose_slides_cloud/models/save.rb +283 -0
  122. data/lib/aspose_slides_cloud/models/save_shape.rb +293 -0
  123. data/lib/aspose_slides_cloud/models/save_slide.rb +318 -0
  124. data/lib/aspose_slides_cloud/models/scale_type.rb +41 -0
  125. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +215 -0
  126. data/lib/aspose_slides_cloud/models/scatter_series.rb +463 -0
  127. data/lib/aspose_slides_cloud/models/series.rb +424 -0
  128. data/lib/aspose_slides_cloud/models/series_marker.rb +279 -0
  129. data/lib/aspose_slides_cloud/models/shape.rb +398 -100
  130. data/lib/aspose_slides_cloud/models/shape_base.rb +406 -0
  131. data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -0
  132. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +274 -0
  133. data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -0
  134. data/lib/aspose_slides_cloud/models/shapes.rb +219 -0
  135. data/lib/aspose_slides_cloud/models/size_type.rb +55 -0
  136. data/lib/aspose_slides_cloud/models/slide.rb +277 -66
  137. data/lib/aspose_slides_cloud/models/slide_animation.rb +231 -0
  138. data/lib/aspose_slides_cloud/models/slide_background.rb +245 -42
  139. data/lib/aspose_slides_cloud/models/slide_comment.rb +198 -24
  140. data/lib/aspose_slides_cloud/models/slide_comments.rb +188 -36
  141. data/lib/aspose_slides_cloud/models/slide_export_format.rb +58 -0
  142. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +347 -0
  143. data/lib/aspose_slides_cloud/models/slides.rb +188 -36
  144. data/lib/aspose_slides_cloud/models/smart_art.rb +530 -0
  145. data/lib/aspose_slides_cloud/models/smart_art_node.rb +281 -0
  146. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +422 -0
  147. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +200 -0
  148. data/lib/aspose_slides_cloud/models/solid_fill.rb +246 -0
  149. data/lib/aspose_slides_cloud/models/split_document_result.rb +188 -36
  150. data/lib/aspose_slides_cloud/models/storage_exist.rb +200 -0
  151. data/lib/aspose_slides_cloud/models/storage_file.rb +245 -0
  152. data/lib/aspose_slides_cloud/models/svg_export_options.rb +378 -0
  153. data/lib/aspose_slides_cloud/models/swf_export_options.rb +528 -0
  154. data/lib/aspose_slides_cloud/models/table.rb +578 -0
  155. data/lib/aspose_slides_cloud/models/table_cell.rb +431 -0
  156. data/lib/aspose_slides_cloud/models/table_column.rb +200 -0
  157. data/lib/aspose_slides_cloud/models/table_row.rb +227 -0
  158. data/lib/aspose_slides_cloud/models/task.rb +228 -0
  159. data/lib/aspose_slides_cloud/models/text_item.rb +178 -18
  160. data/lib/aspose_slides_cloud/models/text_items.rb +188 -36
  161. data/lib/aspose_slides_cloud/models/theme.rb +210 -52
  162. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +385 -40
  163. data/lib/aspose_slides_cloud/models/update_background.rb +258 -0
  164. data/lib/aspose_slides_cloud/models/update_shape.rb +256 -0
  165. data/lib/aspose_slides_cloud/models/video_frame.rb +543 -0
  166. data/lib/aspose_slides_cloud/models/xps_export_options.rb +242 -0
  167. data/lib/aspose_slides_cloud/version.rb +23 -1
  168. data/spec/api/slides_api_spec.rb +24188 -0
  169. data/spec/extra/extra_spec.rb +84 -0
  170. data/spec/spec_helper.rb +122 -0
  171. data/spec/spec_utils.rb +154 -0
  172. data/testConfig.json +7 -0
  173. data/testRules.json +333 -0
  174. metadata +273 -61
  175. data/lib/aspose_slides_cloud/models/base_object.rb +0 -86
  176. data/lib/aspose_slides_cloud/models/base_response.rb +0 -53
  177. data/lib/aspose_slides_cloud/models/color.rb +0 -29
  178. data/lib/aspose_slides_cloud/models/color_scheme_response.rb +0 -61
  179. data/lib/aspose_slides_cloud/models/common_response.rb +0 -53
  180. data/lib/aspose_slides_cloud/models/document_properties_response.rb +0 -61
  181. data/lib/aspose_slides_cloud/models/document_property_response.rb +0 -61
  182. data/lib/aspose_slides_cloud/models/document_response.rb +0 -61
  183. data/lib/aspose_slides_cloud/models/font_scheme_response.rb +0 -61
  184. data/lib/aspose_slides_cloud/models/format_scheme_response.rb +0 -61
  185. data/lib/aspose_slides_cloud/models/images_response.rb +0 -61
  186. data/lib/aspose_slides_cloud/models/new_shape_response.rb +0 -61
  187. data/lib/aspose_slides_cloud/models/paragraph_portion_response.rb +0 -61
  188. data/lib/aspose_slides_cloud/models/placeholder_response.rb +0 -61
  189. data/lib/aspose_slides_cloud/models/placeholders_response.rb +0 -61
  190. data/lib/aspose_slides_cloud/models/presentation_string_replace_response.rb +0 -69
  191. data/lib/aspose_slides_cloud/models/shape_list.rb +0 -67
  192. data/lib/aspose_slides_cloud/models/shape_paragraph_response.rb +0 -61
  193. data/lib/aspose_slides_cloud/models/shape_paragraphs_response.rb +0 -61
  194. data/lib/aspose_slides_cloud/models/shape_response.rb +0 -61
  195. data/lib/aspose_slides_cloud/models/slide_background_response.rb +0 -61
  196. data/lib/aspose_slides_cloud/models/slide_comments_response.rb +0 -61
  197. data/lib/aspose_slides_cloud/models/slide_list_response.rb +0 -61
  198. data/lib/aspose_slides_cloud/models/slide_response.rb +0 -61
  199. data/lib/aspose_slides_cloud/models/slide_string_replace_response.rb +0 -69
  200. data/lib/aspose_slides_cloud/models/split_document_response.rb +0 -61
  201. data/lib/aspose_slides_cloud/models/text_items_response.rb +0 -61
  202. data/lib/aspose_slides_cloud/models/theme_response.rb +0 -61
  203. data/test/slides_tests.rb +0 -580
@@ -0,0 +1,41 @@
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
+ class ScaleType
27
+
28
+ DO_NOT_SCALE = "DoNotScale".freeze
29
+ ENSURE_FIT = "EnsureFit".freeze
30
+ MAXIMIZE = "Maximize".freeze
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ constantValues = ScaleType.constants.select { |c| ScaleType::const_get(c) == value }
37
+ raise "Invalid ENUM value #{value} for class #ScaleType" if constantValues.empty?
38
+ value
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,215 @@
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
+ # Scatter chart (two-dimensional) data point
27
+ class ScatterChartDataPoint
28
+ # X-value
29
+ attr_accessor :x_value
30
+
31
+ # Y-value
32
+ attr_accessor :y_value
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'x_value' => :'XValue',
38
+ :'y_value' => :'YValue'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'x_value' => :'Float',
46
+ :'y_value' => :'Float'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'XValue')
59
+ self.x_value = attributes[:'XValue']
60
+ end
61
+
62
+ if attributes.has_key?(:'YValue')
63
+ self.y_value = attributes[:'YValue']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if @x_value.nil?
72
+ invalid_properties.push('invalid value for "x_value", x_value cannot be nil.')
73
+ end
74
+
75
+ if @y_value.nil?
76
+ invalid_properties.push('invalid value for "y_value", y_value cannot be nil.')
77
+ end
78
+
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ return false if @x_value.nil?
86
+ return false if @y_value.nil?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ x_value == o.x_value &&
96
+ y_value == o.y_value
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [x_value, y_value].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = AsposeSlidesCloud.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,463 @@
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
+ # A scatter series
27
+ class ScatterSeries
28
+ # Series type.
29
+ attr_accessor :type
30
+
31
+ # Series name.
32
+ attr_accessor :name
33
+
34
+ # True if each data marker in the series has a different color.
35
+ attr_accessor :is_color_varied
36
+
37
+ # Invert solid color for the series.
38
+ attr_accessor :inverted_solid_fill_color
39
+
40
+ # True if curve smoothing is turned on. Applies only to line and scatter connected by lines charts.
41
+ attr_accessor :smooth
42
+
43
+ # True if the series is plotted on second value axis.
44
+ attr_accessor :plot_on_second_axis
45
+
46
+ # Series order.
47
+ attr_accessor :order
48
+
49
+ # The number format for the series y values.
50
+ attr_accessor :number_format_of_y_values
51
+
52
+ # The number format for the series x values.
53
+ attr_accessor :number_format_of_x_values
54
+
55
+ # The number format for the series values.
56
+ attr_accessor :number_format_of_values
57
+
58
+ # The number format for the series bubble sizes.
59
+ attr_accessor :number_format_of_bubble_sizes
60
+
61
+ # True if the series shall invert its colors if the value is negative. Applies to bar, column and bubble series.
62
+ attr_accessor :invert_if_negative
63
+
64
+ # The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
65
+ attr_accessor :explosion
66
+
67
+ # Series marker.
68
+ attr_accessor :marker
69
+
70
+ # Fill properties set for the series.
71
+ attr_accessor :fill_format
72
+
73
+ # Effect properties set for the series.
74
+ attr_accessor :effect_format
75
+
76
+ # Line properties set for the series.
77
+ attr_accessor :line_format
78
+
79
+ # Data point type.
80
+ attr_accessor :data_point_type
81
+
82
+ # Gets or sets the values.
83
+ attr_accessor :data_points
84
+
85
+ class EnumAttributeValidator
86
+ attr_reader :datatype
87
+ attr_reader :allowable_values
88
+
89
+ def initialize(datatype, allowable_values)
90
+ @allowable_values = allowable_values.map do |value|
91
+ case datatype.to_s
92
+ when /Integer/i
93
+ value.to_i
94
+ when /Float/i
95
+ value.to_f
96
+ else
97
+ value
98
+ end
99
+ end
100
+ end
101
+
102
+ def valid?(value)
103
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
104
+ end
105
+ end
106
+
107
+ # Attribute mapping from ruby-style variable name to JSON key.
108
+ def self.attribute_map
109
+ {
110
+ :'type' => :'Type',
111
+ :'name' => :'Name',
112
+ :'is_color_varied' => :'IsColorVaried',
113
+ :'inverted_solid_fill_color' => :'InvertedSolidFillColor',
114
+ :'smooth' => :'Smooth',
115
+ :'plot_on_second_axis' => :'PlotOnSecondAxis',
116
+ :'order' => :'Order',
117
+ :'number_format_of_y_values' => :'NumberFormatOfYValues',
118
+ :'number_format_of_x_values' => :'NumberFormatOfXValues',
119
+ :'number_format_of_values' => :'NumberFormatOfValues',
120
+ :'number_format_of_bubble_sizes' => :'NumberFormatOfBubbleSizes',
121
+ :'invert_if_negative' => :'InvertIfNegative',
122
+ :'explosion' => :'Explosion',
123
+ :'marker' => :'Marker',
124
+ :'fill_format' => :'FillFormat',
125
+ :'effect_format' => :'EffectFormat',
126
+ :'line_format' => :'LineFormat',
127
+ :'data_point_type' => :'DataPointType',
128
+ :'data_points' => :'DataPoints'
129
+ }
130
+ end
131
+
132
+ # Attribute type mapping.
133
+ def self.swagger_types
134
+ {
135
+ :'type' => :'String',
136
+ :'name' => :'String',
137
+ :'is_color_varied' => :'BOOLEAN',
138
+ :'inverted_solid_fill_color' => :'String',
139
+ :'smooth' => :'BOOLEAN',
140
+ :'plot_on_second_axis' => :'BOOLEAN',
141
+ :'order' => :'Integer',
142
+ :'number_format_of_y_values' => :'String',
143
+ :'number_format_of_x_values' => :'String',
144
+ :'number_format_of_values' => :'String',
145
+ :'number_format_of_bubble_sizes' => :'String',
146
+ :'invert_if_negative' => :'BOOLEAN',
147
+ :'explosion' => :'Integer',
148
+ :'marker' => :'SeriesMarker',
149
+ :'fill_format' => :'FillFormat',
150
+ :'effect_format' => :'EffectFormat',
151
+ :'line_format' => :'LineFormat',
152
+ :'data_point_type' => :'String',
153
+ :'data_points' => :'Array<ScatterChartDataPoint>'
154
+ }
155
+ end
156
+
157
+ # Initializes the object
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ def initialize(attributes = {})
160
+ return unless attributes.is_a?(Hash)
161
+
162
+ # convert string to symbol for hash key
163
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
164
+
165
+ if attributes.has_key?(:'Type')
166
+ self.type = attributes[:'Type']
167
+ end
168
+
169
+ if attributes.has_key?(:'Name')
170
+ self.name = attributes[:'Name']
171
+ end
172
+
173
+ if attributes.has_key?(:'IsColorVaried')
174
+ self.is_color_varied = attributes[:'IsColorVaried']
175
+ end
176
+
177
+ if attributes.has_key?(:'InvertedSolidFillColor')
178
+ self.inverted_solid_fill_color = attributes[:'InvertedSolidFillColor']
179
+ end
180
+
181
+ if attributes.has_key?(:'Smooth')
182
+ self.smooth = attributes[:'Smooth']
183
+ end
184
+
185
+ if attributes.has_key?(:'PlotOnSecondAxis')
186
+ self.plot_on_second_axis = attributes[:'PlotOnSecondAxis']
187
+ end
188
+
189
+ if attributes.has_key?(:'Order')
190
+ self.order = attributes[:'Order']
191
+ end
192
+
193
+ if attributes.has_key?(:'NumberFormatOfYValues')
194
+ self.number_format_of_y_values = attributes[:'NumberFormatOfYValues']
195
+ end
196
+
197
+ if attributes.has_key?(:'NumberFormatOfXValues')
198
+ self.number_format_of_x_values = attributes[:'NumberFormatOfXValues']
199
+ end
200
+
201
+ if attributes.has_key?(:'NumberFormatOfValues')
202
+ self.number_format_of_values = attributes[:'NumberFormatOfValues']
203
+ end
204
+
205
+ if attributes.has_key?(:'NumberFormatOfBubbleSizes')
206
+ self.number_format_of_bubble_sizes = attributes[:'NumberFormatOfBubbleSizes']
207
+ end
208
+
209
+ if attributes.has_key?(:'InvertIfNegative')
210
+ self.invert_if_negative = attributes[:'InvertIfNegative']
211
+ end
212
+
213
+ if attributes.has_key?(:'Explosion')
214
+ self.explosion = attributes[:'Explosion']
215
+ end
216
+
217
+ if attributes.has_key?(:'Marker')
218
+ self.marker = attributes[:'Marker']
219
+ end
220
+
221
+ if attributes.has_key?(:'FillFormat')
222
+ self.fill_format = attributes[:'FillFormat']
223
+ end
224
+
225
+ if attributes.has_key?(:'EffectFormat')
226
+ self.effect_format = attributes[:'EffectFormat']
227
+ end
228
+
229
+ if attributes.has_key?(:'LineFormat')
230
+ self.line_format = attributes[:'LineFormat']
231
+ end
232
+
233
+ if attributes.has_key?(:'DataPointType')
234
+ self.data_point_type = attributes[:'DataPointType']
235
+ end
236
+
237
+ if attributes.has_key?(:'DataPoints')
238
+ if (value = attributes[:'DataPoints']).is_a?(Array)
239
+ self.data_points = value
240
+ end
241
+ end
242
+ end
243
+
244
+ # Show invalid properties with the reasons. Usually used together with valid?
245
+ # @return Array for valid properties with the reasons
246
+ def list_invalid_properties
247
+ invalid_properties = Array.new
248
+ if @type.nil?
249
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
250
+ end
251
+
252
+ if @is_color_varied.nil?
253
+ invalid_properties.push('invalid value for "is_color_varied", is_color_varied cannot be nil.')
254
+ end
255
+
256
+ if @smooth.nil?
257
+ invalid_properties.push('invalid value for "smooth", smooth cannot be nil.')
258
+ end
259
+
260
+ if @plot_on_second_axis.nil?
261
+ invalid_properties.push('invalid value for "plot_on_second_axis", plot_on_second_axis cannot be nil.')
262
+ end
263
+
264
+ if @order.nil?
265
+ invalid_properties.push('invalid value for "order", order cannot be nil.')
266
+ end
267
+
268
+ if @invert_if_negative.nil?
269
+ invalid_properties.push('invalid value for "invert_if_negative", invert_if_negative cannot be nil.')
270
+ end
271
+
272
+ if @explosion.nil?
273
+ invalid_properties.push('invalid value for "explosion", explosion cannot be nil.')
274
+ end
275
+
276
+ if @data_point_type.nil?
277
+ invalid_properties.push('invalid value for "data_point_type", data_point_type cannot be nil.')
278
+ end
279
+
280
+ invalid_properties
281
+ end
282
+
283
+ # Check to see if the all the properties in the model are valid
284
+ # @return true if the model is valid
285
+ def valid?
286
+ return false if @type.nil?
287
+ type_validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes'])
288
+ return false unless type_validator.valid?(@type)
289
+ return false if @is_color_varied.nil?
290
+ return false if @smooth.nil?
291
+ return false if @plot_on_second_axis.nil?
292
+ return false if @order.nil?
293
+ return false if @invert_if_negative.nil?
294
+ return false if @explosion.nil?
295
+ return false if @data_point_type.nil?
296
+ data_point_type_validator = EnumAttributeValidator.new('String', ['OneValue', 'Scatter', 'Bubble'])
297
+ return false unless data_point_type_validator.valid?(@data_point_type)
298
+ true
299
+ end
300
+
301
+ # Custom attribute writer method checking allowed values (enum).
302
+ # @param [Object] type Object to be assigned
303
+ def type=(type)
304
+ validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes'])
305
+ unless validator.valid?(type)
306
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
307
+ end
308
+ @type = type
309
+ end
310
+
311
+ # Custom attribute writer method checking allowed values (enum).
312
+ # @param [Object] data_point_type Object to be assigned
313
+ def data_point_type=(data_point_type)
314
+ validator = EnumAttributeValidator.new('String', ['OneValue', 'Scatter', 'Bubble'])
315
+ unless validator.valid?(data_point_type)
316
+ fail ArgumentError, 'invalid value for "data_point_type", must be one of #{validator.allowable_values}.'
317
+ end
318
+ @data_point_type = data_point_type
319
+ end
320
+
321
+ # Checks equality by comparing each attribute.
322
+ # @param [Object] Object to be compared
323
+ def ==(o)
324
+ return true if self.equal?(o)
325
+ self.class == o.class &&
326
+ type == o.type &&
327
+ name == o.name &&
328
+ is_color_varied == o.is_color_varied &&
329
+ inverted_solid_fill_color == o.inverted_solid_fill_color &&
330
+ smooth == o.smooth &&
331
+ plot_on_second_axis == o.plot_on_second_axis &&
332
+ order == o.order &&
333
+ number_format_of_y_values == o.number_format_of_y_values &&
334
+ number_format_of_x_values == o.number_format_of_x_values &&
335
+ number_format_of_values == o.number_format_of_values &&
336
+ number_format_of_bubble_sizes == o.number_format_of_bubble_sizes &&
337
+ invert_if_negative == o.invert_if_negative &&
338
+ explosion == o.explosion &&
339
+ marker == o.marker &&
340
+ fill_format == o.fill_format &&
341
+ effect_format == o.effect_format &&
342
+ line_format == o.line_format &&
343
+ data_point_type == o.data_point_type &&
344
+ data_points == o.data_points
345
+ end
346
+
347
+ # @see the `==` method
348
+ # @param [Object] Object to be compared
349
+ def eql?(o)
350
+ self == o
351
+ end
352
+
353
+ # Calculates hash code according to all attributes.
354
+ # @return [Fixnum] Hash code
355
+ def hash
356
+ [type, name, is_color_varied, inverted_solid_fill_color, smooth, plot_on_second_axis, order, number_format_of_y_values, number_format_of_x_values, number_format_of_values, number_format_of_bubble_sizes, invert_if_negative, explosion, marker, fill_format, effect_format, line_format, data_point_type, data_points].hash
357
+ end
358
+
359
+ # Builds the object from hash
360
+ # @param [Hash] attributes Model attributes in the form of hash
361
+ # @return [Object] Returns the model itself
362
+ def build_from_hash(attributes)
363
+ return nil unless attributes.is_a?(Hash)
364
+ self.class.swagger_types.each_pair do |key, type|
365
+ if type =~ /\AArray<(.*)>/i
366
+ # check to ensure the input is an array given that the the attribute
367
+ # is documented as an array but the input is not
368
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
369
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
370
+ end
371
+ elsif !attributes[self.class.attribute_map[key]].nil?
372
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
373
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
374
+ end
375
+
376
+ self
377
+ end
378
+
379
+ # Deserializes the data based on type
380
+ # @param string type Data type
381
+ # @param string value Value to be deserialized
382
+ # @return [Object] Deserialized data
383
+ def _deserialize(type, value)
384
+ case type.to_sym
385
+ when :DateTime
386
+ DateTime.parse(value)
387
+ when :Date
388
+ Date.parse(value)
389
+ when :String
390
+ value.to_s
391
+ when :Integer
392
+ value.to_i
393
+ when :Float
394
+ value.to_f
395
+ when :BOOLEAN
396
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
397
+ true
398
+ else
399
+ false
400
+ end
401
+ when :Object
402
+ # generic object (usually a Hash), return directly
403
+ value
404
+ when /\AArray<(?<inner_type>.+)>\z/
405
+ inner_type = Regexp.last_match[:inner_type]
406
+ value.map { |v| _deserialize(inner_type, v) }
407
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
408
+ k_type = Regexp.last_match[:k_type]
409
+ v_type = Regexp.last_match[:v_type]
410
+ {}.tap do |hash|
411
+ value.each do |k, v|
412
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
413
+ end
414
+ end
415
+ else # model
416
+ temp_model = AsposeSlidesCloud.const_get(type).new
417
+ temp_model.build_from_hash(value)
418
+ end
419
+ end
420
+
421
+ # Returns the string representation of the object
422
+ # @return [String] String presentation of the object
423
+ def to_s
424
+ to_hash.to_s
425
+ end
426
+
427
+ # to_body is an alias to to_hash (backward compatibility)
428
+ # @return [Hash] Returns the object in the form of hash
429
+ def to_body
430
+ to_hash
431
+ end
432
+
433
+ # Returns the object in the form of hash
434
+ # @return [Hash] Returns the object in the form of hash
435
+ def to_hash
436
+ hash = {}
437
+ self.class.attribute_map.each_pair do |attr, param|
438
+ value = self.send(attr)
439
+ next if value.nil?
440
+ hash[param] = _to_hash(value)
441
+ end
442
+ hash
443
+ end
444
+
445
+ # Outputs non-array value in the form of hash
446
+ # For object, use to_hash. Otherwise, just return the value
447
+ # @param [Object] value Any valid value
448
+ # @return [Hash] Returns the value in the form of hash
449
+ def _to_hash(value)
450
+ if value.is_a?(Array)
451
+ value.compact.map { |v| _to_hash(v) }
452
+ elsif value.is_a?(Hash)
453
+ {}.tap do |hash|
454
+ value.each { |k, v| hash[k] = _to_hash(v) }
455
+ end
456
+ elsif value.respond_to? :to_hash
457
+ value.to_hash
458
+ else
459
+ value
460
+ end
461
+ end
462
+ end
463
+ end