aspose_cells_cloud 20.8 → 20.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,434 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2020 Aspose.Cells Cloud
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
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeCellsCloud
26
+
27
+ class SparklineGroup
28
+ attr_accessor :display_hidden
29
+
30
+ attr_accessor :first_point_color
31
+
32
+ attr_accessor :high_point_color
33
+
34
+ attr_accessor :horizontal_axis_color
35
+
36
+ attr_accessor :horizontal_axis_date_range
37
+
38
+ attr_accessor :last_point_color
39
+
40
+ attr_accessor :line_weight
41
+
42
+ attr_accessor :low_point_color
43
+
44
+ attr_accessor :markers_color
45
+
46
+ attr_accessor :negative_points_color
47
+
48
+ attr_accessor :plot_empty_cells_type
49
+
50
+ attr_accessor :plot_right_to_left
51
+
52
+ attr_accessor :preset_style
53
+
54
+ attr_accessor :series_color
55
+
56
+ attr_accessor :show_first_point
57
+
58
+ attr_accessor :show_high_point
59
+
60
+ attr_accessor :show_horizontal_axis
61
+
62
+ attr_accessor :show_last_point
63
+
64
+ attr_accessor :show_low_point
65
+
66
+ attr_accessor :show_markers
67
+
68
+ attr_accessor :show_negative_points
69
+
70
+ attr_accessor :sparkline_collection
71
+
72
+ attr_accessor :type
73
+
74
+ attr_accessor :vertical_axis_max_value
75
+
76
+ attr_accessor :vertical_axis_max_value_type
77
+
78
+ attr_accessor :vertical_axis_min_value
79
+
80
+ attr_accessor :vertical_axis_min_value_type
81
+
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'display_hidden' => :'DisplayHidden',
87
+ :'first_point_color' => :'FirstPointColor',
88
+ :'high_point_color' => :'HighPointColor',
89
+ :'horizontal_axis_color' => :'HorizontalAxisColor',
90
+ :'horizontal_axis_date_range' => :'HorizontalAxisDateRange',
91
+ :'last_point_color' => :'LastPointColor',
92
+ :'line_weight' => :'LineWeight',
93
+ :'low_point_color' => :'LowPointColor',
94
+ :'markers_color' => :'MarkersColor',
95
+ :'negative_points_color' => :'NegativePointsColor',
96
+ :'plot_empty_cells_type' => :'PlotEmptyCellsType',
97
+ :'plot_right_to_left' => :'PlotRightToLeft',
98
+ :'preset_style' => :'PresetStyle',
99
+ :'series_color' => :'SeriesColor',
100
+ :'show_first_point' => :'ShowFirstPoint',
101
+ :'show_high_point' => :'ShowHighPoint',
102
+ :'show_horizontal_axis' => :'ShowHorizontalAxis',
103
+ :'show_last_point' => :'ShowLastPoint',
104
+ :'show_low_point' => :'ShowLowPoint',
105
+ :'show_markers' => :'ShowMarkers',
106
+ :'show_negative_points' => :'ShowNegativePoints',
107
+ :'sparkline_collection' => :'SparklineCollection',
108
+ :'type' => :'Type',
109
+ :'vertical_axis_max_value' => :'VerticalAxisMaxValue',
110
+ :'vertical_axis_max_value_type' => :'VerticalAxisMaxValueType',
111
+ :'vertical_axis_min_value' => :'VerticalAxisMinValue',
112
+ :'vertical_axis_min_value_type' => :'VerticalAxisMinValueType'
113
+ }
114
+ end
115
+
116
+ # Attribute type mapping.
117
+ def self.swagger_types
118
+ {
119
+ :'display_hidden' => :'BOOLEAN',
120
+ :'first_point_color' => :'CellsColor',
121
+ :'high_point_color' => :'CellsColor',
122
+ :'horizontal_axis_color' => :'CellsColor',
123
+ :'horizontal_axis_date_range' => :'String',
124
+ :'last_point_color' => :'CellsColor',
125
+ :'line_weight' => :'Float',
126
+ :'low_point_color' => :'CellsColor',
127
+ :'markers_color' => :'CellsColor',
128
+ :'negative_points_color' => :'CellsColor',
129
+ :'plot_empty_cells_type' => :'String',
130
+ :'plot_right_to_left' => :'BOOLEAN',
131
+ :'preset_style' => :'String',
132
+ :'series_color' => :'CellsColor',
133
+ :'show_first_point' => :'BOOLEAN',
134
+ :'show_high_point' => :'BOOLEAN',
135
+ :'show_horizontal_axis' => :'BOOLEAN',
136
+ :'show_last_point' => :'BOOLEAN',
137
+ :'show_low_point' => :'BOOLEAN',
138
+ :'show_markers' => :'BOOLEAN',
139
+ :'show_negative_points' => :'BOOLEAN',
140
+ :'sparkline_collection' => :'Array<Sparkline>',
141
+ :'type' => :'String',
142
+ :'vertical_axis_max_value' => :'Float',
143
+ :'vertical_axis_max_value_type' => :'String',
144
+ :'vertical_axis_min_value' => :'Float',
145
+ :'vertical_axis_min_value_type' => :'String'
146
+ }
147
+ end
148
+
149
+ # Initializes the object
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ def initialize(attributes = {})
152
+ return unless attributes.is_a?(Hash)
153
+
154
+ # convert string to symbol for hash key
155
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
156
+
157
+ if attributes.has_key?(:'DisplayHidden')
158
+ self.display_hidden = attributes[:'DisplayHidden']
159
+ end
160
+
161
+ if attributes.has_key?(:'FirstPointColor')
162
+ self.first_point_color = attributes[:'FirstPointColor']
163
+ end
164
+
165
+ if attributes.has_key?(:'HighPointColor')
166
+ self.high_point_color = attributes[:'HighPointColor']
167
+ end
168
+
169
+ if attributes.has_key?(:'HorizontalAxisColor')
170
+ self.horizontal_axis_color = attributes[:'HorizontalAxisColor']
171
+ end
172
+
173
+ if attributes.has_key?(:'HorizontalAxisDateRange')
174
+ self.horizontal_axis_date_range = attributes[:'HorizontalAxisDateRange']
175
+ end
176
+
177
+ if attributes.has_key?(:'LastPointColor')
178
+ self.last_point_color = attributes[:'LastPointColor']
179
+ end
180
+
181
+ if attributes.has_key?(:'LineWeight')
182
+ self.line_weight = attributes[:'LineWeight']
183
+ end
184
+
185
+ if attributes.has_key?(:'LowPointColor')
186
+ self.low_point_color = attributes[:'LowPointColor']
187
+ end
188
+
189
+ if attributes.has_key?(:'MarkersColor')
190
+ self.markers_color = attributes[:'MarkersColor']
191
+ end
192
+
193
+ if attributes.has_key?(:'NegativePointsColor')
194
+ self.negative_points_color = attributes[:'NegativePointsColor']
195
+ end
196
+
197
+ if attributes.has_key?(:'PlotEmptyCellsType')
198
+ self.plot_empty_cells_type = attributes[:'PlotEmptyCellsType']
199
+ end
200
+
201
+ if attributes.has_key?(:'PlotRightToLeft')
202
+ self.plot_right_to_left = attributes[:'PlotRightToLeft']
203
+ end
204
+
205
+ if attributes.has_key?(:'PresetStyle')
206
+ self.preset_style = attributes[:'PresetStyle']
207
+ end
208
+
209
+ if attributes.has_key?(:'SeriesColor')
210
+ self.series_color = attributes[:'SeriesColor']
211
+ end
212
+
213
+ if attributes.has_key?(:'ShowFirstPoint')
214
+ self.show_first_point = attributes[:'ShowFirstPoint']
215
+ end
216
+
217
+ if attributes.has_key?(:'ShowHighPoint')
218
+ self.show_high_point = attributes[:'ShowHighPoint']
219
+ end
220
+
221
+ if attributes.has_key?(:'ShowHorizontalAxis')
222
+ self.show_horizontal_axis = attributes[:'ShowHorizontalAxis']
223
+ end
224
+
225
+ if attributes.has_key?(:'ShowLastPoint')
226
+ self.show_last_point = attributes[:'ShowLastPoint']
227
+ end
228
+
229
+ if attributes.has_key?(:'ShowLowPoint')
230
+ self.show_low_point = attributes[:'ShowLowPoint']
231
+ end
232
+
233
+ if attributes.has_key?(:'ShowMarkers')
234
+ self.show_markers = attributes[:'ShowMarkers']
235
+ end
236
+
237
+ if attributes.has_key?(:'ShowNegativePoints')
238
+ self.show_negative_points = attributes[:'ShowNegativePoints']
239
+ end
240
+
241
+ if attributes.has_key?(:'SparklineCollection')
242
+ if (value = attributes[:'SparklineCollection']).is_a?(Array)
243
+ self.sparkline_collection = value
244
+ end
245
+ end
246
+
247
+ if attributes.has_key?(:'Type')
248
+ self.type = attributes[:'Type']
249
+ end
250
+
251
+ if attributes.has_key?(:'VerticalAxisMaxValue')
252
+ self.vertical_axis_max_value = attributes[:'VerticalAxisMaxValue']
253
+ end
254
+
255
+ if attributes.has_key?(:'VerticalAxisMaxValueType')
256
+ self.vertical_axis_max_value_type = attributes[:'VerticalAxisMaxValueType']
257
+ end
258
+
259
+ if attributes.has_key?(:'VerticalAxisMinValue')
260
+ self.vertical_axis_min_value = attributes[:'VerticalAxisMinValue']
261
+ end
262
+
263
+ if attributes.has_key?(:'VerticalAxisMinValueType')
264
+ self.vertical_axis_min_value_type = attributes[:'VerticalAxisMinValueType']
265
+ end
266
+
267
+ end
268
+
269
+ # Show invalid properties with the reasons. Usually used together with valid?
270
+ # @return Array for valid properies with the reasons
271
+ def list_invalid_properties
272
+ invalid_properties = Array.new
273
+ return invalid_properties
274
+ end
275
+
276
+ # Check to see if the all the properties in the model are valid
277
+ # @return true if the model is valid
278
+ def valid?
279
+ return true
280
+ end
281
+
282
+ # Checks equality by comparing each attribute.
283
+ # @param [Object] Object to be compared
284
+ def ==(o)
285
+ return true if self.equal?(o)
286
+ self.class == o.class &&
287
+ display_hidden == o.display_hidden &&
288
+ first_point_color == o.first_point_color &&
289
+ high_point_color == o.high_point_color &&
290
+ horizontal_axis_color == o.horizontal_axis_color &&
291
+ horizontal_axis_date_range == o.horizontal_axis_date_range &&
292
+ last_point_color == o.last_point_color &&
293
+ line_weight == o.line_weight &&
294
+ low_point_color == o.low_point_color &&
295
+ markers_color == o.markers_color &&
296
+ negative_points_color == o.negative_points_color &&
297
+ plot_empty_cells_type == o.plot_empty_cells_type &&
298
+ plot_right_to_left == o.plot_right_to_left &&
299
+ preset_style == o.preset_style &&
300
+ series_color == o.series_color &&
301
+ show_first_point == o.show_first_point &&
302
+ show_high_point == o.show_high_point &&
303
+ show_horizontal_axis == o.show_horizontal_axis &&
304
+ show_last_point == o.show_last_point &&
305
+ show_low_point == o.show_low_point &&
306
+ show_markers == o.show_markers &&
307
+ show_negative_points == o.show_negative_points &&
308
+ sparkline_collection == o.sparkline_collection &&
309
+ type == o.type &&
310
+ vertical_axis_max_value == o.vertical_axis_max_value &&
311
+ vertical_axis_max_value_type == o.vertical_axis_max_value_type &&
312
+ vertical_axis_min_value == o.vertical_axis_min_value &&
313
+ vertical_axis_min_value_type == o.vertical_axis_min_value_type
314
+ end
315
+
316
+ # @see the `==` method
317
+ # @param [Object] Object to be compared
318
+ def eql?(o)
319
+ self == o
320
+ end
321
+
322
+ # Calculates hash code according to all attributes.
323
+ # @return [Fixnum] Hash code
324
+ def hash
325
+ [display_hidden, first_point_color, high_point_color, horizontal_axis_color, horizontal_axis_date_range, last_point_color, line_weight, low_point_color, markers_color, negative_points_color, plot_empty_cells_type, plot_right_to_left, preset_style, series_color, show_first_point, show_high_point, show_horizontal_axis, show_last_point, show_low_point, show_markers, show_negative_points, sparkline_collection, type, vertical_axis_max_value, vertical_axis_max_value_type, vertical_axis_min_value, vertical_axis_min_value_type].hash
326
+ end
327
+
328
+ # Builds the object from hash
329
+ # @param [Hash] attributes Model attributes in the form of hash
330
+ # @return [Object] Returns the model itself
331
+ def build_from_hash(attributes)
332
+ return nil unless attributes.is_a?(Hash)
333
+ self.class.swagger_types.each_pair do |key, type|
334
+ if type =~ /\AArray<(.*)>/i
335
+ # check to ensure the input is an array given that the the attribute
336
+ # is documented as an array but the input is not
337
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
338
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
339
+ end
340
+ elsif !attributes[self.class.attribute_map[key]].nil?
341
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
342
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
343
+ end
344
+
345
+ self
346
+ end
347
+
348
+ # Deserializes the data based on type
349
+ # @param string type Data type
350
+ # @param string value Value to be deserialized
351
+ # @return [Object] Deserialized data
352
+ def _deserialize(type, value)
353
+ case type.to_sym
354
+ when :DateTime
355
+ DateTime.parse(value)
356
+ when :Date
357
+ Date.parse(value)
358
+ when :String
359
+ value.to_s
360
+ when :Integer
361
+ value.to_i
362
+ when :Float
363
+ value.to_f
364
+ when :BOOLEAN
365
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
366
+ true
367
+ else
368
+ false
369
+ end
370
+ when :Object
371
+ # generic object (usually a Hash), return directly
372
+ value
373
+ when /\AArray<(?<inner_type>.+)>\z/
374
+ inner_type = Regexp.last_match[:inner_type]
375
+ value.map { |v| _deserialize(inner_type, v) }
376
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
377
+ k_type = Regexp.last_match[:k_type]
378
+ v_type = Regexp.last_match[:v_type]
379
+ {}.tap do |hash|
380
+ value.each do |k, v|
381
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
382
+ end
383
+ end
384
+ else # model
385
+ temp_model = AsposeCellsCloud.const_get(type).new
386
+ temp_model.build_from_hash(value)
387
+ end
388
+ end
389
+
390
+ # Returns the string representation of the object
391
+ # @return [String] String presentation of the object
392
+ def to_s
393
+ to_hash.to_s
394
+ end
395
+
396
+ # to_body is an alias to to_hash (backward compatibility)
397
+ # @return [Hash] Returns the object in the form of hash
398
+ def to_body
399
+ to_hash
400
+ end
401
+
402
+ # Returns the object in the form of hash
403
+ # @return [Hash] Returns the object in the form of hash
404
+ def to_hash
405
+ hash = {}
406
+ self.class.attribute_map.each_pair do |attr, param|
407
+ value = self.send(attr)
408
+ next if value.nil?
409
+ hash[param] = _to_hash(value)
410
+ end
411
+ hash
412
+ end
413
+
414
+ # Outputs non-array value in the form of hash
415
+ # For object, use to_hash. Otherwise, just return the value
416
+ # @param [Object] value Any valid value
417
+ # @return [Hash] Returns the value in the form of hash
418
+ def _to_hash(value)
419
+ if value.is_a?(Array)
420
+ value.compact.map{ |v| _to_hash(v) }
421
+ elsif value.is_a?(Hash)
422
+ {}.tap do |hash|
423
+ value.each { |k, v| hash[k] = _to_hash(v) }
424
+ end
425
+ elsif value.respond_to? :to_hash
426
+ value.to_hash
427
+ else
428
+ value
429
+ end
430
+ end
431
+
432
+ end
433
+
434
+ end
@@ -0,0 +1,221 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2020 Aspose.Cells Cloud
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
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeCellsCloud
26
+
27
+ class SparklineGroupResponse
28
+ attr_accessor :status
29
+
30
+ attr_accessor :code
31
+
32
+ attr_accessor :sparkline_group
33
+
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'status' => :'Status',
39
+ :'code' => :'Code',
40
+ :'sparkline_group' => :'SparklineGroup'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'status' => :'String',
48
+ :'code' => :'Integer',
49
+ :'sparkline_group' => :'SparklineGroup'
50
+ }
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
60
+
61
+ if attributes.has_key?(:'Status')
62
+ self.status = attributes[:'Status']
63
+ end
64
+
65
+ if attributes.has_key?(:'Code')
66
+ self.code = attributes[:'Code']
67
+ end
68
+
69
+ if attributes.has_key?(:'SparklineGroup')
70
+ self.sparkline_group = attributes[:'SparklineGroup']
71
+ end
72
+
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properies with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @code.nil?
80
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
81
+ end
82
+
83
+ return invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @code.nil?
90
+ return true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ status == o.status &&
99
+ code == o.code &&
100
+ sparkline_group == o.sparkline_group
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Fixnum] Hash code
111
+ def hash
112
+ [status, code, sparkline_group].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.swagger_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ temp_model = AsposeCellsCloud.const_get(type).new
173
+ temp_model.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ next if value.nil?
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map{ |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end