cybersource_rest_client 0.0.70 → 0.0.71

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/batches_api.rb +9 -9
  3. data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +3 -149
  4. data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +20 -261
  5. data/lib/cybersource_rest_client/api/transaction_batches_api.rb +75 -0
  6. data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +1 -1
  7. data/lib/cybersource_rest_client/models/inline_response_200_2.rb +64 -26
  8. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded.rb → inline_response_200_2__embedded.rb} +2 -2
  9. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded__links.rb → inline_response_200_2__embedded__links.rb} +2 -2
  10. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded__links_reports.rb → inline_response_200_2__embedded__links_reports.rb} +1 -1
  11. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded_batches.rb → inline_response_200_2__embedded_batches.rb} +3 -3
  12. data/lib/cybersource_rest_client/models/{inline_response_200_5__embedded_totals.rb → inline_response_200_2__embedded_totals.rb} +1 -1
  13. data/lib/cybersource_rest_client/models/{inline_response_200_5__links.rb → inline_response_200_2__links.rb} +1 -1
  14. data/lib/cybersource_rest_client/models/inline_response_200_3.rb +75 -120
  15. data/lib/cybersource_rest_client/models/{inline_response_200_6__links.rb → inline_response_200_3__links.rb} +2 -2
  16. data/lib/cybersource_rest_client/models/{inline_response_200_6__links_report.rb → inline_response_200_3__links_report.rb} +1 -1
  17. data/lib/cybersource_rest_client/models/{inline_response_200_6_billing.rb → inline_response_200_3_billing.rb} +1 -1
  18. data/lib/cybersource_rest_client/models/inline_response_200_4.rb +83 -126
  19. data/lib/cybersource_rest_client/models/{inline_response_200_7_records.rb → inline_response_200_4_records.rb} +3 -3
  20. data/lib/cybersource_rest_client/models/{inline_response_200_7_response_record.rb → inline_response_200_4_response_record.rb} +2 -2
  21. data/lib/cybersource_rest_client/models/{inline_response_200_7_response_record_additional_updates.rb → inline_response_200_4_response_record_additional_updates.rb} +1 -1
  22. data/lib/cybersource_rest_client/models/{inline_response_200_7_source_record.rb → inline_response_200_4_source_record.rb} +1 -1
  23. data/lib/cybersource_rest_client/models/inline_response_201_4.rb +64 -134
  24. data/lib/cybersource_rest_client/models/inline_response_201_4_payloads.rb +189 -0
  25. data/lib/cybersource_rest_client/models/inline_response_201_4_payloads_test_payload.rb +190 -0
  26. data/lib/cybersource_rest_client/models/inline_response_201_5.rb +5 -25
  27. data/lib/cybersource_rest_client/models/model_400_upload_batch_file_response.rb +199 -0
  28. data/lib/cybersource_rest_client/models/payments_strong_auth_issuer_information.rb +22 -5
  29. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1.rb +25 -5
  30. data/lib/cybersource_rest_client/models/{inline_response_404_2.rb → pts_v2_payments_post201_response_1_error_information.rb} +4 -2
  31. data/lib/cybersource_rest_client/models/{inline_response_404_2_details.rb → pts_v2_payments_post201_response_1_error_information_details.rb} +3 -12
  32. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_issuer_information.rb +213 -0
  33. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information.rb +15 -5
  34. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information_amount_details.rb +196 -0
  35. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information.rb +11 -1
  36. data/lib/cybersource_rest_client/models/{notificationsubscriptionsv1webhooks_security_policy_1.rb → pts_v2_payments_post201_response_1_payment_information_e_wallet.rb} +30 -29
  37. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information.rb +41 -1
  38. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +11 -1
  39. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +1 -1
  40. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +1 -1
  41. data/lib/cybersource_rest_client/models/ptsv2payouts_recipient_information.rb +7 -7
  42. data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information.rb +3 -3
  43. data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information_account.rb +1 -1
  44. data/lib/cybersource_rest_client/models/save_asym_egress_key.rb +0 -10
  45. data/lib/cybersource_rest_client/models/save_sym_egress_key.rb +0 -10
  46. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_issuer_information.rb +22 -5
  47. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processor_information.rb +12 -1
  48. data/lib/cybersource_rest_client.rb +21 -32
  49. metadata +23 -34
  50. data/lib/cybersource_rest_client/api/replay_webhooks_api.rb +0 -98
  51. data/lib/cybersource_rest_client/models/create_webhook_request.rb +0 -289
  52. data/lib/cybersource_rest_client/models/inline_response_200_5.rb +0 -251
  53. data/lib/cybersource_rest_client/models/inline_response_200_6.rb +0 -290
  54. data/lib/cybersource_rest_client/models/inline_response_200_7.rb +0 -292
  55. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1productsorganization_id_event_types.rb +0 -233
  56. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_notification_scope.rb +0 -205
  57. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_products.rb +0 -202
  58. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_retry_policy.rb +0 -270
  59. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy.rb +0 -201
  60. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy_1_config.rb +0 -223
  61. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy_1_config_additional_config.rb +0 -220
  62. data/lib/cybersource_rest_client/models/notificationsubscriptionsv1webhooks_security_policy_config.rb +0 -213
  63. data/lib/cybersource_rest_client/models/nrtfv1webhookswebhook_idreplays_by_delivery_status.rb +0 -243
  64. data/lib/cybersource_rest_client/models/replay_webhooks_request.rb +0 -201
  65. data/lib/cybersource_rest_client/models/update_webhook_request.rb +0 -314
@@ -1,201 +0,0 @@
1
- =begin
2
- #CyberSource Merged Spec
3
-
4
- #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
-
6
- OpenAPI spec version: 0.0.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.38
10
- =end
11
-
12
- require 'date'
13
-
14
- module CyberSource
15
- class ReplayWebhooksRequest
16
- attr_accessor :by_transaction_trace_identifiers
17
-
18
- attr_accessor :by_delivery_status
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'by_transaction_trace_identifiers' => :'byTransactionTraceIdentifiers',
24
- :'by_delivery_status' => :'byDeliveryStatus'
25
- }
26
- end
27
-
28
- # Attribute mapping from JSON key to ruby-style variable name.
29
- def self.json_map
30
- {
31
- :'by_transaction_trace_identifiers' => :'by_transaction_trace_identifiers',
32
- :'by_delivery_status' => :'by_delivery_status'
33
- }
34
- end
35
-
36
- # Attribute type mapping.
37
- def self.swagger_types
38
- {
39
- :'by_transaction_trace_identifiers' => :'Array<String>',
40
- :'by_delivery_status' => :'Nrtfv1webhookswebhookIdreplaysByDeliveryStatus'
41
- }
42
- end
43
-
44
- # Initializes the object
45
- # @param [Hash] attributes Model attributes in the form of hash
46
- def initialize(attributes = {})
47
- return unless attributes.is_a?(Hash)
48
-
49
- # convert string to symbol for hash key
50
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
51
-
52
- if attributes.has_key?(:'byTransactionTraceIdentifiers')
53
- if (value = attributes[:'byTransactionTraceIdentifiers']).is_a?(Array)
54
- self.by_transaction_trace_identifiers = value
55
- end
56
- end
57
-
58
- if attributes.has_key?(:'byDeliveryStatus')
59
- self.by_delivery_status = attributes[:'byDeliveryStatus']
60
- end
61
- end
62
-
63
- # Show invalid properties with the reasons. Usually used together with valid?
64
- # @return Array for valid properties with the reasons
65
- def list_invalid_properties
66
- invalid_properties = Array.new
67
- invalid_properties
68
- end
69
-
70
- # Check to see if the all the properties in the model are valid
71
- # @return true if the model is valid
72
- def valid?
73
- true
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(o)
79
- return true if self.equal?(o)
80
- self.class == o.class &&
81
- by_transaction_trace_identifiers == o.by_transaction_trace_identifiers &&
82
- by_delivery_status == o.by_delivery_status
83
- end
84
-
85
- # @see the `==` method
86
- # @param [Object] Object to be compared
87
- def eql?(o)
88
- self == o
89
- end
90
-
91
- # Calculates hash code according to all attributes.
92
- # @return [Fixnum] Hash code
93
- def hash
94
- [by_transaction_trace_identifiers, by_delivery_status].hash
95
- end
96
-
97
- # Builds the object from hash
98
- # @param [Hash] attributes Model attributes in the form of hash
99
- # @return [Object] Returns the model itself
100
- def build_from_hash(attributes)
101
- return nil unless attributes.is_a?(Hash)
102
- self.class.swagger_types.each_pair do |key, type|
103
- if type =~ /\AArray<(.*)>/i
104
- # check to ensure the input is an array given that the the attribute
105
- # is documented as an array but the input is not
106
- if attributes[self.class.attribute_map[key]].is_a?(Array)
107
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
- end
109
- elsif !attributes[self.class.attribute_map[key]].nil?
110
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
- end # or else data not found in attributes(hash), not an issue as the data can be optional
112
- end
113
-
114
- self
115
- end
116
-
117
- # Deserializes the data based on type
118
- # @param string type Data type
119
- # @param string value Value to be deserialized
120
- # @return [Object] Deserialized data
121
- def _deserialize(type, value)
122
- case type.to_sym
123
- when :DateTime
124
- DateTime.parse(value)
125
- when :Date
126
- Date.parse(value)
127
- when :String
128
- value.to_s
129
- when :Integer
130
- value.to_i
131
- when :Float
132
- value.to_f
133
- when :BOOLEAN
134
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
- true
136
- else
137
- false
138
- end
139
- when :Object
140
- # generic object (usually a Hash), return directly
141
- value
142
- when /\AArray<(?<inner_type>.+)>\z/
143
- inner_type = Regexp.last_match[:inner_type]
144
- value.map { |v| _deserialize(inner_type, v) }
145
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
- k_type = Regexp.last_match[:k_type]
147
- v_type = Regexp.last_match[:v_type]
148
- {}.tap do |hash|
149
- value.each do |k, v|
150
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
- end
152
- end
153
- else # model
154
- temp_model = CyberSource.const_get(type).new
155
- temp_model.build_from_hash(value)
156
- end
157
- end
158
-
159
- # Returns the string representation of the object
160
- # @return [String] String presentation of the object
161
- def to_s
162
- to_hash.to_s
163
- end
164
-
165
- # to_body is an alias to to_hash (backward compatibility)
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_body
168
- to_hash
169
- end
170
-
171
- # Returns the object in the form of hash
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_hash
174
- hash = {}
175
- self.class.attribute_map.each_pair do |attr, param|
176
- value = self.send(attr)
177
- next if value.nil?
178
- hash[param] = _to_hash(value)
179
- end
180
- hash
181
- end
182
-
183
- # Outputs non-array value in the form of hash
184
- # For object, use to_hash. Otherwise, just return the value
185
- # @param [Object] value Any valid value
186
- # @return [Hash] Returns the value in the form of hash
187
- def _to_hash(value)
188
- if value.is_a?(Array)
189
- value.compact.map { |v| _to_hash(v) }
190
- elsif value.is_a?(Hash)
191
- {}.tap do |hash|
192
- value.each { |k, v| hash[k] = _to_hash(v) }
193
- end
194
- elsif value.respond_to? :to_hash
195
- value.to_hash
196
- else
197
- value
198
- end
199
- end
200
- end
201
- end
@@ -1,314 +0,0 @@
1
- =begin
2
- #CyberSource Merged Spec
3
-
4
- #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
-
6
- OpenAPI spec version: 0.0.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.38
10
- =end
11
-
12
- require 'date'
13
-
14
- module CyberSource
15
- class UpdateWebhookRequest
16
- # Client friendly webhook name.
17
- attr_accessor :name
18
-
19
- # Client friendly webhook description.\\
20
- attr_accessor :description
21
-
22
- # Organization Id.
23
- attr_accessor :organization_id
24
-
25
- # The product you are receiving a webhook for.
26
- attr_accessor :product_id
27
-
28
- # Array of the different events for a given product id.
29
- attr_accessor :event_types
30
-
31
- # The client's endpoint (URL) to receive webhooks.
32
- attr_accessor :webhook_url
33
-
34
- # The client's health check endpoint (URL). This should be as close as possible to the actual webhookUrl.
35
- attr_accessor :health_check_url
36
-
37
- # Webhook status.
38
- attr_accessor :status
39
-
40
- attr_accessor :notification_scope
41
-
42
- attr_accessor :retry_policy
43
-
44
- attr_accessor :security_policy
45
-
46
- # Additional, free form configuration data.
47
- attr_accessor :additional_attributes
48
-
49
- # Attribute mapping from ruby-style variable name to JSON key.
50
- def self.attribute_map
51
- {
52
- :'name' => :'name',
53
- :'description' => :'description',
54
- :'organization_id' => :'organizationId',
55
- :'product_id' => :'productId',
56
- :'event_types' => :'eventTypes',
57
- :'webhook_url' => :'webhookUrl',
58
- :'health_check_url' => :'healthCheckUrl',
59
- :'status' => :'status',
60
- :'notification_scope' => :'notificationScope',
61
- :'retry_policy' => :'retryPolicy',
62
- :'security_policy' => :'securityPolicy',
63
- :'additional_attributes' => :'additionalAttributes'
64
- }
65
- end
66
-
67
- # Attribute mapping from JSON key to ruby-style variable name.
68
- def self.json_map
69
- {
70
- :'name' => :'name',
71
- :'description' => :'description',
72
- :'organization_id' => :'organization_id',
73
- :'product_id' => :'product_id',
74
- :'event_types' => :'event_types',
75
- :'webhook_url' => :'webhook_url',
76
- :'health_check_url' => :'health_check_url',
77
- :'status' => :'status',
78
- :'notification_scope' => :'notification_scope',
79
- :'retry_policy' => :'retry_policy',
80
- :'security_policy' => :'security_policy',
81
- :'additional_attributes' => :'additional_attributes'
82
- }
83
- end
84
-
85
- # Attribute type mapping.
86
- def self.swagger_types
87
- {
88
- :'name' => :'String',
89
- :'description' => :'String',
90
- :'organization_id' => :'String',
91
- :'product_id' => :'String',
92
- :'event_types' => :'Array<String>',
93
- :'webhook_url' => :'String',
94
- :'health_check_url' => :'String',
95
- :'status' => :'String',
96
- :'notification_scope' => :'Notificationsubscriptionsv1webhooksNotificationScope',
97
- :'retry_policy' => :'Notificationsubscriptionsv1webhooksRetryPolicy',
98
- :'security_policy' => :'Notificationsubscriptionsv1webhooksSecurityPolicy',
99
- :'additional_attributes' => :'Array<Hash<String, String>>'
100
- }
101
- end
102
-
103
- # Initializes the object
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- def initialize(attributes = {})
106
- return unless attributes.is_a?(Hash)
107
-
108
- # convert string to symbol for hash key
109
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
110
-
111
- if attributes.has_key?(:'name')
112
- self.name = attributes[:'name']
113
- end
114
-
115
- if attributes.has_key?(:'description')
116
- self.description = attributes[:'description']
117
- end
118
-
119
- if attributes.has_key?(:'organizationId')
120
- self.organization_id = attributes[:'organizationId']
121
- end
122
-
123
- if attributes.has_key?(:'productId')
124
- self.product_id = attributes[:'productId']
125
- end
126
-
127
- if attributes.has_key?(:'eventTypes')
128
- if (value = attributes[:'eventTypes']).is_a?(Array)
129
- self.event_types = value
130
- end
131
- end
132
-
133
- if attributes.has_key?(:'webhookUrl')
134
- self.webhook_url = attributes[:'webhookUrl']
135
- end
136
-
137
- if attributes.has_key?(:'healthCheckUrl')
138
- self.health_check_url = attributes[:'healthCheckUrl']
139
- end
140
-
141
- if attributes.has_key?(:'status')
142
- self.status = attributes[:'status']
143
- else
144
- self.status = 'INACTIVE'
145
- end
146
-
147
- if attributes.has_key?(:'notificationScope')
148
- self.notification_scope = attributes[:'notificationScope']
149
- end
150
-
151
- if attributes.has_key?(:'retryPolicy')
152
- self.retry_policy = attributes[:'retryPolicy']
153
- end
154
-
155
- if attributes.has_key?(:'securityPolicy')
156
- self.security_policy = attributes[:'securityPolicy']
157
- end
158
-
159
- if attributes.has_key?(:'additionalAttributes')
160
- if (value = attributes[:'additionalAttributes']).is_a?(Array)
161
- self.additional_attributes = value
162
- end
163
- end
164
- end
165
-
166
- # Show invalid properties with the reasons. Usually used together with valid?
167
- # @return Array for valid properties with the reasons
168
- def list_invalid_properties
169
- invalid_properties = Array.new
170
- invalid_properties
171
- end
172
-
173
- # Check to see if the all the properties in the model are valid
174
- # @return true if the model is valid
175
- def valid?
176
- true
177
- end
178
-
179
- # Checks equality by comparing each attribute.
180
- # @param [Object] Object to be compared
181
- def ==(o)
182
- return true if self.equal?(o)
183
- self.class == o.class &&
184
- name == o.name &&
185
- description == o.description &&
186
- organization_id == o.organization_id &&
187
- product_id == o.product_id &&
188
- event_types == o.event_types &&
189
- webhook_url == o.webhook_url &&
190
- health_check_url == o.health_check_url &&
191
- status == o.status &&
192
- notification_scope == o.notification_scope &&
193
- retry_policy == o.retry_policy &&
194
- security_policy == o.security_policy &&
195
- additional_attributes == o.additional_attributes
196
- end
197
-
198
- # @see the `==` method
199
- # @param [Object] Object to be compared
200
- def eql?(o)
201
- self == o
202
- end
203
-
204
- # Calculates hash code according to all attributes.
205
- # @return [Fixnum] Hash code
206
- def hash
207
- [name, description, organization_id, product_id, event_types, webhook_url, health_check_url, status, notification_scope, retry_policy, security_policy, additional_attributes].hash
208
- end
209
-
210
- # Builds the object from hash
211
- # @param [Hash] attributes Model attributes in the form of hash
212
- # @return [Object] Returns the model itself
213
- def build_from_hash(attributes)
214
- return nil unless attributes.is_a?(Hash)
215
- self.class.swagger_types.each_pair do |key, type|
216
- if type =~ /\AArray<(.*)>/i
217
- # check to ensure the input is an array given that the the attribute
218
- # is documented as an array but the input is not
219
- if attributes[self.class.attribute_map[key]].is_a?(Array)
220
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
221
- end
222
- elsif !attributes[self.class.attribute_map[key]].nil?
223
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
224
- end # or else data not found in attributes(hash), not an issue as the data can be optional
225
- end
226
-
227
- self
228
- end
229
-
230
- # Deserializes the data based on type
231
- # @param string type Data type
232
- # @param string value Value to be deserialized
233
- # @return [Object] Deserialized data
234
- def _deserialize(type, value)
235
- case type.to_sym
236
- when :DateTime
237
- DateTime.parse(value)
238
- when :Date
239
- Date.parse(value)
240
- when :String
241
- value.to_s
242
- when :Integer
243
- value.to_i
244
- when :Float
245
- value.to_f
246
- when :BOOLEAN
247
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
248
- true
249
- else
250
- false
251
- end
252
- when :Object
253
- # generic object (usually a Hash), return directly
254
- value
255
- when /\AArray<(?<inner_type>.+)>\z/
256
- inner_type = Regexp.last_match[:inner_type]
257
- value.map { |v| _deserialize(inner_type, v) }
258
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
259
- k_type = Regexp.last_match[:k_type]
260
- v_type = Regexp.last_match[:v_type]
261
- {}.tap do |hash|
262
- value.each do |k, v|
263
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
264
- end
265
- end
266
- else # model
267
- temp_model = CyberSource.const_get(type).new
268
- temp_model.build_from_hash(value)
269
- end
270
- end
271
-
272
- # Returns the string representation of the object
273
- # @return [String] String presentation of the object
274
- def to_s
275
- to_hash.to_s
276
- end
277
-
278
- # to_body is an alias to to_hash (backward compatibility)
279
- # @return [Hash] Returns the object in the form of hash
280
- def to_body
281
- to_hash
282
- end
283
-
284
- # Returns the object in the form of hash
285
- # @return [Hash] Returns the object in the form of hash
286
- def to_hash
287
- hash = {}
288
- self.class.attribute_map.each_pair do |attr, param|
289
- value = self.send(attr)
290
- next if value.nil?
291
- hash[param] = _to_hash(value)
292
- end
293
- hash
294
- end
295
-
296
- # Outputs non-array value in the form of hash
297
- # For object, use to_hash. Otherwise, just return the value
298
- # @param [Object] value Any valid value
299
- # @return [Hash] Returns the value in the form of hash
300
- def _to_hash(value)
301
- if value.is_a?(Array)
302
- value.compact.map { |v| _to_hash(v) }
303
- elsif value.is_a?(Hash)
304
- {}.tap do |hash|
305
- value.each { |k, v| hash[k] = _to_hash(v) }
306
- end
307
- elsif value.respond_to? :to_hash
308
- value.to_hash
309
- else
310
- value
311
- end
312
- end
313
- end
314
- end