aspose_slides_cloud 22.4.0 → 22.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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/TestData/oleObject.xlsx +0 -0
  4. data/TestData/test.pptx +0 -0
  5. data/lib/aspose_slides_cloud/models/{waterfall_series.rb → alpha_bi_level_effect.rb} +16 -26
  6. data/lib/aspose_slides_cloud/models/alpha_ceiling_effect.rb +223 -0
  7. data/lib/aspose_slides_cloud/models/alpha_floor_effect.rb +223 -0
  8. data/lib/aspose_slides_cloud/models/alpha_inverse_effect.rb +223 -0
  9. data/lib/aspose_slides_cloud/models/alpha_modulate_effect.rb +223 -0
  10. data/lib/aspose_slides_cloud/models/alpha_modulate_fixed_effect.rb +238 -0
  11. data/lib/aspose_slides_cloud/models/alpha_replace_effect.rb +238 -0
  12. data/lib/aspose_slides_cloud/models/bi_level_effect.rb +238 -0
  13. data/lib/aspose_slides_cloud/models/blur_image_effect.rb +253 -0
  14. data/lib/aspose_slides_cloud/models/color_change_effect.rb +243 -0
  15. data/lib/aspose_slides_cloud/models/color_replace_effect.rb +233 -0
  16. data/lib/aspose_slides_cloud/models/duotone_effect.rb +243 -0
  17. data/lib/aspose_slides_cloud/models/{box_and_whisker_series.rb → fill_overlay_image_effect.rb} +31 -71
  18. data/lib/aspose_slides_cloud/models/{waterfall_chart_data_point.rb → gray_scale_effect.rb} +26 -13
  19. data/lib/aspose_slides_cloud/models/hsl_effect.rb +268 -0
  20. data/lib/aspose_slides_cloud/models/image_transform_effect.rb +244 -0
  21. data/lib/aspose_slides_cloud/models/luminance_effect.rb +253 -0
  22. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +12 -2
  23. data/lib/aspose_slides_cloud/models/one_value_series.rb +74 -2
  24. data/lib/aspose_slides_cloud/models/picture_fill.rb +14 -2
  25. data/lib/aspose_slides_cloud/models/resource_uri.rb +22 -2
  26. data/lib/aspose_slides_cloud/models/smart_art_node.rb +12 -2
  27. data/lib/aspose_slides_cloud/models/tint_effect.rb +253 -0
  28. data/lib/aspose_slides_cloud/models/video_frame.rb +12 -2
  29. data/lib/aspose_slides_cloud/type_registry.rb +35 -6
  30. data/lib/aspose_slides_cloud/version.rb +1 -1
  31. data/lib/aspose_slides_cloud.rb +18 -3
  32. data/testRules.json +1 -1
  33. metadata +21 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11b506f12bdd5105cb63305b97abc144cdf102ae0d2a9c8345629bb3fbd2f8d6
4
- data.tar.gz: 1c71dfb4811db6a5815bd23cbec0ee7a59f6d375c78b792dcfac1fd83add9795
3
+ metadata.gz: f58cf5db7fc44e88265b152b83f65a92c26f01ae3f6ac878b370e6cbf3858d36
4
+ data.tar.gz: 8dfd1210dadc35d0e75243bac2b012ef860ab75c13430cf84844891629d39b3f
5
5
  SHA512:
6
- metadata.gz: 5eddf5b9c0e23bb11fcc3b2af53bddf7917aa837fb4752b41dea2d814147179299f54fd3b659ad06e663b8be2b42f6aa4f9a0dfa566bd40b342a5b38255476ae
7
- data.tar.gz: 543bae25035d340a1faa9bc6aba685236d2127ca3b67afb5582ad71080b799e7406d534d3d7d34b83eafb4a2f97d2fd755bc6e86cc1540323eba3fb24b2e1027
6
+ metadata.gz: 69310b94341210c5dd92792b2c5b442c04878b0b4b2fdb51d8d62681db9ed9595b198fbf518445220a482317caa2813a90a7bf39777a800640d2b4597e1791f8
7
+ data.tar.gz: cfbcfbb28bb8c41d7c0e48964aa3417c83defd8c0be3e6afbafba2cf5cc8486cea63508d6633e98e368e63b75bafd8056bdbbfa4ae631c5abb526172f9a3ba09
data/README.md CHANGED
@@ -27,6 +27,13 @@ You may want to check out Aspose free [PPT to PDF](https://products.aspose.app/s
27
27
  **Web:** HTML/HTML5
28
28
  **Other:** MPEG4, SWF (export whole presentations)
29
29
 
30
+ ## Enhancements in Version 22.5
31
+ * Added **Paragraphs** property to **SmartArtNode** class to enable getting and setting text for SmartArt nodes.
32
+ * Added **ImageTransformList** property to **PictureFill** class to enable setting image transform effects. Added **ImageTransformEffect** class and subclasses for different kind of of effects.
33
+ * Added **PictureFillFormat** property to **VideoFrame** class to enable setting poster image for video frames.
34
+ * Added **SlideIndex** and **ShapeIndex** properties to **ResourceUri** class to simplify retrieveing slide & shape indexes for resources.
35
+ * Removed redundant **BoxAndWhiskersSeries**, **WaterfallSeries** and **WaterfallChartDataPoint** classes.
36
+
30
37
  ## Enhancements in Version 22.4
31
38
  * Added **TransitionType** and **SlidesTransitionDuration** properties to **VideoExportOptions** class to enable creation videos with transitions.
32
39
  * Added **DefaultPortionFormat** property to **Paragraph** class. Added new **PortionFormat** class.
Binary file
data/TestData/test.pptx CHANGED
Binary file
@@ -23,10 +23,10 @@ SOFTWARE.
23
23
  require 'date'
24
24
 
25
25
  module AsposeSlidesCloud
26
- # One value series.
27
- class WaterfallSeries < OneValueSeries
28
- # True if inner points are shown.
29
- attr_accessor :show_connector_lines
26
+ # Represents an Alpha Bi-Level effect.
27
+ class AlphaBiLevelEffect < ImageTransformEffect
28
+ # Returns effect threshold.
29
+ attr_accessor :threshold
30
30
 
31
31
  class EnumAttributeValidator
32
32
  attr_reader :datatype
@@ -53,14 +53,14 @@ module AsposeSlidesCloud
53
53
  # Attribute mapping from ruby-style variable name to JSON key.
54
54
  def self.attribute_map
55
55
  super.merge({
56
- :'show_connector_lines' => :'ShowConnectorLines',
56
+ :'threshold' => :'Threshold',
57
57
  })
58
58
  end
59
59
 
60
60
  # Attribute type mapping.
61
61
  def self.swagger_types
62
62
  super.merge({
63
- :'show_connector_lines' => :'BOOLEAN',
63
+ :'threshold' => :'Float',
64
64
  })
65
65
  end
66
66
 
@@ -69,16 +69,20 @@ module AsposeSlidesCloud
69
69
  def initialize(attributes = {})
70
70
  super
71
71
 
72
- if attributes.has_key?(:'ShowConnectorLines')
73
- self.show_connector_lines = attributes[:'ShowConnectorLines']
72
+ if attributes.has_key?(:'Threshold')
73
+ self.threshold = attributes[:'Threshold']
74
74
  end
75
- self.data_point_type = "OneValue"
75
+ self.type = "AlphaBiLevel"
76
76
  end
77
77
 
78
78
  # Show invalid properties with the reasons. Usually used together with valid?
79
79
  # @return Array for valid properties with the reasons
80
80
  def list_invalid_properties
81
81
  invalid_properties = super
82
+ if @threshold.nil?
83
+ invalid_properties.push('invalid value for "threshold", threshold cannot be nil.')
84
+ end
85
+
82
86
  invalid_properties
83
87
  end
84
88
 
@@ -86,6 +90,7 @@ module AsposeSlidesCloud
86
90
  # @return true if the model is valid
87
91
  def valid?
88
92
  return false if !super
93
+ return false if @threshold.nil?
89
94
  true
90
95
  end
91
96
 
@@ -95,22 +100,7 @@ module AsposeSlidesCloud
95
100
  return true if self.equal?(o)
96
101
  self.class == o.class &&
97
102
  type == o.type &&
98
- name == o.name &&
99
- is_color_varied == o.is_color_varied &&
100
- inverted_solid_fill_color == o.inverted_solid_fill_color &&
101
- smooth == o.smooth &&
102
- plot_on_second_axis == o.plot_on_second_axis &&
103
- order == o.order &&
104
- invert_if_negative == o.invert_if_negative &&
105
- explosion == o.explosion &&
106
- marker == o.marker &&
107
- fill_format == o.fill_format &&
108
- effect_format == o.effect_format &&
109
- line_format == o.line_format &&
110
- data_point_type == o.data_point_type &&
111
- data_points == o.data_points &&
112
- number_format_of_values == o.number_format_of_values &&
113
- show_connector_lines == o.show_connector_lines
103
+ threshold == o.threshold
114
104
  end
115
105
 
116
106
  # @see the `==` method
@@ -122,7 +112,7 @@ module AsposeSlidesCloud
122
112
  # Calculates hash code according to all attributes.
123
113
  # @return [Fixnum] Hash code
124
114
  def hash
125
- [type, name, is_color_varied, inverted_solid_fill_color, smooth, plot_on_second_axis, order, invert_if_negative, explosion, marker, fill_format, effect_format, line_format, data_point_type, data_points, number_format_of_values, show_connector_lines].hash
115
+ [type, threshold].hash
126
116
  end
127
117
 
128
118
  # Builds the object from hash
@@ -0,0 +1,223 @@
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
+ # Represents an Alpha Ceiling effect.
27
+ class AlphaCeilingEffect < ImageTransformEffect
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ super.merge({
53
+ })
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ super.merge({
59
+ })
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ super
66
+ self.type = "AlphaCeiling"
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = super
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if !super
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ type == o.type
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [type].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ mapKey = self.class.attribute_map[key]
110
+ if !mapKey.nil?
111
+ val = attributes[mapKey]
112
+ if val.nil?
113
+ mapKeyString = mapKey.to_s
114
+ mapKeyString[0] = mapKeyString[0].downcase
115
+ mapKey = mapKeyString.to_sym
116
+ val = attributes[mapKey]
117
+ end
118
+ if !val.nil?
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if val.is_a?(Array)
123
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
124
+ end
125
+ else
126
+ self.send("#{key}=", _deserialize(type, val))
127
+ end
128
+ end
129
+ end
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
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
173
+ if registry_type
174
+ type = registry_type
175
+ end
176
+ temp_model = AsposeSlidesCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end
@@ -0,0 +1,223 @@
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
+ # /// Represents an Alpha Floor effect.
27
+ class AlphaFloorEffect < ImageTransformEffect
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ super.merge({
53
+ })
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ super.merge({
59
+ })
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ super
66
+ self.type = "AlphaFloor"
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = super
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if !super
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ type == o.type
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [type].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ mapKey = self.class.attribute_map[key]
110
+ if !mapKey.nil?
111
+ val = attributes[mapKey]
112
+ if val.nil?
113
+ mapKeyString = mapKey.to_s
114
+ mapKeyString[0] = mapKeyString[0].downcase
115
+ mapKey = mapKeyString.to_sym
116
+ val = attributes[mapKey]
117
+ end
118
+ if !val.nil?
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if val.is_a?(Array)
123
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
124
+ end
125
+ else
126
+ self.send("#{key}=", _deserialize(type, val))
127
+ end
128
+ end
129
+ end
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
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
173
+ if registry_type
174
+ type = registry_type
175
+ end
176
+ temp_model = AsposeSlidesCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end