ultracart_api 4.1.236 → 4.1.238

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 +20 -2
  3. data/docs/SfvbApi.md +338 -0
  4. data/docs/SfvbApprovalCreateRequest.md +4 -0
  5. data/docs/SfvbDocsGap.md +28 -0
  6. data/docs/SfvbDocsGapReport.md +24 -0
  7. data/docs/SfvbDocsGapReportGap.md +26 -0
  8. data/docs/SfvbItemPreorder.md +36 -0
  9. data/docs/SfvbItemPreorderChange.md +24 -0
  10. data/docs/SfvbItemPreorderChildRow.md +20 -0
  11. data/docs/SfvbItemPreorderChildrenRequest.md +24 -0
  12. data/docs/SfvbItemPreorderListResponse.md +20 -0
  13. data/docs/SfvbItemPreorderOption.md +20 -0
  14. data/docs/SfvbItemPreorderRequest.md +22 -0
  15. data/docs/SfvbWhoamiResponse.md +4 -0
  16. data/docs/TaxJarConfig.md +2 -0
  17. data/lib/ultracart_api/api/sfvb_api.rb +451 -0
  18. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +21 -3
  19. data/lib/ultracart_api/models/sfvb_docs_gap.rb +304 -0
  20. data/lib/ultracart_api/models/sfvb_docs_gap_report.rb +249 -0
  21. data/lib/ultracart_api/models/sfvb_docs_gap_report_gap.rb +262 -0
  22. data/lib/ultracart_api/models/sfvb_item_preorder.rb +347 -0
  23. data/lib/ultracart_api/models/sfvb_item_preorder_change.rb +250 -0
  24. data/lib/ultracart_api/models/sfvb_item_preorder_child_row.rb +230 -0
  25. data/lib/ultracart_api/models/sfvb_item_preorder_children_request.rb +252 -0
  26. data/lib/ultracart_api/models/sfvb_item_preorder_list_response.rb +231 -0
  27. data/lib/ultracart_api/models/sfvb_item_preorder_option.rb +230 -0
  28. data/lib/ultracart_api/models/sfvb_item_preorder_request.rb +240 -0
  29. data/lib/ultracart_api/models/sfvb_whoami_response.rb +21 -1
  30. data/lib/ultracart_api/models/tax_jar_config.rb +11 -1
  31. data/lib/ultracart_api/version.rb +1 -1
  32. data/lib/ultracart_api.rb +10 -0
  33. metadata +22 -2
@@ -0,0 +1,262 @@
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 SfvbDocsGapReportGap
18
+ # The nearest documentation page, an absolute http or https URL of at most 2000 characters. Leave it out when no page exists.
19
+ attr_accessor :documentation_url
20
+
21
+ # 1 to 20 sanitized evidence descriptions or links, each at most 8000 characters.
22
+ attr_accessor :evidence
23
+
24
+ # What the documentation should say, at most 8000 characters.
25
+ attr_accessor :expected
26
+
27
+ # The confirmed behavior, or the guidance that is missing, at most 8000 characters.
28
+ attr_accessor :observed
29
+
30
+ # A short description of the gap, at most 200 characters.
31
+ attr_accessor :title
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'documentation_url' => :'documentation_url',
37
+ :'evidence' => :'evidence',
38
+ :'expected' => :'expected',
39
+ :'observed' => :'observed',
40
+ :'title' => :'title'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'documentation_url' => :'String',
53
+ :'evidence' => :'Array<String>',
54
+ :'expected' => :'String',
55
+ :'observed' => :'String',
56
+ :'title' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbDocsGapReportGap` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbDocsGapReportGap`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'documentation_url')
82
+ self.documentation_url = attributes[:'documentation_url']
83
+ end
84
+
85
+ if attributes.key?(:'evidence')
86
+ if (value = attributes[:'evidence']).is_a?(Array)
87
+ self.evidence = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'expected')
92
+ self.expected = attributes[:'expected']
93
+ end
94
+
95
+ if attributes.key?(:'observed')
96
+ self.observed = attributes[:'observed']
97
+ end
98
+
99
+ if attributes.key?(:'title')
100
+ self.title = attributes[:'title']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ invalid_properties = Array.new
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ documentation_url == o.documentation_url &&
123
+ evidence == o.evidence &&
124
+ expected == o.expected &&
125
+ observed == o.observed &&
126
+ title == o.title
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [documentation_url, evidence, expected, observed, title].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ new.build_from_hash(attributes)
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ attributes = attributes.transform_keys(&:to_sym)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
156
+ self.send("#{key}=", nil)
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :Time
178
+ Time.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet) or oneOf
209
+ klass = UltracartClient.const_get(type)
210
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -0,0 +1,347 @@
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 SfvbItemPreorder
18
+ attr_accessor :changed
19
+
20
+ # The expected date, YYYY-MM-DD, or null when none is set.
21
+ attr_accessor :eta
22
+
23
+ # The hash of preorder and eta. Send it as If-Match, or as the row's hash_sha256, to change them.
24
+ attr_accessor :hash_sha256
25
+
26
+ # The item's merchant item id.
27
+ attr_accessor :merchant_item_id
28
+
29
+ # The item.
30
+ attr_accessor :merchant_item_oid
31
+
32
+ # True when the item is on pre-order. Shoppers can order it while out of stock, and its orders go to the Pre-ordered stage.
33
+ attr_accessor :preorder
34
+
35
+ # What itempreorder shows. preorder_with_eta when on pre-order with an ETA of today or later, preorder_no_eta when on pre-order with no ETA or a past one, nothing when not on pre-order.
36
+ attr_accessor :shoppers_see
37
+
38
+ # shoppers_see in words, such as on pre-order, ETA 2026-11-20.
39
+ attr_accessor :shoppers_see_text
40
+
41
+ # For a variation listed under its parent, the option values that pick it, such as Size 2T.
42
+ attr_accessor :variation_values
43
+
44
+ # After a change, things worth knowing about the new values, such as an ETA in the past. Never a refusal.
45
+ attr_accessor :warnings
46
+
47
+ class EnumAttributeValidator
48
+ attr_reader :datatype
49
+ attr_reader :allowable_values
50
+
51
+ def initialize(datatype, allowable_values)
52
+ @allowable_values = allowable_values.map do |value|
53
+ case datatype.to_s
54
+ when /Integer/i
55
+ value.to_i
56
+ when /Float/i
57
+ value.to_f
58
+ else
59
+ value
60
+ end
61
+ end
62
+ end
63
+
64
+ def valid?(value)
65
+ !value || allowable_values.include?(value)
66
+ end
67
+ end
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'changed' => :'changed',
73
+ :'eta' => :'eta',
74
+ :'hash_sha256' => :'hash_sha256',
75
+ :'merchant_item_id' => :'merchant_item_id',
76
+ :'merchant_item_oid' => :'merchant_item_oid',
77
+ :'preorder' => :'preorder',
78
+ :'shoppers_see' => :'shoppers_see',
79
+ :'shoppers_see_text' => :'shoppers_see_text',
80
+ :'variation_values' => :'variation_values',
81
+ :'warnings' => :'warnings'
82
+ }
83
+ end
84
+
85
+ # Returns all the JSON keys this model knows about
86
+ def self.acceptable_attributes
87
+ attribute_map.values
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.openapi_types
92
+ {
93
+ :'changed' => :'SfvbItemPreorderChange',
94
+ :'eta' => :'String',
95
+ :'hash_sha256' => :'String',
96
+ :'merchant_item_id' => :'String',
97
+ :'merchant_item_oid' => :'Integer',
98
+ :'preorder' => :'Boolean',
99
+ :'shoppers_see' => :'String',
100
+ :'shoppers_see_text' => :'String',
101
+ :'variation_values' => :'Array<SfvbItemPreorderOption>',
102
+ :'warnings' => :'Array<String>'
103
+ }
104
+ end
105
+
106
+ # List of attributes with nullable: true
107
+ def self.openapi_nullable
108
+ Set.new([
109
+ ])
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ if (!attributes.is_a?(Hash))
116
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemPreorder` initialize method"
117
+ end
118
+
119
+ # check to see if the attribute exists and convert string to symbol for hash key
120
+ attributes = attributes.each_with_object({}) { |(k, v), h|
121
+ if (!self.class.attribute_map.key?(k.to_sym))
122
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemPreorder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
123
+ end
124
+ h[k.to_sym] = v
125
+ }
126
+
127
+ if attributes.key?(:'changed')
128
+ self.changed = attributes[:'changed']
129
+ end
130
+
131
+ if attributes.key?(:'eta')
132
+ self.eta = attributes[:'eta']
133
+ end
134
+
135
+ if attributes.key?(:'hash_sha256')
136
+ self.hash_sha256 = attributes[:'hash_sha256']
137
+ end
138
+
139
+ if attributes.key?(:'merchant_item_id')
140
+ self.merchant_item_id = attributes[:'merchant_item_id']
141
+ end
142
+
143
+ if attributes.key?(:'merchant_item_oid')
144
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
145
+ end
146
+
147
+ if attributes.key?(:'preorder')
148
+ self.preorder = attributes[:'preorder']
149
+ end
150
+
151
+ if attributes.key?(:'shoppers_see')
152
+ self.shoppers_see = attributes[:'shoppers_see']
153
+ end
154
+
155
+ if attributes.key?(:'shoppers_see_text')
156
+ self.shoppers_see_text = attributes[:'shoppers_see_text']
157
+ end
158
+
159
+ if attributes.key?(:'variation_values')
160
+ if (value = attributes[:'variation_values']).is_a?(Array)
161
+ self.variation_values = value
162
+ end
163
+ end
164
+
165
+ if attributes.key?(:'warnings')
166
+ if (value = attributes[:'warnings']).is_a?(Array)
167
+ self.warnings = value
168
+ end
169
+ end
170
+ end
171
+
172
+ # Show invalid properties with the reasons. Usually used together with valid?
173
+ # @return Array for valid properties with the reasons
174
+ def list_invalid_properties
175
+ invalid_properties = Array.new
176
+ invalid_properties
177
+ end
178
+
179
+ # Check to see if the all the properties in the model are valid
180
+ # @return true if the model is valid
181
+ def valid?
182
+ shoppers_see_validator = EnumAttributeValidator.new('String', ["preorder_with_eta", "preorder_no_eta", "nothing"])
183
+ return false unless shoppers_see_validator.valid?(@shoppers_see)
184
+ true
185
+ end
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] shoppers_see Object to be assigned
189
+ def shoppers_see=(shoppers_see)
190
+ validator = EnumAttributeValidator.new('String', ["preorder_with_eta", "preorder_no_eta", "nothing"])
191
+ unless validator.valid?(shoppers_see)
192
+ fail ArgumentError, "invalid value for \"shoppers_see\", must be one of #{validator.allowable_values}."
193
+ end
194
+ @shoppers_see = shoppers_see
195
+ end
196
+
197
+ # Checks equality by comparing each attribute.
198
+ # @param [Object] Object to be compared
199
+ def ==(o)
200
+ return true if self.equal?(o)
201
+ self.class == o.class &&
202
+ changed == o.changed &&
203
+ eta == o.eta &&
204
+ hash_sha256 == o.hash_sha256 &&
205
+ merchant_item_id == o.merchant_item_id &&
206
+ merchant_item_oid == o.merchant_item_oid &&
207
+ preorder == o.preorder &&
208
+ shoppers_see == o.shoppers_see &&
209
+ shoppers_see_text == o.shoppers_see_text &&
210
+ variation_values == o.variation_values &&
211
+ warnings == o.warnings
212
+ end
213
+
214
+ # @see the `==` method
215
+ # @param [Object] Object to be compared
216
+ def eql?(o)
217
+ self == o
218
+ end
219
+
220
+ # Calculates hash code according to all attributes.
221
+ # @return [Integer] Hash code
222
+ def hash
223
+ [changed, eta, hash_sha256, merchant_item_id, merchant_item_oid, preorder, shoppers_see, shoppers_see_text, variation_values, warnings].hash
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def self.build_from_hash(attributes)
230
+ new.build_from_hash(attributes)
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def build_from_hash(attributes)
237
+ return nil unless attributes.is_a?(Hash)
238
+ attributes = attributes.transform_keys(&:to_sym)
239
+ self.class.openapi_types.each_pair do |key, type|
240
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
241
+ self.send("#{key}=", nil)
242
+ elsif type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
246
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
247
+ end
248
+ elsif !attributes[self.class.attribute_map[key]].nil?
249
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
250
+ end
251
+ end
252
+
253
+ self
254
+ end
255
+
256
+ # Deserializes the data based on type
257
+ # @param string type Data type
258
+ # @param string value Value to be deserialized
259
+ # @return [Object] Deserialized data
260
+ def _deserialize(type, value)
261
+ case type.to_sym
262
+ when :Time
263
+ Time.parse(value)
264
+ when :Date
265
+ Date.parse(value)
266
+ when :String
267
+ value.to_s
268
+ when :Integer
269
+ value.to_i
270
+ when :Float
271
+ value.to_f
272
+ when :Boolean
273
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
274
+ true
275
+ else
276
+ false
277
+ end
278
+ when :Object
279
+ # generic object (usually a Hash), return directly
280
+ value
281
+ when /\AArray<(?<inner_type>.+)>\z/
282
+ inner_type = Regexp.last_match[:inner_type]
283
+ value.map { |v| _deserialize(inner_type, v) }
284
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
285
+ k_type = Regexp.last_match[:k_type]
286
+ v_type = Regexp.last_match[:v_type]
287
+ {}.tap do |hash|
288
+ value.each do |k, v|
289
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
290
+ end
291
+ end
292
+ else # model
293
+ # models (e.g. Pet) or oneOf
294
+ klass = UltracartClient.const_get(type)
295
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
296
+ end
297
+ end
298
+
299
+ # Returns the string representation of the object
300
+ # @return [String] String presentation of the object
301
+ def to_s
302
+ to_hash.to_s
303
+ end
304
+
305
+ # to_body is an alias to to_hash (backward compatibility)
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_body
308
+ to_hash
309
+ end
310
+
311
+ # Returns the object in the form of hash
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_hash
314
+ hash = {}
315
+ self.class.attribute_map.each_pair do |attr, param|
316
+ value = self.send(attr)
317
+ if value.nil?
318
+ is_nullable = self.class.openapi_nullable.include?(attr)
319
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
320
+ end
321
+
322
+ hash[param] = _to_hash(value)
323
+ end
324
+ hash
325
+ end
326
+
327
+ # Outputs non-array value in the form of hash
328
+ # For object, use to_hash. Otherwise, just return the value
329
+ # @param [Object] value Any valid value
330
+ # @return [Hash] Returns the value in the form of hash
331
+ def _to_hash(value)
332
+ if value.is_a?(Array)
333
+ value.compact.map { |v| _to_hash(v) }
334
+ elsif value.is_a?(Hash)
335
+ {}.tap do |hash|
336
+ value.each { |k, v| hash[k] = _to_hash(v) }
337
+ end
338
+ elsif value.respond_to? :to_hash
339
+ value.to_hash
340
+ else
341
+ value
342
+ end
343
+ end
344
+
345
+ end
346
+
347
+ end