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,240 +1,240 @@
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
- # This is a server-to-server API request to generate the capture context that can be used to initiate an instance of Microform on an acceptance page. The capture context is a digitally signed JWT that provides authentication, one-time keys, and the target origin to the Microform Integration application.
16
- class GenerateCaptureContextRequest
17
- # Specify the version of Microform that you want to use.
18
- attr_accessor :client_version
19
-
20
- # The [target origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) of the website on which you will be launching Microform is defined by the scheme (protocol), hostname (domain) and port number (if used). You must use https://hostname (unless you use http://localhost) Wildcards are NOT supported. Ensure that subdomains are included. Any valid top-level domain is supported (e.g. .com, .co.uk, .gov.br etc) Examples: - https://example.com - https://subdomain.example.com - https://example.com:8080<br><br> If you are embedding within multiple nested iframes you need to specify the origins of all the browser contexts used, for example: targetOrigins: [ \"https://example.com\", \"https://basket.example.com\", \"https://ecom.example.com\" ]<br><br> You can supply up to nine origins within the targetOrigins field for nested iframes. If the list of origins exceeds five ensure that you: - Compare the list of origins in the v2/sessions targetOrigins field against the location.ancestorOrigins of the browser. - Ensure that the count of origins and their content matches in both. If any origins are absent or mismatched, the system will prevent Microform from loading and display a client-side error message.
21
- attr_accessor :target_origins
22
-
23
- # The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (ACH/eCheck) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Card) and Microform (ACH/eCheck) at least one card network should be specified in the allowedCardNetworks field in the capture context request.
24
- attr_accessor :allowed_card_networks
25
-
26
- # The payment types that are allowed for the merchant. Possible values when launching Microform: - CARD - CHECK <br><br>
27
- attr_accessor :allowed_payment_types
28
-
29
- attr_accessor :transient_token_response_options
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'client_version' => :'clientVersion',
35
- :'target_origins' => :'targetOrigins',
36
- :'allowed_card_networks' => :'allowedCardNetworks',
37
- :'allowed_payment_types' => :'allowedPaymentTypes',
38
- :'transient_token_response_options' => :'transientTokenResponseOptions'
39
- }
40
- end
41
-
42
- # Attribute mapping from JSON key to ruby-style variable name.
43
- def self.json_map
44
- {
45
- :'client_version' => :'client_version',
46
- :'target_origins' => :'target_origins',
47
- :'allowed_card_networks' => :'allowed_card_networks',
48
- :'allowed_payment_types' => :'allowed_payment_types',
49
- :'transient_token_response_options' => :'transient_token_response_options'
50
- }
51
- end
52
-
53
- # Attribute type mapping.
54
- def self.swagger_types
55
- {
56
- :'client_version' => :'String',
57
- :'target_origins' => :'Array<String>',
58
- :'allowed_card_networks' => :'Array<String>',
59
- :'allowed_payment_types' => :'Array<String>',
60
- :'transient_token_response_options' => :'Microformv2sessionsTransientTokenResponseOptions'
61
- }
62
- end
63
-
64
- # Initializes the object
65
- # @param [Hash] attributes Model attributes in the form of hash
66
- def initialize(attributes = {})
67
- return unless attributes.is_a?(Hash)
68
-
69
- # convert string to symbol for hash key
70
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
71
-
72
- if attributes.has_key?(:'clientVersion')
73
- self.client_version = attributes[:'clientVersion']
74
- end
75
-
76
- if attributes.has_key?(:'targetOrigins')
77
- if (value = attributes[:'targetOrigins']).is_a?(Array)
78
- self.target_origins = value
79
- end
80
- end
81
-
82
- if attributes.has_key?(:'allowedCardNetworks')
83
- if (value = attributes[:'allowedCardNetworks']).is_a?(Array)
84
- self.allowed_card_networks = value
85
- end
86
- end
87
-
88
- if attributes.has_key?(:'allowedPaymentTypes')
89
- if (value = attributes[:'allowedPaymentTypes']).is_a?(Array)
90
- self.allowed_payment_types = value
91
- end
92
- end
93
-
94
- if attributes.has_key?(:'transientTokenResponseOptions')
95
- self.transient_token_response_options = attributes[:'transientTokenResponseOptions']
96
- end
97
- end
98
-
99
- # Show invalid properties with the reasons. Usually used together with valid?
100
- # @return Array for valid properties with the reasons
101
- def list_invalid_properties
102
- invalid_properties = Array.new
103
- invalid_properties
104
- end
105
-
106
- # Check to see if the all the properties in the model are valid
107
- # @return true if the model is valid
108
- def valid?
109
- true
110
- end
111
-
112
- # Checks equality by comparing each attribute.
113
- # @param [Object] Object to be compared
114
- def ==(o)
115
- return true if self.equal?(o)
116
- self.class == o.class &&
117
- client_version == o.client_version &&
118
- target_origins == o.target_origins &&
119
- allowed_card_networks == o.allowed_card_networks &&
120
- allowed_payment_types == o.allowed_payment_types &&
121
- transient_token_response_options == o.transient_token_response_options
122
- end
123
-
124
- # @see the `==` method
125
- # @param [Object] Object to be compared
126
- def eql?(o)
127
- self == o
128
- end
129
-
130
- # Calculates hash code according to all attributes.
131
- # @return [Fixnum] Hash code
132
- def hash
133
- [client_version, target_origins, allowed_card_networks, allowed_payment_types, transient_token_response_options].hash
134
- end
135
-
136
- # Builds the object from hash
137
- # @param [Hash] attributes Model attributes in the form of hash
138
- # @return [Object] Returns the model itself
139
- def build_from_hash(attributes)
140
- return nil unless attributes.is_a?(Hash)
141
- self.class.swagger_types.each_pair do |key, type|
142
- if type =~ /\AArray<(.*)>/i
143
- # check to ensure the input is an array given that the the attribute
144
- # is documented as an array but the input is not
145
- if attributes[self.class.attribute_map[key]].is_a?(Array)
146
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
- end
148
- elsif !attributes[self.class.attribute_map[key]].nil?
149
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
- end # or else data not found in attributes(hash), not an issue as the data can be optional
151
- end
152
-
153
- self
154
- end
155
-
156
- # Deserializes the data based on type
157
- # @param string type Data type
158
- # @param string value Value to be deserialized
159
- # @return [Object] Deserialized data
160
- def _deserialize(type, value)
161
- case type.to_sym
162
- when :DateTime
163
- DateTime.parse(value)
164
- when :Date
165
- Date.parse(value)
166
- when :String
167
- value.to_s
168
- when :Integer
169
- value.to_i
170
- when :Float
171
- value.to_f
172
- when :BOOLEAN
173
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
- true
175
- else
176
- false
177
- end
178
- when :Object
179
- # generic object (usually a Hash), return directly
180
- value
181
- when /\AArray<(?<inner_type>.+)>\z/
182
- inner_type = Regexp.last_match[:inner_type]
183
- value.map { |v| _deserialize(inner_type, v) }
184
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
- k_type = Regexp.last_match[:k_type]
186
- v_type = Regexp.last_match[:v_type]
187
- {}.tap do |hash|
188
- value.each do |k, v|
189
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
- end
191
- end
192
- else # model
193
- temp_model = CyberSource.const_get(type).new
194
- temp_model.build_from_hash(value)
195
- end
196
- end
197
-
198
- # Returns the string representation of the object
199
- # @return [String] String presentation of the object
200
- def to_s
201
- to_hash.to_s
202
- end
203
-
204
- # to_body is an alias to to_hash (backward compatibility)
205
- # @return [Hash] Returns the object in the form of hash
206
- def to_body
207
- to_hash
208
- end
209
-
210
- # Returns the object in the form of hash
211
- # @return [Hash] Returns the object in the form of hash
212
- def to_hash
213
- hash = {}
214
- self.class.attribute_map.each_pair do |attr, param|
215
- value = self.send(attr)
216
- next if value.nil?
217
- hash[param] = _to_hash(value)
218
- end
219
- hash
220
- end
221
-
222
- # Outputs non-array value in the form of hash
223
- # For object, use to_hash. Otherwise, just return the value
224
- # @param [Object] value Any valid value
225
- # @return [Hash] Returns the value in the form of hash
226
- def _to_hash(value)
227
- if value.is_a?(Array)
228
- value.compact.map { |v| _to_hash(v) }
229
- elsif value.is_a?(Hash)
230
- {}.tap do |hash|
231
- value.each { |k, v| hash[k] = _to_hash(v) }
232
- end
233
- elsif value.respond_to? :to_hash
234
- value.to_hash
235
- else
236
- value
237
- end
238
- end
239
- end
240
- 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
+ # This is a server-to-server API request to generate the capture context that can be used to initiate an instance of Microform on an acceptance page. The capture context is a digitally signed JWT that provides authentication, one-time keys, and the target origin to the Microform Integration application.
16
+ class GenerateCaptureContextRequest
17
+ # Specify the version of Microform that you want to use.
18
+ attr_accessor :client_version
19
+
20
+ # The [target origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) of the website on which you will be launching Microform is defined by the scheme (protocol), hostname (domain) and port number (if used). You must use https://hostname (unless you use http://localhost) Wildcards are NOT supported. Ensure that subdomains are included. Any valid top-level domain is supported (e.g. .com, .co.uk, .gov.br etc) Examples: - https://example.com - https://subdomain.example.com - https://example.com:8080<br><br> If you are embedding within multiple nested iframes you need to specify the origins of all the browser contexts used, for example: targetOrigins: [ \"https://example.com\", \"https://basket.example.com\", \"https://ecom.example.com\" ]<br><br> You can supply up to nine origins within the targetOrigins field for nested iframes. If the list of origins exceeds five ensure that you: - Compare the list of origins in the v2/sessions targetOrigins field against the location.ancestorOrigins of the browser. - Ensure that the count of origins and their content matches in both. If any origins are absent or mismatched, the system will prevent Microform from loading and display a client-side error message.
21
+ attr_accessor :target_origins
22
+
23
+ # The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA - PAYPAK **Important:** - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (ACH/eCheck) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Card) and Microform (ACH/eCheck) at least one card network should be specified in the allowedCardNetworks field in the capture context request.
24
+ attr_accessor :allowed_card_networks
25
+
26
+ # The payment types that are allowed for the merchant. Possible values when launching Microform: - CARD - CHECK <br><br>
27
+ attr_accessor :allowed_payment_types
28
+
29
+ attr_accessor :transient_token_response_options
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'client_version' => :'clientVersion',
35
+ :'target_origins' => :'targetOrigins',
36
+ :'allowed_card_networks' => :'allowedCardNetworks',
37
+ :'allowed_payment_types' => :'allowedPaymentTypes',
38
+ :'transient_token_response_options' => :'transientTokenResponseOptions'
39
+ }
40
+ end
41
+
42
+ # Attribute mapping from JSON key to ruby-style variable name.
43
+ def self.json_map
44
+ {
45
+ :'client_version' => :'client_version',
46
+ :'target_origins' => :'target_origins',
47
+ :'allowed_card_networks' => :'allowed_card_networks',
48
+ :'allowed_payment_types' => :'allowed_payment_types',
49
+ :'transient_token_response_options' => :'transient_token_response_options'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'client_version' => :'String',
57
+ :'target_origins' => :'Array<String>',
58
+ :'allowed_card_networks' => :'Array<String>',
59
+ :'allowed_payment_types' => :'Array<String>',
60
+ :'transient_token_response_options' => :'Microformv2sessionsTransientTokenResponseOptions'
61
+ }
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ return unless attributes.is_a?(Hash)
68
+
69
+ # convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
71
+
72
+ if attributes.has_key?(:'clientVersion')
73
+ self.client_version = attributes[:'clientVersion']
74
+ end
75
+
76
+ if attributes.has_key?(:'targetOrigins')
77
+ if (value = attributes[:'targetOrigins']).is_a?(Array)
78
+ self.target_origins = value
79
+ end
80
+ end
81
+
82
+ if attributes.has_key?(:'allowedCardNetworks')
83
+ if (value = attributes[:'allowedCardNetworks']).is_a?(Array)
84
+ self.allowed_card_networks = value
85
+ end
86
+ end
87
+
88
+ if attributes.has_key?(:'allowedPaymentTypes')
89
+ if (value = attributes[:'allowedPaymentTypes']).is_a?(Array)
90
+ self.allowed_payment_types = value
91
+ end
92
+ end
93
+
94
+ if attributes.has_key?(:'transientTokenResponseOptions')
95
+ self.transient_token_response_options = attributes[:'transientTokenResponseOptions']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ client_version == o.client_version &&
118
+ target_origins == o.target_origins &&
119
+ allowed_card_networks == o.allowed_card_networks &&
120
+ allowed_payment_types == o.allowed_payment_types &&
121
+ transient_token_response_options == o.transient_token_response_options
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Fixnum] Hash code
132
+ def hash
133
+ [client_version, target_origins, allowed_card_networks, allowed_payment_types, transient_token_response_options].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.swagger_types.each_pair do |key, type|
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :DateTime
163
+ DateTime.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :BOOLEAN
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ temp_model = CyberSource.const_get(type).new
194
+ temp_model.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ next if value.nil?
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+ end
240
+ end