cybersource_rest_client 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client.rb +18 -44
  3. data/lib/cybersource_rest_client/api/asymmetric_key_management_api.rb +9 -9
  4. data/lib/cybersource_rest_client/api/symmetric_key_management_api.rb +9 -9
  5. data/lib/cybersource_rest_client/api/tokenization_api.rb +89 -0
  6. data/lib/cybersource_rest_client/models/{tokenize_result.rb → flex_v1_tokens_post200_response.rb} +1 -1
  7. data/lib/cybersource_rest_client/models/{card_info.rb → flexv1tokens_card_info.rb} +1 -1
  8. data/lib/cybersource_rest_client/models/{inline_response_200_3.rb → kms_v2_keys_asym_deletes_post200_response.rb} +2 -2
  9. data/lib/cybersource_rest_client/models/{inline_response_200_3_key_information.rb → kms_v2_keys_asym_deletes_post200_response_key_information.rb} +2 -2
  10. data/lib/cybersource_rest_client/models/{inline_response_200_2.rb → kms_v2_keys_asym_get200_response.rb} +2 -2
  11. data/lib/cybersource_rest_client/models/{inline_response_200_2_key_information.rb → kms_v2_keys_asym_get200_response_key_information.rb} +2 -2
  12. data/lib/cybersource_rest_client/models/{inline_response_201_1.rb → kms_v2_keys_asym_post201_response.rb} +3 -3
  13. data/lib/cybersource_rest_client/models/{inline_response_201_1_certificate_information.rb → kms_v2_keys_asym_post201_response_certificate_information.rb} +1 -1
  14. data/lib/cybersource_rest_client/models/{inline_response_201_1_key_information.rb → kms_v2_keys_asym_post201_response_key_information.rb} +2 -2
  15. data/lib/cybersource_rest_client/models/{inline_response_200_1.rb → kms_v2_keys_sym_deletes_post200_response.rb} +2 -2
  16. data/lib/cybersource_rest_client/models/{inline_response_200_1_key_information.rb → kms_v2_keys_sym_deletes_post200_response_key_information.rb} +2 -2
  17. data/lib/cybersource_rest_client/models/{inline_response_200.rb → kms_v2_keys_sym_get200_response.rb} +2 -2
  18. data/lib/cybersource_rest_client/models/{inline_response_200_key_information.rb → kms_v2_keys_sym_get200_response_key_information.rb} +2 -2
  19. data/lib/cybersource_rest_client/models/{inline_response_201.rb → kms_v2_keys_sym_post201_response.rb} +2 -2
  20. data/lib/cybersource_rest_client/models/{inline_response_201_error_information.rb → kms_v2_keys_sym_post201_response_error_information.rb} +1 -1
  21. data/lib/cybersource_rest_client/models/{inline_response_201_key_information.rb → kms_v2_keys_sym_post201_response_key_information.rb} +2 -2
  22. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +6 -6
  23. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +6 -6
  24. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +1 -1
  25. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +1 -1
  26. data/lib/cybersource_rest_client/models/{tokenize_parameters.rb → tokenize_request.rb} +2 -2
  27. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +1 -1
  28. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +1 -1
  29. metadata +20 -46
  30. data/lib/cybersource_rest_client/models/customer.rb +0 -292
  31. data/lib/cybersource_rest_client/models/der_public_key.rb +0 -205
  32. data/lib/cybersource_rest_client/models/error.rb +0 -192
  33. data/lib/cybersource_rest_client/models/error_bean.rb +0 -247
  34. data/lib/cybersource_rest_client/models/error_field_bean.rb +0 -205
  35. data/lib/cybersource_rest_client/models/error_links.rb +0 -205
  36. data/lib/cybersource_rest_client/models/error_response.rb +0 -192
  37. data/lib/cybersource_rest_client/models/file_bean.rb +0 -202
  38. data/lib/cybersource_rest_client/models/file_detail.rb +0 -244
  39. data/lib/cybersource_rest_client/models/file_details_response.rb +0 -194
  40. data/lib/cybersource_rest_client/models/instrument_identifier.rb +0 -286
  41. data/lib/cybersource_rest_client/models/json_web_key.rb +0 -225
  42. data/lib/cybersource_rest_client/models/key_parameters.rb +0 -199
  43. data/lib/cybersource_rest_client/models/key_result.rb +0 -202
  44. data/lib/cybersource_rest_client/models/link.rb +0 -204
  45. data/lib/cybersource_rest_client/models/links.rb +0 -205
  46. data/lib/cybersource_rest_client/models/payment_instrument.rb +0 -318
  47. data/lib/cybersource_rest_client/models/payment_instrument_paginated.rb +0 -232
  48. data/lib/cybersource_rest_client/models/response_status.rb +0 -225
  49. data/lib/cybersource_rest_client/models/response_status_details.rb +0 -194
  50. data/lib/cybersource_rest_client/models/self_link_bean.rb +0 -192
  51. data/lib/cybersource_rest_client/models/shipping_address.rb +0 -235
  52. data/lib/cybersource_rest_client/models/shipping_address_paginated.rb +0 -233
  53. data/lib/cybersource_rest_client/models/tms_error.rb +0 -205
  54. data/lib/cybersource_rest_client/models/tms_error_details.rb +0 -194
  55. data/lib/cybersource_rest_client/models/tms_error_response.rb +0 -185
  56. data/lib/cybersource_rest_client/models/tokenize_parameters_card_info.rb +0 -224
@@ -1,225 +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.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CyberSource
16
- # The public key in JSON Web Key (JWK) format. This format is useful for client side encryption in JavaScript based implementations.
17
- class JsonWebKey
18
- # Algorithm used to encrypt the public key.
19
- attr_accessor :kty
20
-
21
- # Defines whether to use the key for encryption (enc) or verifying a signature (sig). Always returned as enc.
22
- attr_accessor :use
23
-
24
- # The key ID in JWK format.
25
- attr_accessor :kid
26
-
27
- # JWK RSA Modulus
28
- attr_accessor :n
29
-
30
- # JWK RSA Exponent
31
- attr_accessor :e
32
-
33
- # Attribute mapping from ruby-style variable name to JSON key.
34
- def self.attribute_map
35
- {
36
- :'kty' => :'kty',
37
- :'use' => :'use',
38
- :'kid' => :'kid',
39
- :'n' => :'n',
40
- :'e' => :'e'
41
- }
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.swagger_types
46
- {
47
- :'kty' => :'String',
48
- :'use' => :'String',
49
- :'kid' => :'String',
50
- :'n' => :'String',
51
- :'e' => :'String'
52
- }
53
- end
54
-
55
- # Initializes the object
56
- # @param [Hash] attributes Model attributes in the form of hash
57
- def initialize(attributes = {})
58
- return unless attributes.is_a?(Hash)
59
-
60
- # convert string to symbol for hash key
61
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
-
63
- if attributes.has_key?(:'kty')
64
- self.kty = attributes[:'kty']
65
- end
66
-
67
- if attributes.has_key?(:'use')
68
- self.use = attributes[:'use']
69
- end
70
-
71
- if attributes.has_key?(:'kid')
72
- self.kid = attributes[:'kid']
73
- end
74
-
75
- if attributes.has_key?(:'n')
76
- self.n = attributes[:'n']
77
- end
78
-
79
- if attributes.has_key?(:'e')
80
- self.e = attributes[:'e']
81
- end
82
- end
83
-
84
- # Show invalid properties with the reasons. Usually used together with valid?
85
- # @return Array for valid properties with the reasons
86
- def list_invalid_properties
87
- invalid_properties = Array.new
88
- invalid_properties
89
- end
90
-
91
- # Check to see if the all the properties in the model are valid
92
- # @return true if the model is valid
93
- def valid?
94
- true
95
- end
96
-
97
- # Checks equality by comparing each attribute.
98
- # @param [Object] Object to be compared
99
- def ==(o)
100
- return true if self.equal?(o)
101
- self.class == o.class &&
102
- kty == o.kty &&
103
- use == o.use &&
104
- kid == o.kid &&
105
- n == o.n &&
106
- e == o.e
107
- end
108
-
109
- # @see the `==` method
110
- # @param [Object] Object to be compared
111
- def eql?(o)
112
- self == o
113
- end
114
-
115
- # Calculates hash code according to all attributes.
116
- # @return [Fixnum] Hash code
117
- def hash
118
- [kty, use, kid, n, e].hash
119
- end
120
-
121
- # Builds the object from hash
122
- # @param [Hash] attributes Model attributes in the form of hash
123
- # @return [Object] Returns the model itself
124
- def build_from_hash(attributes)
125
- return nil unless attributes.is_a?(Hash)
126
- self.class.swagger_types.each_pair do |key, type|
127
- if type =~ /\AArray<(.*)>/i
128
- # check to ensure the input is an array given that the the attribute
129
- # is documented as an array but the input is not
130
- if attributes[self.class.attribute_map[key]].is_a?(Array)
131
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
- end
133
- elsif !attributes[self.class.attribute_map[key]].nil?
134
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
- end # or else data not found in attributes(hash), not an issue as the data can be optional
136
- end
137
-
138
- self
139
- end
140
-
141
- # Deserializes the data based on type
142
- # @param string type Data type
143
- # @param string value Value to be deserialized
144
- # @return [Object] Deserialized data
145
- def _deserialize(type, value)
146
- case type.to_sym
147
- when :DateTime
148
- DateTime.parse(value)
149
- when :Date
150
- Date.parse(value)
151
- when :String
152
- value.to_s
153
- when :Integer
154
- value.to_i
155
- when :Float
156
- value.to_f
157
- when :BOOLEAN
158
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
- true
160
- else
161
- false
162
- end
163
- when :Object
164
- # generic object (usually a Hash), return directly
165
- value
166
- when /\AArray<(?<inner_type>.+)>\z/
167
- inner_type = Regexp.last_match[:inner_type]
168
- value.map { |v| _deserialize(inner_type, v) }
169
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
- k_type = Regexp.last_match[:k_type]
171
- v_type = Regexp.last_match[:v_type]
172
- {}.tap do |hash|
173
- value.each do |k, v|
174
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
- end
176
- end
177
- else # model
178
- temp_model = CyberSource.const_get(type).new
179
- temp_model.build_from_hash(value)
180
- end
181
- end
182
-
183
- # Returns the string representation of the object
184
- # @return [String] String presentation of the object
185
- def to_s
186
- to_hash.to_s
187
- end
188
-
189
- # to_body is an alias to to_hash (backward compatibility)
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_body
192
- to_hash
193
- end
194
-
195
- # Returns the object in the form of hash
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_hash
198
- hash = {}
199
- self.class.attribute_map.each_pair do |attr, param|
200
- value = self.send(attr)
201
- next if value.nil?
202
- hash[param] = _to_hash(value)
203
- end
204
- hash
205
- end
206
-
207
- # Outputs non-array value in the form of hash
208
- # For object, use to_hash. Otherwise, just return the value
209
- # @param [Object] value Any valid value
210
- # @return [Hash] Returns the value in the form of hash
211
- def _to_hash(value)
212
- if value.is_a?(Array)
213
- value.compact.map { |v| _to_hash(v) }
214
- elsif value.is_a?(Hash)
215
- {}.tap do |hash|
216
- value.each { |k, v| hash[k] = _to_hash(v) }
217
- end
218
- elsif value.respond_to? :to_hash
219
- value.to_hash
220
- else
221
- value
222
- end
223
- end
224
- end
225
- end
@@ -1,199 +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.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CyberSource
16
- class KeyParameters
17
- # How the card number should be encrypted in the subsequent Tokenize Card request. Possible values are RsaOaep256 or None (if using this value the card number must be in plain text when included in the Tokenize Card request). The Tokenize Card request uses a secure connection (TLS 1.2+) regardless of what encryption type is specified.
18
- attr_accessor :encryption_type
19
-
20
- # The merchant origin (e.g. https://example.com) used to integrate with Flex API. Required to comply with CORS and CSP standards.
21
- attr_accessor :target_origin
22
-
23
- # Attribute mapping from ruby-style variable name to JSON key.
24
- def self.attribute_map
25
- {
26
- :'encryption_type' => :'encryptionType',
27
- :'target_origin' => :'targetOrigin'
28
- }
29
- end
30
-
31
- # Attribute type mapping.
32
- def self.swagger_types
33
- {
34
- :'encryption_type' => :'String',
35
- :'target_origin' => :'String'
36
- }
37
- end
38
-
39
- # Initializes the object
40
- # @param [Hash] attributes Model attributes in the form of hash
41
- def initialize(attributes = {})
42
- return unless attributes.is_a?(Hash)
43
-
44
- # convert string to symbol for hash key
45
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
-
47
- if attributes.has_key?(:'encryptionType')
48
- self.encryption_type = attributes[:'encryptionType']
49
- end
50
-
51
- if attributes.has_key?(:'targetOrigin')
52
- self.target_origin = attributes[:'targetOrigin']
53
- end
54
- end
55
-
56
- # Show invalid properties with the reasons. Usually used together with valid?
57
- # @return Array for valid properties with the reasons
58
- def list_invalid_properties
59
- invalid_properties = Array.new
60
- if @encryption_type.nil?
61
- invalid_properties.push('invalid value for "encryption_type", encryption_type cannot be nil.')
62
- end
63
-
64
- invalid_properties
65
- end
66
-
67
- # Check to see if the all the properties in the model are valid
68
- # @return true if the model is valid
69
- def valid?
70
- return false if @encryption_type.nil?
71
- true
72
- end
73
-
74
- # Checks equality by comparing each attribute.
75
- # @param [Object] Object to be compared
76
- def ==(o)
77
- return true if self.equal?(o)
78
- self.class == o.class &&
79
- encryption_type == o.encryption_type &&
80
- target_origin == o.target_origin
81
- end
82
-
83
- # @see the `==` method
84
- # @param [Object] Object to be compared
85
- def eql?(o)
86
- self == o
87
- end
88
-
89
- # Calculates hash code according to all attributes.
90
- # @return [Fixnum] Hash code
91
- def hash
92
- [encryption_type, target_origin].hash
93
- end
94
-
95
- # Builds the object from hash
96
- # @param [Hash] attributes Model attributes in the form of hash
97
- # @return [Object] Returns the model itself
98
- def build_from_hash(attributes)
99
- return nil unless attributes.is_a?(Hash)
100
- self.class.swagger_types.each_pair do |key, type|
101
- if type =~ /\AArray<(.*)>/i
102
- # check to ensure the input is an array given that the the attribute
103
- # is documented as an array but the input is not
104
- if attributes[self.class.attribute_map[key]].is_a?(Array)
105
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
106
- end
107
- elsif !attributes[self.class.attribute_map[key]].nil?
108
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
- end # or else data not found in attributes(hash), not an issue as the data can be optional
110
- end
111
-
112
- self
113
- end
114
-
115
- # Deserializes the data based on type
116
- # @param string type Data type
117
- # @param string value Value to be deserialized
118
- # @return [Object] Deserialized data
119
- def _deserialize(type, value)
120
- case type.to_sym
121
- when :DateTime
122
- DateTime.parse(value)
123
- when :Date
124
- Date.parse(value)
125
- when :String
126
- value.to_s
127
- when :Integer
128
- value.to_i
129
- when :Float
130
- value.to_f
131
- when :BOOLEAN
132
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
- true
134
- else
135
- false
136
- end
137
- when :Object
138
- # generic object (usually a Hash), return directly
139
- value
140
- when /\AArray<(?<inner_type>.+)>\z/
141
- inner_type = Regexp.last_match[:inner_type]
142
- value.map { |v| _deserialize(inner_type, v) }
143
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
- k_type = Regexp.last_match[:k_type]
145
- v_type = Regexp.last_match[:v_type]
146
- {}.tap do |hash|
147
- value.each do |k, v|
148
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
- end
150
- end
151
- else # model
152
- temp_model = CyberSource.const_get(type).new
153
- temp_model.build_from_hash(value)
154
- end
155
- end
156
-
157
- # Returns the string representation of the object
158
- # @return [String] String presentation of the object
159
- def to_s
160
- to_hash.to_s
161
- end
162
-
163
- # to_body is an alias to to_hash (backward compatibility)
164
- # @return [Hash] Returns the object in the form of hash
165
- def to_body
166
- to_hash
167
- end
168
-
169
- # Returns the object in the form of hash
170
- # @return [Hash] Returns the object in the form of hash
171
- def to_hash
172
- hash = {}
173
- self.class.attribute_map.each_pair do |attr, param|
174
- value = self.send(attr)
175
- next if value.nil?
176
- hash[param] = _to_hash(value)
177
- end
178
- hash
179
- end
180
-
181
- # Outputs non-array value in the form of hash
182
- # For object, use to_hash. Otherwise, just return the value
183
- # @param [Object] value Any valid value
184
- # @return [Hash] Returns the value in the form of hash
185
- def _to_hash(value)
186
- if value.is_a?(Array)
187
- value.compact.map { |v| _to_hash(v) }
188
- elsif value.is_a?(Hash)
189
- {}.tap do |hash|
190
- value.each { |k, v| hash[k] = _to_hash(v) }
191
- end
192
- elsif value.respond_to? :to_hash
193
- value.to_hash
194
- else
195
- value
196
- end
197
- end
198
- end
199
- end
@@ -1,202 +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.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CyberSource
16
- class KeyResult
17
- # Unique identifier for the generated token. Used in the subsequent Tokenize Card request from your customer’s device or browser.
18
- attr_accessor :key_id
19
-
20
- attr_accessor :der
21
-
22
- attr_accessor :jwk
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'key_id' => :'keyId',
28
- :'der' => :'der',
29
- :'jwk' => :'jwk'
30
- }
31
- end
32
-
33
- # Attribute type mapping.
34
- def self.swagger_types
35
- {
36
- :'key_id' => :'String',
37
- :'der' => :'FlexV1KeysPost200ResponseDer',
38
- :'jwk' => :'FlexV1KeysPost200ResponseJwk'
39
- }
40
- end
41
-
42
- # Initializes the object
43
- # @param [Hash] attributes Model attributes in the form of hash
44
- def initialize(attributes = {})
45
- return unless attributes.is_a?(Hash)
46
-
47
- # convert string to symbol for hash key
48
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
49
-
50
- if attributes.has_key?(:'keyId')
51
- self.key_id = attributes[:'keyId']
52
- end
53
-
54
- if attributes.has_key?(:'der')
55
- self.der = attributes[:'der']
56
- end
57
-
58
- if attributes.has_key?(:'jwk')
59
- self.jwk = attributes[:'jwk']
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
- key_id == o.key_id &&
82
- der == o.der &&
83
- jwk == o.jwk
84
- end
85
-
86
- # @see the `==` method
87
- # @param [Object] Object to be compared
88
- def eql?(o)
89
- self == o
90
- end
91
-
92
- # Calculates hash code according to all attributes.
93
- # @return [Fixnum] Hash code
94
- def hash
95
- [key_id, der, jwk].hash
96
- end
97
-
98
- # Builds the object from hash
99
- # @param [Hash] attributes Model attributes in the form of hash
100
- # @return [Object] Returns the model itself
101
- def build_from_hash(attributes)
102
- return nil unless attributes.is_a?(Hash)
103
- self.class.swagger_types.each_pair do |key, type|
104
- if type =~ /\AArray<(.*)>/i
105
- # check to ensure the input is an array given that the the attribute
106
- # is documented as an array but the input is not
107
- if attributes[self.class.attribute_map[key]].is_a?(Array)
108
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
109
- end
110
- elsif !attributes[self.class.attribute_map[key]].nil?
111
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
112
- end # or else data not found in attributes(hash), not an issue as the data can be optional
113
- end
114
-
115
- self
116
- end
117
-
118
- # Deserializes the data based on type
119
- # @param string type Data type
120
- # @param string value Value to be deserialized
121
- # @return [Object] Deserialized data
122
- def _deserialize(type, value)
123
- case type.to_sym
124
- when :DateTime
125
- DateTime.parse(value)
126
- when :Date
127
- Date.parse(value)
128
- when :String
129
- value.to_s
130
- when :Integer
131
- value.to_i
132
- when :Float
133
- value.to_f
134
- when :BOOLEAN
135
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
136
- true
137
- else
138
- false
139
- end
140
- when :Object
141
- # generic object (usually a Hash), return directly
142
- value
143
- when /\AArray<(?<inner_type>.+)>\z/
144
- inner_type = Regexp.last_match[:inner_type]
145
- value.map { |v| _deserialize(inner_type, v) }
146
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
147
- k_type = Regexp.last_match[:k_type]
148
- v_type = Regexp.last_match[:v_type]
149
- {}.tap do |hash|
150
- value.each do |k, v|
151
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
152
- end
153
- end
154
- else # model
155
- temp_model = CyberSource.const_get(type).new
156
- temp_model.build_from_hash(value)
157
- end
158
- end
159
-
160
- # Returns the string representation of the object
161
- # @return [String] String presentation of the object
162
- def to_s
163
- to_hash.to_s
164
- end
165
-
166
- # to_body is an alias to to_hash (backward compatibility)
167
- # @return [Hash] Returns the object in the form of hash
168
- def to_body
169
- to_hash
170
- end
171
-
172
- # Returns the object in the form of hash
173
- # @return [Hash] Returns the object in the form of hash
174
- def to_hash
175
- hash = {}
176
- self.class.attribute_map.each_pair do |attr, param|
177
- value = self.send(attr)
178
- next if value.nil?
179
- hash[param] = _to_hash(value)
180
- end
181
- hash
182
- end
183
-
184
- # Outputs non-array value in the form of hash
185
- # For object, use to_hash. Otherwise, just return the value
186
- # @param [Object] value Any valid value
187
- # @return [Hash] Returns the value in the form of hash
188
- def _to_hash(value)
189
- if value.is_a?(Array)
190
- value.compact.map { |v| _to_hash(v) }
191
- elsif value.is_a?(Hash)
192
- {}.tap do |hash|
193
- value.each { |k, v| hash[k] = _to_hash(v) }
194
- end
195
- elsif value.respond_to? :to_hash
196
- value.to_hash
197
- else
198
- value
199
- end
200
- end
201
- end
202
- end