onfido 6.1.0 → 6.3.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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +17 -1
  4. data/lib/onfido/api/default_api.rb +492 -79
  5. data/lib/onfido/api_client.rb +6 -2
  6. data/lib/onfido/configuration.rb +88 -0
  7. data/lib/onfido/models/biometric_token.rb +265 -0
  8. data/lib/onfido/models/biometric_token_data.rb +317 -0
  9. data/lib/onfido/models/biometric_token_response.rb +237 -0
  10. data/lib/onfido/models/biometric_token_updater.rb +262 -0
  11. data/lib/onfido/models/biometric_tokens_response.rb +239 -0
  12. data/lib/onfido/models/document_types.rb +3 -1
  13. data/lib/onfido/models/invalidated_biometric_token_response.rb +237 -0
  14. data/lib/onfido/models/invalidated_biometric_token_summary.rb +238 -0
  15. data/lib/onfido/models/invalidated_biometric_token_summary_deleted_items.rb +239 -0
  16. data/lib/onfido/models/invalidated_biometric_tokens_response.rb +237 -0
  17. data/lib/onfido/models/updated_biometric_token_response.rb +237 -0
  18. data/lib/onfido/models/watchlist_mesh_added_mentions.rb +247 -0
  19. data/lib/onfido/models/watchlist_mesh_alert_risk.rb +323 -0
  20. data/lib/onfido/models/watchlist_mesh_alert_risk1.rb +316 -0
  21. data/lib/onfido/models/watchlist_mesh_associate.rb +231 -0
  22. data/lib/onfido/models/watchlist_mesh_date_value.rb +231 -0
  23. data/lib/onfido/models/watchlist_mesh_field.rb +241 -0
  24. data/lib/onfido/models/watchlist_mesh_image.rb +231 -0
  25. data/lib/onfido/models/watchlist_mesh_lists.rb +309 -0
  26. data/lib/onfido/models/watchlist_mesh_media.rb +261 -0
  27. data/lib/onfido/models/watchlist_mesh_name.rb +231 -0
  28. data/lib/onfido/models/watchlist_mesh_pep.rb +369 -0
  29. data/lib/onfido/models/watchlist_mesh_person.rb +283 -0
  30. data/lib/onfido/models/watchlist_mesh_profile.rb +273 -0
  31. data/lib/onfido/models/watchlist_mesh_risk_decision.rb +43 -0
  32. data/lib/onfido/models/watchlist_mesh_risk_detail.rb +255 -0
  33. data/lib/onfido/models/watchlist_mesh_risk_indicators.rb +271 -0
  34. data/lib/onfido/models/watchlist_mesh_sanctions.rb +309 -0
  35. data/lib/onfido/models/webhook.rb +11 -1
  36. data/lib/onfido/models/webhook_builder.rb +11 -1
  37. data/lib/onfido/models/webhook_create.rb +11 -1
  38. data/lib/onfido/models/webhook_response.rb +11 -1
  39. data/lib/onfido/models/webhook_update.rb +11 -1
  40. data/lib/onfido/models/webhook_updater.rb +11 -1
  41. data/lib/onfido/version.rb +1 -1
  42. data/lib/onfido.rb +27 -0
  43. data/spec/integrations/biometric_token_spec.rb +122 -0
  44. data/spec/integrations/document_spec.rb +8 -1
  45. data/spec/integrations/media/nfc_data.json +11768 -0
  46. data/spec/integrations/watchlist_alert_risk_spec.rb +66 -0
  47. data/spec/shared_contexts/with_document.rb +0 -1
  48. data/spec/shared_contexts/with_onfido.rb +14 -2
  49. data/spec/spec_helper.rb +6 -7
  50. metadata +57 -24
@@ -0,0 +1,231 @@
1
+ =begin
2
+ #Onfido Public API v3.6
3
+
4
+ #The Onfido Public API (v3.6)
5
+
6
+ The version of the OpenAPI document: v3.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.16.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Onfido
17
+ class WatchlistMeshName
18
+ attr_accessor :name
19
+
20
+ attr_accessor :type
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'name' => :'name',
26
+ :'type' => :'type'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'name' => :'String',
44
+ :'type' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ :'name',
52
+ :'type'
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::WatchlistMeshName` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::WatchlistMeshName`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.key?(:'type')
77
+ self.type = attributes[:'type']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ name == o.name &&
102
+ type == o.type
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [name, type].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def self._deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = Onfido.const_get(type)
179
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -0,0 +1,369 @@
1
+ =begin
2
+ #Onfido Public API v3.6
3
+
4
+ #The Onfido Public API (v3.6)
5
+
6
+ The version of the OpenAPI document: v3.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.16.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Onfido
17
+ class WatchlistMeshPep
18
+ attr_accessor :aml_types
19
+
20
+ attr_accessor :active_end_dates
21
+
22
+ attr_accessor :active_start_dates
23
+
24
+ attr_accessor :country_codes
25
+
26
+ attr_accessor :fields
27
+
28
+ attr_accessor :identifier
29
+
30
+ attr_accessor :listing_ended_utc
31
+
32
+ attr_accessor :listing_started_utc
33
+
34
+ attr_accessor :name
35
+
36
+ attr_accessor :political_parties
37
+
38
+ attr_accessor :political_positions
39
+
40
+ attr_accessor :political_regions
41
+
42
+ attr_accessor :related_urls
43
+
44
+ attr_accessor :url
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'aml_types' => :'aml_types',
50
+ :'active_end_dates' => :'active_end_dates',
51
+ :'active_start_dates' => :'active_start_dates',
52
+ :'country_codes' => :'country_codes',
53
+ :'fields' => :'fields',
54
+ :'identifier' => :'identifier',
55
+ :'listing_ended_utc' => :'listing_ended_utc',
56
+ :'listing_started_utc' => :'listing_started_utc',
57
+ :'name' => :'name',
58
+ :'political_parties' => :'political_parties',
59
+ :'political_positions' => :'political_positions',
60
+ :'political_regions' => :'political_regions',
61
+ :'related_urls' => :'related_urls',
62
+ :'url' => :'url'
63
+ }
64
+ end
65
+
66
+ # Returns attribute mapping this model knows about
67
+ def self.acceptable_attribute_map
68
+ attribute_map
69
+ end
70
+
71
+ # Returns all the JSON keys this model knows about
72
+ def self.acceptable_attributes
73
+ acceptable_attribute_map.values
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.openapi_types
78
+ {
79
+ :'aml_types' => :'Array<String>',
80
+ :'active_end_dates' => :'Array<String>',
81
+ :'active_start_dates' => :'Array<String>',
82
+ :'country_codes' => :'Array<String>',
83
+ :'fields' => :'Array<WatchlistMeshField>',
84
+ :'identifier' => :'String',
85
+ :'listing_ended_utc' => :'String',
86
+ :'listing_started_utc' => :'String',
87
+ :'name' => :'String',
88
+ :'political_parties' => :'Array<String>',
89
+ :'political_positions' => :'Array<String>',
90
+ :'political_regions' => :'Array<String>',
91
+ :'related_urls' => :'Array<String>',
92
+ :'url' => :'String'
93
+ }
94
+ end
95
+
96
+ # List of attributes with nullable: true
97
+ def self.openapi_nullable
98
+ Set.new([
99
+ :'aml_types',
100
+ :'active_end_dates',
101
+ :'active_start_dates',
102
+ :'country_codes',
103
+ :'fields',
104
+ :'identifier',
105
+ :'listing_ended_utc',
106
+ :'listing_started_utc',
107
+ :'name',
108
+ :'political_parties',
109
+ :'political_positions',
110
+ :'political_regions',
111
+ :'related_urls',
112
+ :'url'
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::WatchlistMeshPep` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ acceptable_attribute_map = self.class.acceptable_attribute_map
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!acceptable_attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::WatchlistMeshPep`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'aml_types')
133
+ if (value = attributes[:'aml_types']).is_a?(Array)
134
+ self.aml_types = value
135
+ end
136
+ end
137
+
138
+ if attributes.key?(:'active_end_dates')
139
+ if (value = attributes[:'active_end_dates']).is_a?(Array)
140
+ self.active_end_dates = value
141
+ end
142
+ end
143
+
144
+ if attributes.key?(:'active_start_dates')
145
+ if (value = attributes[:'active_start_dates']).is_a?(Array)
146
+ self.active_start_dates = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'country_codes')
151
+ if (value = attributes[:'country_codes']).is_a?(Array)
152
+ self.country_codes = value
153
+ end
154
+ end
155
+
156
+ if attributes.key?(:'fields')
157
+ if (value = attributes[:'fields']).is_a?(Array)
158
+ self.fields = value
159
+ end
160
+ end
161
+
162
+ if attributes.key?(:'identifier')
163
+ self.identifier = attributes[:'identifier']
164
+ end
165
+
166
+ if attributes.key?(:'listing_ended_utc')
167
+ self.listing_ended_utc = attributes[:'listing_ended_utc']
168
+ end
169
+
170
+ if attributes.key?(:'listing_started_utc')
171
+ self.listing_started_utc = attributes[:'listing_started_utc']
172
+ end
173
+
174
+ if attributes.key?(:'name')
175
+ self.name = attributes[:'name']
176
+ end
177
+
178
+ if attributes.key?(:'political_parties')
179
+ if (value = attributes[:'political_parties']).is_a?(Array)
180
+ self.political_parties = value
181
+ end
182
+ end
183
+
184
+ if attributes.key?(:'political_positions')
185
+ if (value = attributes[:'political_positions']).is_a?(Array)
186
+ self.political_positions = value
187
+ end
188
+ end
189
+
190
+ if attributes.key?(:'political_regions')
191
+ if (value = attributes[:'political_regions']).is_a?(Array)
192
+ self.political_regions = value
193
+ end
194
+ end
195
+
196
+ if attributes.key?(:'related_urls')
197
+ if (value = attributes[:'related_urls']).is_a?(Array)
198
+ self.related_urls = value
199
+ end
200
+ end
201
+
202
+ if attributes.key?(:'url')
203
+ self.url = attributes[:'url']
204
+ end
205
+ end
206
+
207
+ # Show invalid properties with the reasons. Usually used together with valid?
208
+ # @return Array for valid properties with the reasons
209
+ def list_invalid_properties
210
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
211
+ invalid_properties = Array.new
212
+ invalid_properties
213
+ end
214
+
215
+ # Check to see if the all the properties in the model are valid
216
+ # @return true if the model is valid
217
+ def valid?
218
+ warn '[DEPRECATED] the `valid?` method is obsolete'
219
+ true
220
+ end
221
+
222
+ # Checks equality by comparing each attribute.
223
+ # @param [Object] Object to be compared
224
+ def ==(o)
225
+ return true if self.equal?(o)
226
+ self.class == o.class &&
227
+ aml_types == o.aml_types &&
228
+ active_end_dates == o.active_end_dates &&
229
+ active_start_dates == o.active_start_dates &&
230
+ country_codes == o.country_codes &&
231
+ fields == o.fields &&
232
+ identifier == o.identifier &&
233
+ listing_ended_utc == o.listing_ended_utc &&
234
+ listing_started_utc == o.listing_started_utc &&
235
+ name == o.name &&
236
+ political_parties == o.political_parties &&
237
+ political_positions == o.political_positions &&
238
+ political_regions == o.political_regions &&
239
+ related_urls == o.related_urls &&
240
+ url == o.url
241
+ end
242
+
243
+ # @see the `==` method
244
+ # @param [Object] Object to be compared
245
+ def eql?(o)
246
+ self == o
247
+ end
248
+
249
+ # Calculates hash code according to all attributes.
250
+ # @return [Integer] Hash code
251
+ def hash
252
+ [aml_types, active_end_dates, active_start_dates, country_codes, fields, identifier, listing_ended_utc, listing_started_utc, name, political_parties, political_positions, political_regions, related_urls, url].hash
253
+ end
254
+
255
+ # Builds the object from hash
256
+ # @param [Hash] attributes Model attributes in the form of hash
257
+ # @return [Object] Returns the model itself
258
+ def self.build_from_hash(attributes)
259
+ return nil unless attributes.is_a?(Hash)
260
+ attributes = attributes.transform_keys(&:to_sym)
261
+ transformed_hash = {}
262
+ openapi_types.each_pair do |key, type|
263
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
264
+ transformed_hash["#{key}"] = nil
265
+ elsif type =~ /\AArray<(.*)>/i
266
+ # check to ensure the input is an array given that the attribute
267
+ # is documented as an array but the input is not
268
+ if attributes[attribute_map[key]].is_a?(Array)
269
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
270
+ end
271
+ elsif !attributes[attribute_map[key]].nil?
272
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
273
+ end
274
+ end
275
+ new(transformed_hash)
276
+ end
277
+
278
+ # Deserializes the data based on type
279
+ # @param string type Data type
280
+ # @param string value Value to be deserialized
281
+ # @return [Object] Deserialized data
282
+ def self._deserialize(type, value)
283
+ case type.to_sym
284
+ when :Time
285
+ Time.parse(value)
286
+ when :Date
287
+ Date.parse(value)
288
+ when :String
289
+ value.to_s
290
+ when :Integer
291
+ value.to_i
292
+ when :Float
293
+ value.to_f
294
+ when :Boolean
295
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
296
+ true
297
+ else
298
+ false
299
+ end
300
+ when :Object
301
+ # generic object (usually a Hash), return directly
302
+ value
303
+ when /\AArray<(?<inner_type>.+)>\z/
304
+ inner_type = Regexp.last_match[:inner_type]
305
+ value.map { |v| _deserialize(inner_type, v) }
306
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
307
+ k_type = Regexp.last_match[:k_type]
308
+ v_type = Regexp.last_match[:v_type]
309
+ {}.tap do |hash|
310
+ value.each do |k, v|
311
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
312
+ end
313
+ end
314
+ else # model
315
+ # models (e.g. Pet) or oneOf
316
+ klass = Onfido.const_get(type)
317
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
318
+ end
319
+ end
320
+
321
+ # Returns the string representation of the object
322
+ # @return [String] String presentation of the object
323
+ def to_s
324
+ to_hash.to_s
325
+ end
326
+
327
+ # to_body is an alias to to_hash (backward compatibility)
328
+ # @return [Hash] Returns the object in the form of hash
329
+ def to_body
330
+ to_hash
331
+ end
332
+
333
+ # Returns the object in the form of hash
334
+ # @return [Hash] Returns the object in the form of hash
335
+ def to_hash
336
+ hash = {}
337
+ self.class.attribute_map.each_pair do |attr, param|
338
+ value = self.send(attr)
339
+ if value.nil?
340
+ is_nullable = self.class.openapi_nullable.include?(attr)
341
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
342
+ end
343
+
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
+
367
+ end
368
+
369
+ end