ultracart_api 4.0.201 → 4.0.202

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +80 -4
  3. data/docs/ConversationApi.md +3565 -549
  4. data/docs/ConversationPbxAgent.md +34 -0
  5. data/docs/ConversationPbxAgentResponse.md +26 -0
  6. data/docs/ConversationPbxAgentsResponse.md +26 -0
  7. data/docs/ConversationPbxAudio.md +34 -0
  8. data/docs/ConversationPbxAudioResponse.md +26 -0
  9. data/docs/ConversationPbxAudiosResponse.md +26 -0
  10. data/docs/ConversationPbxCustomerSnapshotRequest.md +32 -0
  11. data/docs/ConversationPbxCustomerSnapshotResponse.md +30 -0
  12. data/docs/ConversationPbxMenu.md +36 -0
  13. data/docs/ConversationPbxMenuMapping.md +24 -0
  14. data/docs/ConversationPbxMenuResponse.md +26 -0
  15. data/docs/ConversationPbxMenusResponse.md +26 -0
  16. data/docs/ConversationPbxPhoneNumber.md +26 -0
  17. data/docs/ConversationPbxPhoneNumberResponse.md +26 -0
  18. data/docs/ConversationPbxPhoneNumbersResponse.md +26 -0
  19. data/docs/ConversationPbxQueue.md +52 -0
  20. data/docs/ConversationPbxQueueMembers.md +20 -0
  21. data/docs/ConversationPbxQueueResponse.md +26 -0
  22. data/docs/ConversationPbxQueuesResponse.md +26 -0
  23. data/docs/ConversationPbxTimeBased.md +24 -0
  24. data/docs/ConversationPbxTimeBasedMapping.md +24 -0
  25. data/docs/ConversationPbxTimeBasedMappingConfig.md +20 -0
  26. data/docs/ConversationPbxTimeBasedResponse.md +26 -0
  27. data/docs/ConversationPbxTimeBasedsResponse.md +26 -0
  28. data/docs/ConversationPbxTimeRange.md +26 -0
  29. data/docs/ConversationPbxTimeRangeConfig.md +28 -0
  30. data/docs/ConversationPbxTimeRangeResponse.md +26 -0
  31. data/docs/ConversationPbxTimeRangesResponse.md +26 -0
  32. data/docs/ConversationPbxVoicemailMailbox.md +38 -0
  33. data/docs/ConversationPbxVoicemailMailboxResponse.md +26 -0
  34. data/docs/ConversationPbxVoicemailMailboxesResponse.md +26 -0
  35. data/docs/WorkflowApi.md +69 -0
  36. data/docs/WorkflowTaskTagsResponse.md +26 -0
  37. data/lib/ultracart_api/api/conversation_api.rb +3422 -649
  38. data/lib/ultracart_api/api/workflow_api.rb +58 -0
  39. data/lib/ultracart_api/models/conversation_pbx_agent.rb +360 -0
  40. data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +256 -0
  41. data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +258 -0
  42. data/lib/ultracart_api/models/conversation_pbx_audio.rb +390 -0
  43. data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +256 -0
  44. data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +258 -0
  45. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +283 -0
  46. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +278 -0
  47. data/lib/ultracart_api/models/conversation_pbx_menu.rb +402 -0
  48. data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +250 -0
  49. data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +256 -0
  50. data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +258 -0
  51. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +335 -0
  52. data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +256 -0
  53. data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +258 -0
  54. data/lib/ultracart_api/models/conversation_pbx_queue.rb +539 -0
  55. data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +232 -0
  56. data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +256 -0
  57. data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +258 -0
  58. data/lib/ultracart_api/models/conversation_pbx_time_based.rb +246 -0
  59. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +310 -0
  60. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +231 -0
  61. data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +256 -0
  62. data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +258 -0
  63. data/lib/ultracart_api/models/conversation_pbx_time_range.rb +322 -0
  64. data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +270 -0
  65. data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +256 -0
  66. data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +258 -0
  67. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +440 -0
  68. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +256 -0
  69. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +258 -0
  70. data/lib/ultracart_api/models/workflow_task_tags_response.rb +259 -0
  71. data/lib/ultracart_api/version.rb +1 -1
  72. data/lib/ultracart_api.rb +32 -0
  73. metadata +66 -2
@@ -0,0 +1,283 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationPbxCustomerSnapshotRequest
18
+ attr_accessor :auto_order_expand
19
+
20
+ attr_accessor :customer_expand
21
+
22
+ attr_accessor :error
23
+
24
+ attr_accessor :metadata
25
+
26
+ attr_accessor :order_expand
27
+
28
+ attr_accessor :phone_number
29
+
30
+ # Indicates if API call was successful
31
+ attr_accessor :success
32
+
33
+ attr_accessor :warning
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'auto_order_expand' => :'auto_order_expand',
39
+ :'customer_expand' => :'customer_expand',
40
+ :'error' => :'error',
41
+ :'metadata' => :'metadata',
42
+ :'order_expand' => :'order_expand',
43
+ :'phone_number' => :'phone_number',
44
+ :'success' => :'success',
45
+ :'warning' => :'warning'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'auto_order_expand' => :'String',
58
+ :'customer_expand' => :'String',
59
+ :'error' => :'Error',
60
+ :'metadata' => :'ResponseMetadata',
61
+ :'order_expand' => :'String',
62
+ :'phone_number' => :'String',
63
+ :'success' => :'Boolean',
64
+ :'warning' => :'Warning'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxCustomerSnapshotRequest` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!self.class.attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxCustomerSnapshotRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'auto_order_expand')
90
+ self.auto_order_expand = attributes[:'auto_order_expand']
91
+ end
92
+
93
+ if attributes.key?(:'customer_expand')
94
+ self.customer_expand = attributes[:'customer_expand']
95
+ end
96
+
97
+ if attributes.key?(:'error')
98
+ self.error = attributes[:'error']
99
+ end
100
+
101
+ if attributes.key?(:'metadata')
102
+ self.metadata = attributes[:'metadata']
103
+ end
104
+
105
+ if attributes.key?(:'order_expand')
106
+ self.order_expand = attributes[:'order_expand']
107
+ end
108
+
109
+ if attributes.key?(:'phone_number')
110
+ self.phone_number = attributes[:'phone_number']
111
+ end
112
+
113
+ if attributes.key?(:'success')
114
+ self.success = attributes[:'success']
115
+ end
116
+
117
+ if attributes.key?(:'warning')
118
+ self.warning = attributes[:'warning']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = Array.new
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ auto_order_expand == o.auto_order_expand &&
141
+ customer_expand == o.customer_expand &&
142
+ error == o.error &&
143
+ metadata == o.metadata &&
144
+ order_expand == o.order_expand &&
145
+ phone_number == o.phone_number &&
146
+ success == o.success &&
147
+ warning == o.warning
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [auto_order_expand, customer_expand, error, metadata, order_expand, phone_number, success, warning].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ self.class.openapi_types.each_pair do |key, type|
176
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
177
+ self.send("#{key}=", nil)
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :Time
199
+ Time.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ # models (e.g. Pet) or oneOf
230
+ klass = UltracartClient.const_get(type)
231
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ end
@@ -0,0 +1,278 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationPbxCustomerSnapshotResponse
18
+ attr_accessor :auto_orders
19
+
20
+ attr_accessor :customer
21
+
22
+ attr_accessor :error
23
+
24
+ attr_accessor :metadata
25
+
26
+ attr_accessor :orders
27
+
28
+ # Indicates if API call was successful
29
+ attr_accessor :success
30
+
31
+ attr_accessor :warning
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'auto_orders' => :'auto_orders',
37
+ :'customer' => :'customer',
38
+ :'error' => :'error',
39
+ :'metadata' => :'metadata',
40
+ :'orders' => :'orders',
41
+ :'success' => :'success',
42
+ :'warning' => :'warning'
43
+ }
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'auto_orders' => :'Array<AutoOrder>',
55
+ :'customer' => :'Customer',
56
+ :'error' => :'Error',
57
+ :'metadata' => :'ResponseMetadata',
58
+ :'orders' => :'Array<Order>',
59
+ :'success' => :'Boolean',
60
+ :'warning' => :'Warning'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxCustomerSnapshotResponse` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxCustomerSnapshotResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'auto_orders')
86
+ if (value = attributes[:'auto_orders']).is_a?(Array)
87
+ self.auto_orders = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'customer')
92
+ self.customer = attributes[:'customer']
93
+ end
94
+
95
+ if attributes.key?(:'error')
96
+ self.error = attributes[:'error']
97
+ end
98
+
99
+ if attributes.key?(:'metadata')
100
+ self.metadata = attributes[:'metadata']
101
+ end
102
+
103
+ if attributes.key?(:'orders')
104
+ if (value = attributes[:'orders']).is_a?(Array)
105
+ self.orders = value
106
+ end
107
+ end
108
+
109
+ if attributes.key?(:'success')
110
+ self.success = attributes[:'success']
111
+ end
112
+
113
+ if attributes.key?(:'warning')
114
+ self.warning = attributes[:'warning']
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ invalid_properties = Array.new
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ true
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ auto_orders == o.auto_orders &&
137
+ customer == o.customer &&
138
+ error == o.error &&
139
+ metadata == o.metadata &&
140
+ orders == o.orders &&
141
+ success == o.success &&
142
+ warning == o.warning
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [auto_orders, customer, error, metadata, orders, success, warning].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ new.build_from_hash(attributes)
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ attributes = attributes.transform_keys(&:to_sym)
170
+ self.class.openapi_types.each_pair do |key, type|
171
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
172
+ self.send("#{key}=", nil)
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end
182
+ end
183
+
184
+ self
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def _deserialize(type, value)
192
+ case type.to_sym
193
+ when :Time
194
+ Time.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :Boolean
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ # models (e.g. Pet) or oneOf
225
+ klass = UltracartClient.const_get(type)
226
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
227
+ end
228
+ end
229
+
230
+ # Returns the string representation of the object
231
+ # @return [String] String presentation of the object
232
+ def to_s
233
+ to_hash.to_s
234
+ end
235
+
236
+ # to_body is an alias to to_hash (backward compatibility)
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_body
239
+ to_hash
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ if value.nil?
249
+ is_nullable = self.class.openapi_nullable.include?(attr)
250
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
251
+ end
252
+
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Outputs non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ # @param [Object] value Any valid value
261
+ # @return [Hash] Returns the value in the form of hash
262
+ def _to_hash(value)
263
+ if value.is_a?(Array)
264
+ value.compact.map { |v| _to_hash(v) }
265
+ elsif value.is_a?(Hash)
266
+ {}.tap do |hash|
267
+ value.each { |k, v| hash[k] = _to_hash(v) }
268
+ end
269
+ elsif value.respond_to? :to_hash
270
+ value.to_hash
271
+ else
272
+ value
273
+ end
274
+ end
275
+
276
+ end
277
+
278
+ end