ultracart_api 3.4.8 → 3.4.12

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 +11 -4
  3. data/docs/EmailWebhookEditorValuesResponse.md +14 -0
  4. data/docs/PaymentsConfiguration.md +4 -4
  5. data/docs/PaymentsConfigurationAffirm.md +7 -7
  6. data/docs/PaymentsConfigurationAmazon.md +7 -7
  7. data/docs/PaymentsConfigurationCOD.md +5 -5
  8. data/docs/PaymentsConfigurationCash.md +1 -1
  9. data/docs/PaymentsConfigurationCheck.md +12 -13
  10. data/docs/PaymentsConfigurationCreditCard.md +11 -8
  11. data/docs/PaymentsConfigurationCreditCardType.md +17 -0
  12. data/docs/PaymentsConfigurationEcheck.md +3 -3
  13. data/docs/PaymentsConfigurationLoanHero.md +4 -4
  14. data/docs/PaymentsConfigurationMoneyOrder.md +3 -1
  15. data/docs/PaymentsConfigurationPayPal.md +28 -28
  16. data/docs/PaymentsConfigurationPurchaseOrder.md +3 -3
  17. data/docs/PaymentsConfigurationQuoteRequest.md +2 -2
  18. data/docs/PaymentsConfigurationRestrictions.md +14 -12
  19. data/docs/PaymentsConfigurationRestrictionsTheme.md +10 -0
  20. data/docs/PaymentsConfigurationSezzle.md +8 -7
  21. data/docs/PaymentsConfigurationTestMethod.md +18 -0
  22. data/docs/PaymentsConfigurationWePay.md +26 -26
  23. data/docs/PaymentsConfigurationWireTransfer.md +10 -10
  24. data/docs/StorefrontApi.md +52 -0
  25. data/lib/ultracart_api.rb +4 -0
  26. data/lib/ultracart_api/api/storefront_api.rb +59 -0
  27. data/lib/ultracart_api/models/email_webhook_editor_values_response.rb +243 -0
  28. data/lib/ultracart_api/models/payments_configuration.rb +41 -40
  29. data/lib/ultracart_api/models/payments_configuration_affirm.rb +81 -40
  30. data/lib/ultracart_api/models/payments_configuration_amazon.rb +51 -44
  31. data/lib/ultracart_api/models/payments_configuration_cash.rb +4 -3
  32. data/lib/ultracart_api/models/payments_configuration_check.rb +73 -68
  33. data/lib/ultracart_api/models/payments_configuration_cod.rb +39 -34
  34. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +78 -34
  35. data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +309 -0
  36. data/lib/ultracart_api/models/payments_configuration_echeck.rb +22 -19
  37. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +23 -19
  38. data/lib/ultracart_api/models/payments_configuration_money_order.rb +25 -4
  39. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +270 -172
  40. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +19 -16
  41. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +12 -10
  42. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +75 -41
  43. data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +202 -0
  44. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +99 -46
  45. data/lib/ultracart_api/models/payments_configuration_test_method.rb +319 -0
  46. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +186 -160
  47. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +71 -61
  48. data/lib/ultracart_api/version.rb +1 -1
  49. metadata +10 -2
@@ -14,33 +14,66 @@ require 'date'
14
14
 
15
15
  module UltracartClient
16
16
  class PaymentsConfigurationSezzle
17
+ # Master flag for this merchant accepting Sezzle payments
17
18
  attr_accessor :accept_sezzle
18
19
 
19
- attr_accessor :restrictions
20
+ # Optional Quickbooks code for this payment method
21
+ attr_accessor :accounting_code
22
+
23
+ # Business ID
24
+ attr_accessor :business_id
25
+
26
+ # Optional Quickbooks Deposit to Account value
27
+ attr_accessor :deposit_to_account
20
28
 
21
- attr_accessor :sezzle_accounting_code
29
+ # Sezzle environment
30
+ attr_accessor :environment
22
31
 
23
- attr_accessor :sezzle_business_id
32
+ # List of environments possible
33
+ attr_accessor :environments
24
34
 
25
- attr_accessor :sezzle_deposit_to_account
35
+ # Private API key
36
+ attr_accessor :private_api_key
26
37
 
27
- attr_accessor :sezzle_environment
38
+ # Public API key
39
+ attr_accessor :public_api_key
40
+
41
+ attr_accessor :restrictions
28
42
 
29
- attr_accessor :sezzle_private_api_key
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
30
59
 
31
- attr_accessor :sezzle_public_api_key
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
32
64
 
33
65
  # Attribute mapping from ruby-style variable name to JSON key.
34
66
  def self.attribute_map
35
67
  {
36
- :'accept_sezzle' => :'acceptSezzle',
37
- :'restrictions' => :'restrictions',
38
- :'sezzle_accounting_code' => :'sezzleAccountingCode',
39
- :'sezzle_business_id' => :'sezzleBusinessId',
40
- :'sezzle_deposit_to_account' => :'sezzleDepositToAccount',
41
- :'sezzle_environment' => :'sezzleEnvironment',
42
- :'sezzle_private_api_key' => :'sezzlePrivateApiKey',
43
- :'sezzle_public_api_key' => :'sezzlePublicApiKey'
68
+ :'accept_sezzle' => :'accept_sezzle',
69
+ :'accounting_code' => :'accounting_code',
70
+ :'business_id' => :'business_id',
71
+ :'deposit_to_account' => :'deposit_to_account',
72
+ :'environment' => :'environment',
73
+ :'environments' => :'environments',
74
+ :'private_api_key' => :'private_api_key',
75
+ :'public_api_key' => :'public_api_key',
76
+ :'restrictions' => :'restrictions'
44
77
  }
45
78
  end
46
79
 
@@ -48,13 +81,14 @@ module UltracartClient
48
81
  def self.swagger_types
49
82
  {
50
83
  :'accept_sezzle' => :'BOOLEAN',
51
- :'restrictions' => :'PaymentsConfigurationRestrictions',
52
- :'sezzle_accounting_code' => :'String',
53
- :'sezzle_business_id' => :'String',
54
- :'sezzle_deposit_to_account' => :'String',
55
- :'sezzle_environment' => :'String',
56
- :'sezzle_private_api_key' => :'String',
57
- :'sezzle_public_api_key' => :'String'
84
+ :'accounting_code' => :'String',
85
+ :'business_id' => :'String',
86
+ :'deposit_to_account' => :'String',
87
+ :'environment' => :'String',
88
+ :'environments' => :'Array<String>',
89
+ :'private_api_key' => :'String',
90
+ :'public_api_key' => :'String',
91
+ :'restrictions' => :'PaymentsConfigurationRestrictions'
58
92
  }
59
93
  end
60
94
 
@@ -66,36 +100,42 @@ module UltracartClient
66
100
  # convert string to symbol for hash key
67
101
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
102
 
69
- if attributes.has_key?(:'acceptSezzle')
70
- self.accept_sezzle = attributes[:'acceptSezzle']
103
+ if attributes.has_key?(:'accept_sezzle')
104
+ self.accept_sezzle = attributes[:'accept_sezzle']
71
105
  end
72
106
 
73
- if attributes.has_key?(:'restrictions')
74
- self.restrictions = attributes[:'restrictions']
107
+ if attributes.has_key?(:'accounting_code')
108
+ self.accounting_code = attributes[:'accounting_code']
75
109
  end
76
110
 
77
- if attributes.has_key?(:'sezzleAccountingCode')
78
- self.sezzle_accounting_code = attributes[:'sezzleAccountingCode']
111
+ if attributes.has_key?(:'business_id')
112
+ self.business_id = attributes[:'business_id']
79
113
  end
80
114
 
81
- if attributes.has_key?(:'sezzleBusinessId')
82
- self.sezzle_business_id = attributes[:'sezzleBusinessId']
115
+ if attributes.has_key?(:'deposit_to_account')
116
+ self.deposit_to_account = attributes[:'deposit_to_account']
83
117
  end
84
118
 
85
- if attributes.has_key?(:'sezzleDepositToAccount')
86
- self.sezzle_deposit_to_account = attributes[:'sezzleDepositToAccount']
119
+ if attributes.has_key?(:'environment')
120
+ self.environment = attributes[:'environment']
121
+ end
122
+
123
+ if attributes.has_key?(:'environments')
124
+ if (value = attributes[:'environments']).is_a?(Array)
125
+ self.environments = value
126
+ end
87
127
  end
88
128
 
89
- if attributes.has_key?(:'sezzleEnvironment')
90
- self.sezzle_environment = attributes[:'sezzleEnvironment']
129
+ if attributes.has_key?(:'private_api_key')
130
+ self.private_api_key = attributes[:'private_api_key']
91
131
  end
92
132
 
93
- if attributes.has_key?(:'sezzlePrivateApiKey')
94
- self.sezzle_private_api_key = attributes[:'sezzlePrivateApiKey']
133
+ if attributes.has_key?(:'public_api_key')
134
+ self.public_api_key = attributes[:'public_api_key']
95
135
  end
96
136
 
97
- if attributes.has_key?(:'sezzlePublicApiKey')
98
- self.sezzle_public_api_key = attributes[:'sezzlePublicApiKey']
137
+ if attributes.has_key?(:'restrictions')
138
+ self.restrictions = attributes[:'restrictions']
99
139
  end
100
140
  end
101
141
 
@@ -109,22 +149,35 @@ module UltracartClient
109
149
  # Check to see if the all the properties in the model are valid
110
150
  # @return true if the model is valid
111
151
  def valid?
152
+ environment_validator = EnumAttributeValidator.new('String', ['Live', 'Sandbox'])
153
+ return false unless environment_validator.valid?(@environment)
112
154
  true
113
155
  end
114
156
 
157
+ # Custom attribute writer method checking allowed values (enum).
158
+ # @param [Object] environment Object to be assigned
159
+ def environment=(environment)
160
+ validator = EnumAttributeValidator.new('String', ['Live', 'Sandbox'])
161
+ unless validator.valid?(environment)
162
+ fail ArgumentError, 'invalid value for "environment", must be one of #{validator.allowable_values}.'
163
+ end
164
+ @environment = environment
165
+ end
166
+
115
167
  # Checks equality by comparing each attribute.
116
168
  # @param [Object] Object to be compared
117
169
  def ==(o)
118
170
  return true if self.equal?(o)
119
171
  self.class == o.class &&
120
172
  accept_sezzle == o.accept_sezzle &&
121
- restrictions == o.restrictions &&
122
- sezzle_accounting_code == o.sezzle_accounting_code &&
123
- sezzle_business_id == o.sezzle_business_id &&
124
- sezzle_deposit_to_account == o.sezzle_deposit_to_account &&
125
- sezzle_environment == o.sezzle_environment &&
126
- sezzle_private_api_key == o.sezzle_private_api_key &&
127
- sezzle_public_api_key == o.sezzle_public_api_key
173
+ accounting_code == o.accounting_code &&
174
+ business_id == o.business_id &&
175
+ deposit_to_account == o.deposit_to_account &&
176
+ environment == o.environment &&
177
+ environments == o.environments &&
178
+ private_api_key == o.private_api_key &&
179
+ public_api_key == o.public_api_key &&
180
+ restrictions == o.restrictions
128
181
  end
129
182
 
130
183
  # @see the `==` method
@@ -136,7 +189,7 @@ module UltracartClient
136
189
  # Calculates hash code according to all attributes.
137
190
  # @return [Fixnum] Hash code
138
191
  def hash
139
- [accept_sezzle, restrictions, sezzle_accounting_code, sezzle_business_id, sezzle_deposit_to_account, sezzle_environment, sezzle_private_api_key, sezzle_public_api_key].hash
192
+ [accept_sezzle, accounting_code, business_id, deposit_to_account, environment, environments, private_api_key, public_api_key, restrictions].hash
140
193
  end
141
194
 
142
195
  # Builds the object from hash
@@ -0,0 +1,319 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class PaymentsConfigurationTestMethod
17
+ # Bank account number
18
+ attr_accessor :bank_account_number
19
+
20
+ # Bank routing number
21
+ attr_accessor :bank_routing_number
22
+
23
+ # Credit card number
24
+ attr_accessor :credit_card_number
25
+
26
+ # The existing credit card number
27
+ attr_accessor :credit_card_number_existing
28
+
29
+ # Description
30
+ attr_accessor :description
31
+
32
+ # Payment action
33
+ attr_accessor :payment_action
34
+
35
+ # Payment method
36
+ attr_accessor :payment_method
37
+
38
+ # Payment method test oid
39
+ attr_accessor :payment_method_test_oid
40
+
41
+ # Skip affiliate transaction
42
+ attr_accessor :skip_affiliate_transaction
43
+
44
+ # If true, skips recording any conversion pixels to avoid sending test orders to your analysis sites
45
+ attr_accessor :skip_conversion_pixels
46
+
47
+ # Skip fraud filter
48
+ attr_accessor :skip_fraud_filter
49
+
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
53
+
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
66
+
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'bank_account_number' => :'bank_account_number',
76
+ :'bank_routing_number' => :'bank_routing_number',
77
+ :'credit_card_number' => :'credit_card_number',
78
+ :'credit_card_number_existing' => :'credit_card_number_existing',
79
+ :'description' => :'description',
80
+ :'payment_action' => :'payment_action',
81
+ :'payment_method' => :'payment_method',
82
+ :'payment_method_test_oid' => :'payment_method_test_oid',
83
+ :'skip_affiliate_transaction' => :'skip_affiliate_transaction',
84
+ :'skip_conversion_pixels' => :'skip_conversion_pixels',
85
+ :'skip_fraud_filter' => :'skip_fraud_filter'
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ :'bank_account_number' => :'String',
93
+ :'bank_routing_number' => :'String',
94
+ :'credit_card_number' => :'String',
95
+ :'credit_card_number_existing' => :'String',
96
+ :'description' => :'String',
97
+ :'payment_action' => :'String',
98
+ :'payment_method' => :'String',
99
+ :'payment_method_test_oid' => :'Integer',
100
+ :'skip_affiliate_transaction' => :'BOOLEAN',
101
+ :'skip_conversion_pixels' => :'BOOLEAN',
102
+ :'skip_fraud_filter' => :'BOOLEAN'
103
+ }
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ return unless attributes.is_a?(Hash)
110
+
111
+ # convert string to symbol for hash key
112
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
113
+
114
+ if attributes.has_key?(:'bank_account_number')
115
+ self.bank_account_number = attributes[:'bank_account_number']
116
+ end
117
+
118
+ if attributes.has_key?(:'bank_routing_number')
119
+ self.bank_routing_number = attributes[:'bank_routing_number']
120
+ end
121
+
122
+ if attributes.has_key?(:'credit_card_number')
123
+ self.credit_card_number = attributes[:'credit_card_number']
124
+ end
125
+
126
+ if attributes.has_key?(:'credit_card_number_existing')
127
+ self.credit_card_number_existing = attributes[:'credit_card_number_existing']
128
+ end
129
+
130
+ if attributes.has_key?(:'description')
131
+ self.description = attributes[:'description']
132
+ end
133
+
134
+ if attributes.has_key?(:'payment_action')
135
+ self.payment_action = attributes[:'payment_action']
136
+ end
137
+
138
+ if attributes.has_key?(:'payment_method')
139
+ self.payment_method = attributes[:'payment_method']
140
+ end
141
+
142
+ if attributes.has_key?(:'payment_method_test_oid')
143
+ self.payment_method_test_oid = attributes[:'payment_method_test_oid']
144
+ end
145
+
146
+ if attributes.has_key?(:'skip_affiliate_transaction')
147
+ self.skip_affiliate_transaction = attributes[:'skip_affiliate_transaction']
148
+ end
149
+
150
+ if attributes.has_key?(:'skip_conversion_pixels')
151
+ self.skip_conversion_pixels = attributes[:'skip_conversion_pixels']
152
+ end
153
+
154
+ if attributes.has_key?(:'skip_fraud_filter')
155
+ self.skip_fraud_filter = attributes[:'skip_fraud_filter']
156
+ end
157
+ end
158
+
159
+ # Show invalid properties with the reasons. Usually used together with valid?
160
+ # @return Array for valid properties with the reasons
161
+ def list_invalid_properties
162
+ invalid_properties = Array.new
163
+ invalid_properties
164
+ end
165
+
166
+ # Check to see if the all the properties in the model are valid
167
+ # @return true if the model is valid
168
+ def valid?
169
+ payment_action_validator = EnumAttributeValidator.new('String', ['skip payment', 'skip pmt rej', 'skip pmt co', 'hold in ar'])
170
+ return false unless payment_action_validator.valid?(@payment_action)
171
+ true
172
+ end
173
+
174
+ # Custom attribute writer method checking allowed values (enum).
175
+ # @param [Object] payment_action Object to be assigned
176
+ def payment_action=(payment_action)
177
+ validator = EnumAttributeValidator.new('String', ['skip payment', 'skip pmt rej', 'skip pmt co', 'hold in ar'])
178
+ unless validator.valid?(payment_action)
179
+ fail ArgumentError, 'invalid value for "payment_action", must be one of #{validator.allowable_values}.'
180
+ end
181
+ @payment_action = payment_action
182
+ end
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ bank_account_number == o.bank_account_number &&
190
+ bank_routing_number == o.bank_routing_number &&
191
+ credit_card_number == o.credit_card_number &&
192
+ credit_card_number_existing == o.credit_card_number_existing &&
193
+ description == o.description &&
194
+ payment_action == o.payment_action &&
195
+ payment_method == o.payment_method &&
196
+ payment_method_test_oid == o.payment_method_test_oid &&
197
+ skip_affiliate_transaction == o.skip_affiliate_transaction &&
198
+ skip_conversion_pixels == o.skip_conversion_pixels &&
199
+ skip_fraud_filter == o.skip_fraud_filter
200
+ end
201
+
202
+ # @see the `==` method
203
+ # @param [Object] Object to be compared
204
+ def eql?(o)
205
+ self == o
206
+ end
207
+
208
+ # Calculates hash code according to all attributes.
209
+ # @return [Fixnum] Hash code
210
+ def hash
211
+ [bank_account_number, bank_routing_number, credit_card_number, credit_card_number_existing, description, payment_action, payment_method, payment_method_test_oid, skip_affiliate_transaction, skip_conversion_pixels, skip_fraud_filter].hash
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def build_from_hash(attributes)
218
+ return nil unless attributes.is_a?(Hash)
219
+ self.class.swagger_types.each_pair do |key, type|
220
+ if type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
224
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
225
+ end
226
+ elsif !attributes[self.class.attribute_map[key]].nil?
227
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
228
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
229
+ end
230
+
231
+ self
232
+ end
233
+
234
+ # Deserializes the data based on type
235
+ # @param string type Data type
236
+ # @param string value Value to be deserialized
237
+ # @return [Object] Deserialized data
238
+ def _deserialize(type, value)
239
+ case type.to_sym
240
+ when :DateTime
241
+ DateTime.parse(value)
242
+ when :Date
243
+ Date.parse(value)
244
+ when :String
245
+ value.to_s
246
+ when :Integer
247
+ value.to_i
248
+ when :Float
249
+ value.to_f
250
+ when :BOOLEAN
251
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
252
+ true
253
+ else
254
+ false
255
+ end
256
+ when :Object
257
+ # generic object (usually a Hash), return directly
258
+ value
259
+ when /\AArray<(?<inner_type>.+)>\z/
260
+ inner_type = Regexp.last_match[:inner_type]
261
+ value.map { |v| _deserialize(inner_type, v) }
262
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
263
+ k_type = Regexp.last_match[:k_type]
264
+ v_type = Regexp.last_match[:v_type]
265
+ {}.tap do |hash|
266
+ value.each do |k, v|
267
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
268
+ end
269
+ end
270
+ else # model
271
+ temp_model = UltracartClient.const_get(type).new
272
+ temp_model.build_from_hash(value)
273
+ end
274
+ end
275
+
276
+ # Returns the string representation of the object
277
+ # @return [String] String presentation of the object
278
+ def to_s
279
+ to_hash.to_s
280
+ end
281
+
282
+ # to_body is an alias to to_hash (backward compatibility)
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_body
285
+ to_hash
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ next if value.nil?
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+
318
+ end
319
+ end