aspose_slides_cloud 20.4.0 → 20.5.0

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