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,200 +1,210 @@
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
- # One value chart data point.
27
- class OneValueChartDataPoint
28
- # Value.
29
- attr_accessor :value
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'value' => :'Value'
35
- }
36
- end
37
-
38
- # Attribute type mapping.
39
- def self.swagger_types
40
- {
41
- :'value' => :'Float'
42
- }
43
- end
44
-
45
- # Initializes the object
46
- # @param [Hash] attributes Model attributes in the form of hash
47
- def initialize(attributes = {})
48
- return unless attributes.is_a?(Hash)
49
-
50
- # convert string to symbol for hash key
51
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
-
53
- if attributes.has_key?(:'Value')
54
- self.value = attributes[:'Value']
55
- end
56
- end
57
-
58
- # Show invalid properties with the reasons. Usually used together with valid?
59
- # @return Array for valid properties with the reasons
60
- def list_invalid_properties
61
- invalid_properties = Array.new
62
- if @value.nil?
63
- invalid_properties.push('invalid value for "value", value cannot be nil.')
64
- end
65
-
66
- invalid_properties
67
- end
68
-
69
- # Check to see if the all the properties in the model are valid
70
- # @return true if the model is valid
71
- def valid?
72
- return false if @value.nil?
73
- true
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(o)
79
- return true if self.equal?(o)
80
- self.class == o.class &&
81
- value == o.value
82
- end
83
-
84
- # @see the `==` method
85
- # @param [Object] Object to be compared
86
- def eql?(o)
87
- self == o
88
- end
89
-
90
- # Calculates hash code according to all attributes.
91
- # @return [Fixnum] Hash code
92
- def hash
93
- [value].hash
94
- end
95
-
96
- # Builds the object from hash
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- # @return [Object] Returns the model itself
99
- def build_from_hash(attributes)
100
- return nil unless attributes.is_a?(Hash)
101
- self.class.swagger_types.each_pair do |key, type|
102
- if type =~ /\AArray<(.*)>/i
103
- # check to ensure the input is an array given that the the attribute
104
- # is documented as an array but the input is not
105
- if attributes[self.class.attribute_map[key]].is_a?(Array)
106
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
107
- end
108
- elsif !attributes[self.class.attribute_map[key]].nil?
109
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
110
- end # or else data not found in attributes(hash), not an issue as the data can be optional
111
- end
112
-
113
- self
114
- end
115
-
116
- # Deserializes the data based on type
117
- # @param string type Data type
118
- # @param string value Value to be deserialized
119
- # @return [Object] Deserialized data
120
- def _deserialize(type, value)
121
- case type.to_sym
122
- when :DateTime
123
- DateTime.parse(value)
124
- when :Date
125
- Date.parse(value)
126
- when :String
127
- value.to_s
128
- when :Integer
129
- value.to_i
130
- when :Float
131
- value.to_f
132
- when :BOOLEAN
133
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
134
- true
135
- else
136
- false
137
- end
138
- when :Object
139
- # generic object (usually a Hash), return directly
140
- value
141
- when /\AArray<(?<inner_type>.+)>\z/
142
- inner_type = Regexp.last_match[:inner_type]
143
- value.map { |v| _deserialize(inner_type, v) }
144
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
145
- k_type = Regexp.last_match[:k_type]
146
- v_type = Regexp.last_match[:v_type]
147
- {}.tap do |hash|
148
- value.each do |k, v|
149
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
150
- end
151
- end
152
- else # model
153
- temp_model = AsposeSlidesCloud.const_get(type).new
154
- temp_model.build_from_hash(value)
155
- end
156
- end
157
-
158
- # Returns the string representation of the object
159
- # @return [String] String presentation of the object
160
- def to_s
161
- to_hash.to_s
162
- end
163
-
164
- # to_body is an alias to to_hash (backward compatibility)
165
- # @return [Hash] Returns the object in the form of hash
166
- def to_body
167
- to_hash
168
- end
169
-
170
- # Returns the object in the form of hash
171
- # @return [Hash] Returns the object in the form of hash
172
- def to_hash
173
- hash = {}
174
- self.class.attribute_map.each_pair do |attr, param|
175
- value = self.send(attr)
176
- next if value.nil?
177
- hash[param] = _to_hash(value)
178
- end
179
- hash
180
- end
181
-
182
- # Outputs non-array value in the form of hash
183
- # For object, use to_hash. Otherwise, just return the value
184
- # @param [Object] value Any valid value
185
- # @return [Hash] Returns the value in the form of hash
186
- def _to_hash(value)
187
- if value.is_a?(Array)
188
- value.compact.map { |v| _to_hash(v) }
189
- elsif value.is_a?(Hash)
190
- {}.tap do |hash|
191
- value.each { |k, v| hash[k] = _to_hash(v) }
192
- end
193
- elsif value.respond_to? :to_hash
194
- value.to_hash
195
- else
196
- value
197
- end
198
- end
199
- end
200
- 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
+ # One value chart data point.
27
+ class OneValueChartDataPoint < DataPoint
28
+ # Value.
29
+ attr_accessor :value
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ super.merge({
34
+ :'value' => :'Value',
35
+ })
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ super.merge({
41
+ :'value' => :'Float',
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?(:'Value')
51
+ self.value = attributes[:'Value']
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 @value.nil?
60
+ invalid_properties.push('invalid value for "value", value 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 @value.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
+ value == o.value
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Fixnum] Hash code
90
+ def hash
91
+ [value].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def build_from_hash(attributes)
98
+ return nil unless attributes.is_a?(Hash)
99
+ self.class.swagger_types.each_pair do |key, type|
100
+ mapKey = self.class.attribute_map[key]
101
+ if !mapKey.nil?
102
+ val = attributes[mapKey]
103
+ if val.nil?
104
+ mapKeyString = mapKey.to_s
105
+ mapKeyString[0] = mapKeyString[0].downcase
106
+ mapKey = mapKeyString.to_sym
107
+ val = attributes[mapKey]
108
+ end
109
+ if !val.nil?
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the the attribute
112
+ # is documented as an array but the input is not
113
+ if val.is_a?(Array)
114
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
115
+ end
116
+ else
117
+ self.send("#{key}=", _deserialize(type, val))
118
+ end
119
+ end
120
+ end
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :BOOLEAN
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ temp_model = AsposeSlidesCloud.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+ end
210
+ end
@@ -1,428 +1,248 @@
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
- # One value series.
27
- class OneValueSeries
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<OneValueChartDataPoint>'
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 @data_point_type.nil?
249
- invalid_properties.push('invalid value for "data_point_type", data_point_type cannot be nil.')
250
- end
251
-
252
- invalid_properties
253
- end
254
-
255
- # Check to see if the all the properties in the model are valid
256
- # @return true if the model is valid
257
- def valid?
258
- 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', 'Treemap', 'Sunburst', 'Histogram', 'ParetoLine', 'BoxAndWhisker', 'Waterfall', 'Funnel'])
259
- return false unless type_validator.valid?(@type)
260
- return false if @data_point_type.nil?
261
- data_point_type_validator = EnumAttributeValidator.new('String', ['OneValue', 'Scatter', 'Bubble'])
262
- return false unless data_point_type_validator.valid?(@data_point_type)
263
- true
264
- end
265
-
266
- # Custom attribute writer method checking allowed values (enum).
267
- # @param [Object] type Object to be assigned
268
- def type=(type)
269
- 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', 'Treemap', 'Sunburst', 'Histogram', 'ParetoLine', 'BoxAndWhisker', 'Waterfall', 'Funnel'])
270
- unless validator.valid?(type)
271
- fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
272
- end
273
- @type = type
274
- end
275
-
276
- # Custom attribute writer method checking allowed values (enum).
277
- # @param [Object] data_point_type Object to be assigned
278
- def data_point_type=(data_point_type)
279
- validator = EnumAttributeValidator.new('String', ['OneValue', 'Scatter', 'Bubble'])
280
- unless validator.valid?(data_point_type)
281
- fail ArgumentError, 'invalid value for "data_point_type", must be one of #{validator.allowable_values}.'
282
- end
283
- @data_point_type = data_point_type
284
- end
285
-
286
- # Checks equality by comparing each attribute.
287
- # @param [Object] Object to be compared
288
- def ==(o)
289
- return true if self.equal?(o)
290
- self.class == o.class &&
291
- type == o.type &&
292
- name == o.name &&
293
- is_color_varied == o.is_color_varied &&
294
- inverted_solid_fill_color == o.inverted_solid_fill_color &&
295
- smooth == o.smooth &&
296
- plot_on_second_axis == o.plot_on_second_axis &&
297
- order == o.order &&
298
- number_format_of_y_values == o.number_format_of_y_values &&
299
- number_format_of_x_values == o.number_format_of_x_values &&
300
- number_format_of_values == o.number_format_of_values &&
301
- number_format_of_bubble_sizes == o.number_format_of_bubble_sizes &&
302
- invert_if_negative == o.invert_if_negative &&
303
- explosion == o.explosion &&
304
- marker == o.marker &&
305
- fill_format == o.fill_format &&
306
- effect_format == o.effect_format &&
307
- line_format == o.line_format &&
308
- data_point_type == o.data_point_type &&
309
- data_points == o.data_points
310
- end
311
-
312
- # @see the `==` method
313
- # @param [Object] Object to be compared
314
- def eql?(o)
315
- self == o
316
- end
317
-
318
- # Calculates hash code according to all attributes.
319
- # @return [Fixnum] Hash code
320
- def hash
321
- [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
322
- end
323
-
324
- # Builds the object from hash
325
- # @param [Hash] attributes Model attributes in the form of hash
326
- # @return [Object] Returns the model itself
327
- def build_from_hash(attributes)
328
- return nil unless attributes.is_a?(Hash)
329
- self.class.swagger_types.each_pair do |key, type|
330
- if type =~ /\AArray<(.*)>/i
331
- # check to ensure the input is an array given that the the attribute
332
- # is documented as an array but the input is not
333
- if attributes[self.class.attribute_map[key]].is_a?(Array)
334
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
335
- end
336
- elsif !attributes[self.class.attribute_map[key]].nil?
337
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
338
- end # or else data not found in attributes(hash), not an issue as the data can be optional
339
- end
340
-
341
- self
342
- end
343
-
344
- # Deserializes the data based on type
345
- # @param string type Data type
346
- # @param string value Value to be deserialized
347
- # @return [Object] Deserialized data
348
- def _deserialize(type, value)
349
- case type.to_sym
350
- when :DateTime
351
- DateTime.parse(value)
352
- when :Date
353
- Date.parse(value)
354
- when :String
355
- value.to_s
356
- when :Integer
357
- value.to_i
358
- when :Float
359
- value.to_f
360
- when :BOOLEAN
361
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
362
- true
363
- else
364
- false
365
- end
366
- when :Object
367
- # generic object (usually a Hash), return directly
368
- value
369
- when /\AArray<(?<inner_type>.+)>\z/
370
- inner_type = Regexp.last_match[:inner_type]
371
- value.map { |v| _deserialize(inner_type, v) }
372
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
373
- k_type = Regexp.last_match[:k_type]
374
- v_type = Regexp.last_match[:v_type]
375
- {}.tap do |hash|
376
- value.each do |k, v|
377
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
378
- end
379
- end
380
- else # model
381
- temp_model = AsposeSlidesCloud.const_get(type).new
382
- temp_model.build_from_hash(value)
383
- end
384
- end
385
-
386
- # Returns the string representation of the object
387
- # @return [String] String presentation of the object
388
- def to_s
389
- to_hash.to_s
390
- end
391
-
392
- # to_body is an alias to to_hash (backward compatibility)
393
- # @return [Hash] Returns the object in the form of hash
394
- def to_body
395
- to_hash
396
- end
397
-
398
- # Returns the object in the form of hash
399
- # @return [Hash] Returns the object in the form of hash
400
- def to_hash
401
- hash = {}
402
- self.class.attribute_map.each_pair do |attr, param|
403
- value = self.send(attr)
404
- next if value.nil?
405
- hash[param] = _to_hash(value)
406
- end
407
- hash
408
- end
409
-
410
- # Outputs non-array value in the form of hash
411
- # For object, use to_hash. Otherwise, just return the value
412
- # @param [Object] value Any valid value
413
- # @return [Hash] Returns the value in the form of hash
414
- def _to_hash(value)
415
- if value.is_a?(Array)
416
- value.compact.map { |v| _to_hash(v) }
417
- elsif value.is_a?(Hash)
418
- {}.tap do |hash|
419
- value.each { |k, v| hash[k] = _to_hash(v) }
420
- end
421
- elsif value.respond_to? :to_hash
422
- value.to_hash
423
- else
424
- value
425
- end
426
- end
427
- end
428
- 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
+ # One value series.
27
+ class OneValueSeries < Series
28
+ # Gets or sets the values.
29
+ attr_accessor :data_points
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ super.merge({
56
+ :'data_points' => :'DataPoints',
57
+ })
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ super.merge({
63
+ :'data_points' => :'Array<OneValueChartDataPoint>',
64
+ })
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ super
71
+
72
+ if attributes.has_key?(:'DataPoints')
73
+ if (value = attributes[:'DataPoints']).is_a?(Array)
74
+ self.data_points = value
75
+ end
76
+ end
77
+ self.data_point_type = "OneValue"
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = super
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ return false if !super
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ type == o.type &&
100
+ name == o.name &&
101
+ is_color_varied == o.is_color_varied &&
102
+ inverted_solid_fill_color == o.inverted_solid_fill_color &&
103
+ smooth == o.smooth &&
104
+ plot_on_second_axis == o.plot_on_second_axis &&
105
+ order == o.order &&
106
+ number_format_of_y_values == o.number_format_of_y_values &&
107
+ number_format_of_x_values == o.number_format_of_x_values &&
108
+ number_format_of_values == o.number_format_of_values &&
109
+ number_format_of_bubble_sizes == o.number_format_of_bubble_sizes &&
110
+ invert_if_negative == o.invert_if_negative &&
111
+ explosion == o.explosion &&
112
+ marker == o.marker &&
113
+ fill_format == o.fill_format &&
114
+ effect_format == o.effect_format &&
115
+ line_format == o.line_format &&
116
+ data_point_type == o.data_point_type &&
117
+ data_points == o.data_points
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [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
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ mapKey = self.class.attribute_map[key]
139
+ if !mapKey.nil?
140
+ val = attributes[mapKey]
141
+ if val.nil?
142
+ mapKeyString = mapKey.to_s
143
+ mapKeyString[0] = mapKeyString[0].downcase
144
+ mapKey = mapKeyString.to_sym
145
+ val = attributes[mapKey]
146
+ end
147
+ if !val.nil?
148
+ if type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the the attribute
150
+ # is documented as an array but the input is not
151
+ if val.is_a?(Array)
152
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
153
+ end
154
+ else
155
+ self.send("#{key}=", _deserialize(type, val))
156
+ end
157
+ end
158
+ end
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :DateTime
171
+ DateTime.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :BOOLEAN
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ temp_model = AsposeSlidesCloud.const_get(type).new
202
+ temp_model.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ next if value.nil?
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+ end
248
+ end