cybersource_rest_client 0.0.73 → 0.0.74

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/lib/cybersource_rest_client/api/batches_api.rb +9 -9
  3. data/lib/cybersource_rest_client/api/device_de_association_api.rb +168 -0
  4. data/lib/cybersource_rest_client/api/device_search_api.rb +78 -5
  5. data/lib/cybersource_rest_client/api/subscriptions_api.rb +5 -2
  6. data/lib/cybersource_rest_client/models/{inline_response_200_7__links.rb → de_association_request_body.rb} +190 -200
  7. data/lib/cybersource_rest_client/models/generate_capture_context_request.rb +240 -240
  8. data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +303 -303
  9. data/lib/cybersource_rest_client/models/get_subscription_response.rb +267 -257
  10. data/lib/cybersource_rest_client/models/get_subscription_response_reactivation_information.rb +213 -0
  11. data/lib/cybersource_rest_client/models/inline_response_200_10.rb +292 -0
  12. data/lib/cybersource_rest_client/models/{inline_response_200_9_records.rb → inline_response_200_10_records.rb} +209 -209
  13. data/lib/cybersource_rest_client/models/{inline_response_200_9_response_record.rb → inline_response_200_10_response_record.rb} +307 -307
  14. data/lib/cybersource_rest_client/models/{inline_response_200_9_response_record_additional_updates.rb → inline_response_200_10_response_record_additional_updates.rb} +242 -242
  15. data/lib/cybersource_rest_client/models/{inline_response_200_9_source_record.rb → inline_response_200_10_source_record.rb} +295 -295
  16. data/lib/cybersource_rest_client/models/inline_response_200_5.rb +247 -202
  17. data/lib/cybersource_rest_client/models/inline_response_200_5_devices.rb +357 -0
  18. data/lib/cybersource_rest_client/models/inline_response_200_6.rb +202 -247
  19. data/lib/cybersource_rest_client/models/inline_response_200_7.rb +247 -251
  20. data/lib/cybersource_rest_client/models/{inline_response_200_6_devices.rb → inline_response_200_7_devices.rb} +371 -371
  21. data/lib/cybersource_rest_client/models/{inline_response_200_6_payment_processor_to_terminal_map.rb → inline_response_200_7_payment_processor_to_terminal_map.rb} +200 -200
  22. data/lib/cybersource_rest_client/models/inline_response_200_8.rb +251 -290
  23. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded.rb → inline_response_200_8__embedded.rb} +191 -191
  24. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded__links.rb → inline_response_200_8__embedded__links.rb} +191 -191
  25. data/lib/cybersource_rest_client/models/{inline_response_200_8__links_report.rb → inline_response_200_8__embedded__links_reports.rb} +190 -189
  26. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded_batches.rb → inline_response_200_8__embedded_batches.rb} +295 -295
  27. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded_totals.rb → inline_response_200_8__embedded_totals.rb} +229 -229
  28. data/lib/cybersource_rest_client/models/inline_response_200_8__links.rb +200 -201
  29. data/lib/cybersource_rest_client/models/inline_response_200_9.rb +290 -292
  30. data/lib/cybersource_rest_client/models/inline_response_200_9__links.rb +201 -0
  31. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded__links_reports.rb → inline_response_200_9__links_report.rb} +189 -190
  32. data/lib/cybersource_rest_client/models/{inline_response_200_8_billing.rb → inline_response_200_9_billing.rb} +219 -219
  33. data/lib/cybersource_rest_client/models/payments_products.rb +379 -379
  34. data/lib/cybersource_rest_client/models/payments_products_unified_checkout.rb +199 -0
  35. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information.rb +189 -0
  36. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations.rb +189 -0
  37. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations_features.rb +189 -0
  38. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations_features_paze.rb +213 -0
  39. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information.rb +225 -0
  40. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information_features.rb +189 -0
  41. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information_features_paze_for_unified_checkout.rb +190 -0
  42. data/lib/cybersource_rest_client/models/post_device_search_request.rb +223 -0
  43. data/lib/cybersource_rest_client/models/riskv1decisions_travel_information_legs.rb +252 -241
  44. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +394 -383
  45. data/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb +297 -286
  46. data/lib/cybersource_rest_client/models/upv1capturecontexts_complete_mandate.rb +219 -208
  47. data/lib/cybersource_rest_client.rb +28 -15
  48. metadata +30 -17
  49. data/lib/cybersource_rest_client/api/device_de_association_v3_api.rb +0 -96
@@ -1,295 +1,295 @@
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 InlineResponse2009SourceRecord
16
- attr_accessor :token
17
-
18
- attr_accessor :customer_id
19
-
20
- attr_accessor :payment_instrument_id
21
-
22
- attr_accessor :instrument_identifier_id
23
-
24
- attr_accessor :card_number
25
-
26
- attr_accessor :card_expiry_month
27
-
28
- attr_accessor :card_expiry_year
29
-
30
- attr_accessor :card_type
31
-
32
- # Attribute mapping from ruby-style variable name to JSON key.
33
- def self.attribute_map
34
- {
35
- :'token' => :'token',
36
- :'customer_id' => :'customerId',
37
- :'payment_instrument_id' => :'paymentInstrumentId',
38
- :'instrument_identifier_id' => :'instrumentIdentifierId',
39
- :'card_number' => :'cardNumber',
40
- :'card_expiry_month' => :'cardExpiryMonth',
41
- :'card_expiry_year' => :'cardExpiryYear',
42
- :'card_type' => :'cardType'
43
- }
44
- end
45
-
46
- # Attribute mapping from JSON key to ruby-style variable name.
47
- def self.json_map
48
- {
49
- :'token' => :'token',
50
- :'customer_id' => :'customer_id',
51
- :'payment_instrument_id' => :'payment_instrument_id',
52
- :'instrument_identifier_id' => :'instrument_identifier_id',
53
- :'card_number' => :'card_number',
54
- :'card_expiry_month' => :'card_expiry_month',
55
- :'card_expiry_year' => :'card_expiry_year',
56
- :'card_type' => :'card_type'
57
- }
58
- end
59
-
60
- # Attribute type mapping.
61
- def self.swagger_types
62
- {
63
- :'token' => :'String',
64
- :'customer_id' => :'String',
65
- :'payment_instrument_id' => :'String',
66
- :'instrument_identifier_id' => :'String',
67
- :'card_number' => :'String',
68
- :'card_expiry_month' => :'String',
69
- :'card_expiry_year' => :'String',
70
- :'card_type' => :'String'
71
- }
72
- end
73
-
74
- # Initializes the object
75
- # @param [Hash] attributes Model attributes in the form of hash
76
- def initialize(attributes = {})
77
- return unless attributes.is_a?(Hash)
78
-
79
- # convert string to symbol for hash key
80
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
-
82
- if attributes.has_key?(:'token')
83
- self.token = attributes[:'token']
84
- end
85
-
86
- if attributes.has_key?(:'customerId')
87
- self.customer_id = attributes[:'customerId']
88
- end
89
-
90
- if attributes.has_key?(:'paymentInstrumentId')
91
- self.payment_instrument_id = attributes[:'paymentInstrumentId']
92
- end
93
-
94
- if attributes.has_key?(:'instrumentIdentifierId')
95
- self.instrument_identifier_id = attributes[:'instrumentIdentifierId']
96
- end
97
-
98
- if attributes.has_key?(:'cardNumber')
99
- self.card_number = attributes[:'cardNumber']
100
- end
101
-
102
- if attributes.has_key?(:'cardExpiryMonth')
103
- self.card_expiry_month = attributes[:'cardExpiryMonth']
104
- end
105
-
106
- if attributes.has_key?(:'cardExpiryYear')
107
- self.card_expiry_year = attributes[:'cardExpiryYear']
108
- end
109
-
110
- if attributes.has_key?(:'cardType')
111
- self.card_type = attributes[:'cardType']
112
- end
113
- end
114
-
115
- # Show invalid properties with the reasons. Usually used together with valid?
116
- # @return Array for valid properties with the reasons
117
- def list_invalid_properties
118
- invalid_properties = Array.new
119
- invalid_properties
120
- end
121
-
122
- # Check to see if the all the properties in the model are valid
123
- # @return true if the model is valid
124
- def valid?
125
- true
126
- end
127
-
128
- # Custom attribute writer method with validation
129
- # @param [Object] token Value to be assigned
130
- def token=(token)
131
- @token = token
132
- end
133
-
134
- # Custom attribute writer method with validation
135
- # @param [Object] customer_id Value to be assigned
136
- def customer_id=(customer_id)
137
- @customer_id = customer_id
138
- end
139
-
140
- # Custom attribute writer method with validation
141
- # @param [Object] payment_instrument_id Value to be assigned
142
- def payment_instrument_id=(payment_instrument_id)
143
- @payment_instrument_id = payment_instrument_id
144
- end
145
-
146
- # Custom attribute writer method with validation
147
- # @param [Object] instrument_identifier_id Value to be assigned
148
- def instrument_identifier_id=(instrument_identifier_id)
149
- @instrument_identifier_id = instrument_identifier_id
150
- end
151
-
152
- # Custom attribute writer method with validation
153
- # @param [Object] card_expiry_month Value to be assigned
154
- def card_expiry_month=(card_expiry_month)
155
- @card_expiry_month = card_expiry_month
156
- end
157
-
158
- # Custom attribute writer method with validation
159
- # @param [Object] card_expiry_year Value to be assigned
160
- def card_expiry_year=(card_expiry_year)
161
- @card_expiry_year = card_expiry_year
162
- end
163
-
164
- # Checks equality by comparing each attribute.
165
- # @param [Object] Object to be compared
166
- def ==(o)
167
- return true if self.equal?(o)
168
- self.class == o.class &&
169
- token == o.token &&
170
- customer_id == o.customer_id &&
171
- payment_instrument_id == o.payment_instrument_id &&
172
- instrument_identifier_id == o.instrument_identifier_id &&
173
- card_number == o.card_number &&
174
- card_expiry_month == o.card_expiry_month &&
175
- card_expiry_year == o.card_expiry_year &&
176
- card_type == o.card_type
177
- end
178
-
179
- # @see the `==` method
180
- # @param [Object] Object to be compared
181
- def eql?(o)
182
- self == o
183
- end
184
-
185
- # Calculates hash code according to all attributes.
186
- # @return [Fixnum] Hash code
187
- def hash
188
- [token, customer_id, payment_instrument_id, instrument_identifier_id, card_number, card_expiry_month, card_expiry_year, card_type].hash
189
- end
190
-
191
- # Builds the object from hash
192
- # @param [Hash] attributes Model attributes in the form of hash
193
- # @return [Object] Returns the model itself
194
- def build_from_hash(attributes)
195
- return nil unless attributes.is_a?(Hash)
196
- self.class.swagger_types.each_pair do |key, type|
197
- if type =~ /\AArray<(.*)>/i
198
- # check to ensure the input is an array given that the the attribute
199
- # is documented as an array but the input is not
200
- if attributes[self.class.attribute_map[key]].is_a?(Array)
201
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
202
- end
203
- elsif !attributes[self.class.attribute_map[key]].nil?
204
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
205
- end # or else data not found in attributes(hash), not an issue as the data can be optional
206
- end
207
-
208
- self
209
- end
210
-
211
- # Deserializes the data based on type
212
- # @param string type Data type
213
- # @param string value Value to be deserialized
214
- # @return [Object] Deserialized data
215
- def _deserialize(type, value)
216
- case type.to_sym
217
- when :DateTime
218
- DateTime.parse(value)
219
- when :Date
220
- Date.parse(value)
221
- when :String
222
- value.to_s
223
- when :Integer
224
- value.to_i
225
- when :Float
226
- value.to_f
227
- when :BOOLEAN
228
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
- true
230
- else
231
- false
232
- end
233
- when :Object
234
- # generic object (usually a Hash), return directly
235
- value
236
- when /\AArray<(?<inner_type>.+)>\z/
237
- inner_type = Regexp.last_match[:inner_type]
238
- value.map { |v| _deserialize(inner_type, v) }
239
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
- k_type = Regexp.last_match[:k_type]
241
- v_type = Regexp.last_match[:v_type]
242
- {}.tap do |hash|
243
- value.each do |k, v|
244
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
- end
246
- end
247
- else # model
248
- temp_model = CyberSource.const_get(type).new
249
- temp_model.build_from_hash(value)
250
- end
251
- end
252
-
253
- # Returns the string representation of the object
254
- # @return [String] String presentation of the object
255
- def to_s
256
- to_hash.to_s
257
- end
258
-
259
- # to_body is an alias to to_hash (backward compatibility)
260
- # @return [Hash] Returns the object in the form of hash
261
- def to_body
262
- to_hash
263
- end
264
-
265
- # Returns the object in the form of hash
266
- # @return [Hash] Returns the object in the form of hash
267
- def to_hash
268
- hash = {}
269
- self.class.attribute_map.each_pair do |attr, param|
270
- value = self.send(attr)
271
- next if value.nil?
272
- hash[param] = _to_hash(value)
273
- end
274
- hash
275
- end
276
-
277
- # Outputs non-array value in the form of hash
278
- # For object, use to_hash. Otherwise, just return the value
279
- # @param [Object] value Any valid value
280
- # @return [Hash] Returns the value in the form of hash
281
- def _to_hash(value)
282
- if value.is_a?(Array)
283
- value.compact.map { |v| _to_hash(v) }
284
- elsif value.is_a?(Hash)
285
- {}.tap do |hash|
286
- value.each { |k, v| hash[k] = _to_hash(v) }
287
- end
288
- elsif value.respond_to? :to_hash
289
- value.to_hash
290
- else
291
- value
292
- end
293
- end
294
- end
295
- end
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 InlineResponse20010SourceRecord
16
+ attr_accessor :token
17
+
18
+ attr_accessor :customer_id
19
+
20
+ attr_accessor :payment_instrument_id
21
+
22
+ attr_accessor :instrument_identifier_id
23
+
24
+ attr_accessor :card_number
25
+
26
+ attr_accessor :card_expiry_month
27
+
28
+ attr_accessor :card_expiry_year
29
+
30
+ attr_accessor :card_type
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'token' => :'token',
36
+ :'customer_id' => :'customerId',
37
+ :'payment_instrument_id' => :'paymentInstrumentId',
38
+ :'instrument_identifier_id' => :'instrumentIdentifierId',
39
+ :'card_number' => :'cardNumber',
40
+ :'card_expiry_month' => :'cardExpiryMonth',
41
+ :'card_expiry_year' => :'cardExpiryYear',
42
+ :'card_type' => :'cardType'
43
+ }
44
+ end
45
+
46
+ # Attribute mapping from JSON key to ruby-style variable name.
47
+ def self.json_map
48
+ {
49
+ :'token' => :'token',
50
+ :'customer_id' => :'customer_id',
51
+ :'payment_instrument_id' => :'payment_instrument_id',
52
+ :'instrument_identifier_id' => :'instrument_identifier_id',
53
+ :'card_number' => :'card_number',
54
+ :'card_expiry_month' => :'card_expiry_month',
55
+ :'card_expiry_year' => :'card_expiry_year',
56
+ :'card_type' => :'card_type'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'token' => :'String',
64
+ :'customer_id' => :'String',
65
+ :'payment_instrument_id' => :'String',
66
+ :'instrument_identifier_id' => :'String',
67
+ :'card_number' => :'String',
68
+ :'card_expiry_month' => :'String',
69
+ :'card_expiry_year' => :'String',
70
+ :'card_type' => :'String'
71
+ }
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
+
82
+ if attributes.has_key?(:'token')
83
+ self.token = attributes[:'token']
84
+ end
85
+
86
+ if attributes.has_key?(:'customerId')
87
+ self.customer_id = attributes[:'customerId']
88
+ end
89
+
90
+ if attributes.has_key?(:'paymentInstrumentId')
91
+ self.payment_instrument_id = attributes[:'paymentInstrumentId']
92
+ end
93
+
94
+ if attributes.has_key?(:'instrumentIdentifierId')
95
+ self.instrument_identifier_id = attributes[:'instrumentIdentifierId']
96
+ end
97
+
98
+ if attributes.has_key?(:'cardNumber')
99
+ self.card_number = attributes[:'cardNumber']
100
+ end
101
+
102
+ if attributes.has_key?(:'cardExpiryMonth')
103
+ self.card_expiry_month = attributes[:'cardExpiryMonth']
104
+ end
105
+
106
+ if attributes.has_key?(:'cardExpiryYear')
107
+ self.card_expiry_year = attributes[:'cardExpiryYear']
108
+ end
109
+
110
+ if attributes.has_key?(:'cardType')
111
+ self.card_type = attributes[:'cardType']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] token Value to be assigned
130
+ def token=(token)
131
+ @token = token
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] customer_id Value to be assigned
136
+ def customer_id=(customer_id)
137
+ @customer_id = customer_id
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] payment_instrument_id Value to be assigned
142
+ def payment_instrument_id=(payment_instrument_id)
143
+ @payment_instrument_id = payment_instrument_id
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] instrument_identifier_id Value to be assigned
148
+ def instrument_identifier_id=(instrument_identifier_id)
149
+ @instrument_identifier_id = instrument_identifier_id
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] card_expiry_month Value to be assigned
154
+ def card_expiry_month=(card_expiry_month)
155
+ @card_expiry_month = card_expiry_month
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] card_expiry_year Value to be assigned
160
+ def card_expiry_year=(card_expiry_year)
161
+ @card_expiry_year = card_expiry_year
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ token == o.token &&
170
+ customer_id == o.customer_id &&
171
+ payment_instrument_id == o.payment_instrument_id &&
172
+ instrument_identifier_id == o.instrument_identifier_id &&
173
+ card_number == o.card_number &&
174
+ card_expiry_month == o.card_expiry_month &&
175
+ card_expiry_year == o.card_expiry_year &&
176
+ card_type == o.card_type
177
+ end
178
+
179
+ # @see the `==` method
180
+ # @param [Object] Object to be compared
181
+ def eql?(o)
182
+ self == o
183
+ end
184
+
185
+ # Calculates hash code according to all attributes.
186
+ # @return [Fixnum] Hash code
187
+ def hash
188
+ [token, customer_id, payment_instrument_id, instrument_identifier_id, card_number, card_expiry_month, card_expiry_year, card_type].hash
189
+ end
190
+
191
+ # Builds the object from hash
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ # @return [Object] Returns the model itself
194
+ def build_from_hash(attributes)
195
+ return nil unless attributes.is_a?(Hash)
196
+ self.class.swagger_types.each_pair do |key, type|
197
+ if type =~ /\AArray<(.*)>/i
198
+ # check to ensure the input is an array given that the the attribute
199
+ # is documented as an array but the input is not
200
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
201
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
202
+ end
203
+ elsif !attributes[self.class.attribute_map[key]].nil?
204
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
205
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
206
+ end
207
+
208
+ self
209
+ end
210
+
211
+ # Deserializes the data based on type
212
+ # @param string type Data type
213
+ # @param string value Value to be deserialized
214
+ # @return [Object] Deserialized data
215
+ def _deserialize(type, value)
216
+ case type.to_sym
217
+ when :DateTime
218
+ DateTime.parse(value)
219
+ when :Date
220
+ Date.parse(value)
221
+ when :String
222
+ value.to_s
223
+ when :Integer
224
+ value.to_i
225
+ when :Float
226
+ value.to_f
227
+ when :BOOLEAN
228
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
+ true
230
+ else
231
+ false
232
+ end
233
+ when :Object
234
+ # generic object (usually a Hash), return directly
235
+ value
236
+ when /\AArray<(?<inner_type>.+)>\z/
237
+ inner_type = Regexp.last_match[:inner_type]
238
+ value.map { |v| _deserialize(inner_type, v) }
239
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
+ k_type = Regexp.last_match[:k_type]
241
+ v_type = Regexp.last_match[:v_type]
242
+ {}.tap do |hash|
243
+ value.each do |k, v|
244
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
+ end
246
+ end
247
+ else # model
248
+ temp_model = CyberSource.const_get(type).new
249
+ temp_model.build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ next if value.nil?
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+ end
295
+ end