ultracart_api 4.1.80 → 4.1.82

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -2
  3. data/docs/AgentSummary.md +30 -0
  4. data/docs/ConversationAgentCallEvent.md +30 -0
  5. data/docs/ConversationAgentChatEvent.md +26 -0
  6. data/docs/ConversationAgentStatusConfig.md +42 -0
  7. data/docs/ConversationAgentStatusConfigResponse.md +26 -0
  8. data/docs/ConversationAgentStatusConfigsResponse.md +26 -0
  9. data/docs/ConversationAgentStatusEvent.md +48 -0
  10. data/docs/ConversationAgentStatusHeatmapRequest.md +24 -0
  11. data/docs/ConversationAgentStatusHeatmapResponse.md +30 -0
  12. data/docs/ConversationAgentStatusHistorySearchRequest.md +28 -0
  13. data/docs/ConversationAgentStatusHistorySearchResponse.md +28 -0
  14. data/docs/ConversationAgentStatusRollup.md +38 -0
  15. data/docs/ConversationAgentStatusRollupSearchRequest.md +24 -0
  16. data/docs/ConversationAgentStatusRollupSearchResponse.md +26 -0
  17. data/docs/ConversationAgentStatusSummaryResponse.md +32 -0
  18. data/docs/ConversationAgentStatusTimelineResponse.md +32 -0
  19. data/docs/ConversationApi.md +600 -0
  20. data/docs/ConversationPbxDefaultTimezoneResponse.md +26 -0
  21. data/docs/ConversationPbxDefaultTimezoneUpdateRequest.md +18 -0
  22. data/docs/ConversationWebchatQueueStatusAgent.md +6 -0
  23. data/docs/ConversationWebchatQueueStatusUpdateRequest.md +5 -1
  24. data/docs/TimelineSummary.md +26 -0
  25. data/lib/ultracart_api/api/conversation_api.rb +766 -2
  26. data/lib/ultracart_api/models/agent_summary.rb +279 -0
  27. data/lib/ultracart_api/models/conversation_agent_call_event.rb +314 -0
  28. data/lib/ultracart_api/models/conversation_agent_chat_event.rb +260 -0
  29. data/lib/ultracart_api/models/conversation_agent_status_config.rb +461 -0
  30. data/lib/ultracart_api/models/conversation_agent_status_config_response.rb +256 -0
  31. data/lib/ultracart_api/models/conversation_agent_status_configs_response.rb +259 -0
  32. data/lib/ultracart_api/models/conversation_agent_status_event.rb +512 -0
  33. data/lib/ultracart_api/models/conversation_agent_status_heatmap_request.rb +296 -0
  34. data/lib/ultracart_api/models/conversation_agent_status_heatmap_response.rb +283 -0
  35. data/lib/ultracart_api/models/conversation_agent_status_history_search_request.rb +316 -0
  36. data/lib/ultracart_api/models/conversation_agent_status_history_search_response.rb +269 -0
  37. data/lib/ultracart_api/models/conversation_agent_status_rollup.rb +353 -0
  38. data/lib/ultracart_api/models/conversation_agent_status_rollup_search_request.rb +284 -0
  39. data/lib/ultracart_api/models/conversation_agent_status_rollup_search_response.rb +259 -0
  40. data/lib/ultracart_api/models/conversation_agent_status_summary_response.rb +288 -0
  41. data/lib/ultracart_api/models/conversation_agent_status_timeline_response.rb +292 -0
  42. data/lib/ultracart_api/models/conversation_pbx_default_timezone_response.rb +272 -0
  43. data/lib/ultracart_api/models/conversation_pbx_default_timezone_update_request.rb +235 -0
  44. data/lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb +31 -1
  45. data/lib/ultracart_api/models/conversation_webchat_queue_status_update_request.rb +24 -4
  46. data/lib/ultracart_api/models/timeline_summary.rb +260 -0
  47. data/lib/ultracart_api/version.rb +1 -1
  48. data/lib/ultracart_api.rb +19 -0
  49. metadata +40 -2
@@ -0,0 +1,279 @@
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 AgentSummary
18
+ # Agent display name
19
+ attr_accessor :agent_name
20
+
21
+ # Agent user id
22
+ attr_accessor :agent_user_id
23
+
24
+ attr_accessor :availability_pct
25
+
26
+ # Total Available seconds in the range (incl. Busy)
27
+ attr_accessor :available_seconds
28
+
29
+ # Calls taken in the range (PBX)
30
+ attr_accessor :calls_taken
31
+
32
+ # Chats handled in the range (chat)
33
+ attr_accessor :chats_handled
34
+
35
+ # Total tracked seconds in the range
36
+ attr_accessor :total_tracked_seconds
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'agent_name' => :'agent_name',
42
+ :'agent_user_id' => :'agent_user_id',
43
+ :'availability_pct' => :'availability_pct',
44
+ :'available_seconds' => :'available_seconds',
45
+ :'calls_taken' => :'calls_taken',
46
+ :'chats_handled' => :'chats_handled',
47
+ :'total_tracked_seconds' => :'total_tracked_seconds'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'agent_name' => :'String',
60
+ :'agent_user_id' => :'String',
61
+ :'availability_pct' => :'Object',
62
+ :'available_seconds' => :'Integer',
63
+ :'calls_taken' => :'Integer',
64
+ :'chats_handled' => :'Integer',
65
+ :'total_tracked_seconds' => :'Integer'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::AgentSummary` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::AgentSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'agent_name')
91
+ self.agent_name = attributes[:'agent_name']
92
+ end
93
+
94
+ if attributes.key?(:'agent_user_id')
95
+ self.agent_user_id = attributes[:'agent_user_id']
96
+ end
97
+
98
+ if attributes.key?(:'availability_pct')
99
+ self.availability_pct = attributes[:'availability_pct']
100
+ end
101
+
102
+ if attributes.key?(:'available_seconds')
103
+ self.available_seconds = attributes[:'available_seconds']
104
+ end
105
+
106
+ if attributes.key?(:'calls_taken')
107
+ self.calls_taken = attributes[:'calls_taken']
108
+ end
109
+
110
+ if attributes.key?(:'chats_handled')
111
+ self.chats_handled = attributes[:'chats_handled']
112
+ end
113
+
114
+ if attributes.key?(:'total_tracked_seconds')
115
+ self.total_tracked_seconds = attributes[:'total_tracked_seconds']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ true
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ agent_name == o.agent_name &&
138
+ agent_user_id == o.agent_user_id &&
139
+ availability_pct == o.availability_pct &&
140
+ available_seconds == o.available_seconds &&
141
+ calls_taken == o.calls_taken &&
142
+ chats_handled == o.chats_handled &&
143
+ total_tracked_seconds == o.total_tracked_seconds
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [agent_name, agent_user_id, availability_pct, available_seconds, calls_taken, chats_handled, total_tracked_seconds].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ new.build_from_hash(attributes)
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ self.class.openapi_types.each_pair do |key, type|
172
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
173
+ self.send("#{key}=", nil)
174
+ elsif type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
178
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
179
+ end
180
+ elsif !attributes[self.class.attribute_map[key]].nil?
181
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
182
+ end
183
+ end
184
+
185
+ self
186
+ end
187
+
188
+ # Deserializes the data based on type
189
+ # @param string type Data type
190
+ # @param string value Value to be deserialized
191
+ # @return [Object] Deserialized data
192
+ def _deserialize(type, value)
193
+ case type.to_sym
194
+ when :Time
195
+ Time.parse(value)
196
+ when :Date
197
+ Date.parse(value)
198
+ when :String
199
+ value.to_s
200
+ when :Integer
201
+ value.to_i
202
+ when :Float
203
+ value.to_f
204
+ when :Boolean
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ true
207
+ else
208
+ false
209
+ end
210
+ when :Object
211
+ # generic object (usually a Hash), return directly
212
+ value
213
+ when /\AArray<(?<inner_type>.+)>\z/
214
+ inner_type = Regexp.last_match[:inner_type]
215
+ value.map { |v| _deserialize(inner_type, v) }
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ k_type = Regexp.last_match[:k_type]
218
+ v_type = Regexp.last_match[:v_type]
219
+ {}.tap do |hash|
220
+ value.each do |k, v|
221
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
222
+ end
223
+ end
224
+ else # model
225
+ # models (e.g. Pet) or oneOf
226
+ klass = UltracartClient.const_get(type)
227
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
228
+ end
229
+ end
230
+
231
+ # Returns the string representation of the object
232
+ # @return [String] String presentation of the object
233
+ def to_s
234
+ to_hash.to_s
235
+ end
236
+
237
+ # to_body is an alias to to_hash (backward compatibility)
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_body
240
+ to_hash
241
+ end
242
+
243
+ # Returns the object in the form of hash
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_hash
246
+ hash = {}
247
+ self.class.attribute_map.each_pair do |attr, param|
248
+ value = self.send(attr)
249
+ if value.nil?
250
+ is_nullable = self.class.openapi_nullable.include?(attr)
251
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
252
+ end
253
+
254
+ hash[param] = _to_hash(value)
255
+ end
256
+ hash
257
+ end
258
+
259
+ # Outputs non-array value in the form of hash
260
+ # For object, use to_hash. Otherwise, just return the value
261
+ # @param [Object] value Any valid value
262
+ # @return [Hash] Returns the value in the form of hash
263
+ def _to_hash(value)
264
+ if value.is_a?(Array)
265
+ value.compact.map { |v| _to_hash(v) }
266
+ elsif value.is_a?(Hash)
267
+ {}.tap do |hash|
268
+ value.each { |k, v| hash[k] = _to_hash(v) }
269
+ end
270
+ elsif value.respond_to? :to_hash
271
+ value.to_hash
272
+ else
273
+ value
274
+ end
275
+ end
276
+
277
+ end
278
+
279
+ end
@@ -0,0 +1,314 @@
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 ConversationAgentCallEvent
18
+ # Call UUID
19
+ attr_accessor :call_uuid
20
+
21
+ # Direction
22
+ attr_accessor :direction
23
+
24
+ # Call disposition (e.g. 'answered', 'missed')
25
+ attr_accessor :disposition
26
+
27
+ # Total call duration in seconds
28
+ attr_accessor :duration_seconds
29
+
30
+ # Call ended
31
+ attr_accessor :end_dts
32
+
33
+ # Counterparty phone number
34
+ attr_accessor :phone_number
35
+
36
+ # Call started
37
+ attr_accessor :start_dts
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'call_uuid' => :'call_uuid',
65
+ :'direction' => :'direction',
66
+ :'disposition' => :'disposition',
67
+ :'duration_seconds' => :'duration_seconds',
68
+ :'end_dts' => :'end_dts',
69
+ :'phone_number' => :'phone_number',
70
+ :'start_dts' => :'start_dts'
71
+ }
72
+ end
73
+
74
+ # Returns all the JSON keys this model knows about
75
+ def self.acceptable_attributes
76
+ attribute_map.values
77
+ end
78
+
79
+ # Attribute type mapping.
80
+ def self.openapi_types
81
+ {
82
+ :'call_uuid' => :'String',
83
+ :'direction' => :'String',
84
+ :'disposition' => :'String',
85
+ :'duration_seconds' => :'Integer',
86
+ :'end_dts' => :'String',
87
+ :'phone_number' => :'String',
88
+ :'start_dts' => :'String'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentCallEvent` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!self.class.attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentCallEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'call_uuid')
114
+ self.call_uuid = attributes[:'call_uuid']
115
+ end
116
+
117
+ if attributes.key?(:'direction')
118
+ self.direction = attributes[:'direction']
119
+ end
120
+
121
+ if attributes.key?(:'disposition')
122
+ self.disposition = attributes[:'disposition']
123
+ end
124
+
125
+ if attributes.key?(:'duration_seconds')
126
+ self.duration_seconds = attributes[:'duration_seconds']
127
+ end
128
+
129
+ if attributes.key?(:'end_dts')
130
+ self.end_dts = attributes[:'end_dts']
131
+ end
132
+
133
+ if attributes.key?(:'phone_number')
134
+ self.phone_number = attributes[:'phone_number']
135
+ end
136
+
137
+ if attributes.key?(:'start_dts')
138
+ self.start_dts = attributes[:'start_dts']
139
+ end
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properties with the reasons
144
+ def list_invalid_properties
145
+ invalid_properties = Array.new
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ direction_validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
153
+ return false unless direction_validator.valid?(@direction)
154
+ true
155
+ end
156
+
157
+ # Custom attribute writer method checking allowed values (enum).
158
+ # @param [Object] direction Object to be assigned
159
+ def direction=(direction)
160
+ validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
161
+ unless validator.valid?(direction)
162
+ fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}."
163
+ end
164
+ @direction = direction
165
+ end
166
+
167
+ # Checks equality by comparing each attribute.
168
+ # @param [Object] Object to be compared
169
+ def ==(o)
170
+ return true if self.equal?(o)
171
+ self.class == o.class &&
172
+ call_uuid == o.call_uuid &&
173
+ direction == o.direction &&
174
+ disposition == o.disposition &&
175
+ duration_seconds == o.duration_seconds &&
176
+ end_dts == o.end_dts &&
177
+ phone_number == o.phone_number &&
178
+ start_dts == o.start_dts
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [call_uuid, direction, disposition, duration_seconds, end_dts, phone_number, start_dts].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ new.build_from_hash(attributes)
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ attributes = attributes.transform_keys(&:to_sym)
206
+ self.class.openapi_types.each_pair do |key, type|
207
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
208
+ self.send("#{key}=", nil)
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
213
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
214
+ end
215
+ elsif !attributes[self.class.attribute_map[key]].nil?
216
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
217
+ end
218
+ end
219
+
220
+ self
221
+ end
222
+
223
+ # Deserializes the data based on type
224
+ # @param string type Data type
225
+ # @param string value Value to be deserialized
226
+ # @return [Object] Deserialized data
227
+ def _deserialize(type, value)
228
+ case type.to_sym
229
+ when :Time
230
+ Time.parse(value)
231
+ when :Date
232
+ Date.parse(value)
233
+ when :String
234
+ value.to_s
235
+ when :Integer
236
+ value.to_i
237
+ when :Float
238
+ value.to_f
239
+ when :Boolean
240
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
241
+ true
242
+ else
243
+ false
244
+ end
245
+ when :Object
246
+ # generic object (usually a Hash), return directly
247
+ value
248
+ when /\AArray<(?<inner_type>.+)>\z/
249
+ inner_type = Regexp.last_match[:inner_type]
250
+ value.map { |v| _deserialize(inner_type, v) }
251
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
252
+ k_type = Regexp.last_match[:k_type]
253
+ v_type = Regexp.last_match[:v_type]
254
+ {}.tap do |hash|
255
+ value.each do |k, v|
256
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
+ end
258
+ end
259
+ else # model
260
+ # models (e.g. Pet) or oneOf
261
+ klass = UltracartClient.const_get(type)
262
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
263
+ end
264
+ end
265
+
266
+ # Returns the string representation of the object
267
+ # @return [String] String presentation of the object
268
+ def to_s
269
+ to_hash.to_s
270
+ end
271
+
272
+ # to_body is an alias to to_hash (backward compatibility)
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_body
275
+ to_hash
276
+ end
277
+
278
+ # Returns the object in the form of hash
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_hash
281
+ hash = {}
282
+ self.class.attribute_map.each_pair do |attr, param|
283
+ value = self.send(attr)
284
+ if value.nil?
285
+ is_nullable = self.class.openapi_nullable.include?(attr)
286
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
287
+ end
288
+
289
+ hash[param] = _to_hash(value)
290
+ end
291
+ hash
292
+ end
293
+
294
+ # Outputs non-array value in the form of hash
295
+ # For object, use to_hash. Otherwise, just return the value
296
+ # @param [Object] value Any valid value
297
+ # @return [Hash] Returns the value in the form of hash
298
+ def _to_hash(value)
299
+ if value.is_a?(Array)
300
+ value.compact.map { |v| _to_hash(v) }
301
+ elsif value.is_a?(Hash)
302
+ {}.tap do |hash|
303
+ value.each { |k, v| hash[k] = _to_hash(v) }
304
+ end
305
+ elsif value.respond_to? :to_hash
306
+ value.to_hash
307
+ else
308
+ value
309
+ end
310
+ end
311
+
312
+ end
313
+
314
+ end