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,244 +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 FileDetail
17
- # Unique identifier of a file
18
- attr_accessor :file_id
19
-
20
- # Name of the file
21
- attr_accessor :name
22
-
23
- # Date and time for the file in PST
24
- attr_accessor :created_time
25
-
26
- # Date and time for the file in PST
27
- attr_accessor :last_modified_time
28
-
29
- # Date and time for the file in PST
30
- attr_accessor :date
31
-
32
- # 'File extension' Valid values: - 'application/xml' - 'text/csv' - 'application/pdf' - 'application/octet-stream'
33
- attr_accessor :mime_type
34
-
35
- # Size of the file in bytes
36
- attr_accessor :size
37
-
38
- # Attribute mapping from ruby-style variable name to JSON key.
39
- def self.attribute_map
40
- {
41
- :'file_id' => :'fileId',
42
- :'name' => :'name',
43
- :'created_time' => :'createdTime',
44
- :'last_modified_time' => :'lastModifiedTime',
45
- :'date' => :'date',
46
- :'mime_type' => :'mimeType',
47
- :'size' => :'size'
48
- }
49
- end
50
-
51
- # Attribute type mapping.
52
- def self.swagger_types
53
- {
54
- :'file_id' => :'String',
55
- :'name' => :'String',
56
- :'created_time' => :'DateTime',
57
- :'last_modified_time' => :'DateTime',
58
- :'date' => :'Date',
59
- :'mime_type' => :'String',
60
- :'size' => :'Integer'
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?(:'fileId')
73
- self.file_id = attributes[:'fileId']
74
- end
75
-
76
- if attributes.has_key?(:'name')
77
- self.name = attributes[:'name']
78
- end
79
-
80
- if attributes.has_key?(:'createdTime')
81
- self.created_time = attributes[:'createdTime']
82
- end
83
-
84
- if attributes.has_key?(:'lastModifiedTime')
85
- self.last_modified_time = attributes[:'lastModifiedTime']
86
- end
87
-
88
- if attributes.has_key?(:'date')
89
- self.date = attributes[:'date']
90
- end
91
-
92
- if attributes.has_key?(:'mimeType')
93
- self.mime_type = attributes[:'mimeType']
94
- end
95
-
96
- if attributes.has_key?(:'size')
97
- self.size = attributes[:'size']
98
- end
99
- end
100
-
101
- # Show invalid properties with the reasons. Usually used together with valid?
102
- # @return Array for valid properties with the reasons
103
- def list_invalid_properties
104
- invalid_properties = Array.new
105
- invalid_properties
106
- end
107
-
108
- # Check to see if the all the properties in the model are valid
109
- # @return true if the model is valid
110
- def valid?
111
- true
112
- end
113
-
114
- # Checks equality by comparing each attribute.
115
- # @param [Object] Object to be compared
116
- def ==(o)
117
- return true if self.equal?(o)
118
- self.class == o.class &&
119
- file_id == o.file_id &&
120
- name == o.name &&
121
- created_time == o.created_time &&
122
- last_modified_time == o.last_modified_time &&
123
- date == o.date &&
124
- mime_type == o.mime_type &&
125
- size == o.size
126
- end
127
-
128
- # @see the `==` method
129
- # @param [Object] Object to be compared
130
- def eql?(o)
131
- self == o
132
- end
133
-
134
- # Calculates hash code according to all attributes.
135
- # @return [Fixnum] Hash code
136
- def hash
137
- [file_id, name, created_time, last_modified_time, date, mime_type, size].hash
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
- return nil unless attributes.is_a?(Hash)
145
- self.class.swagger_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
147
- # check to ensure the input is an array given that the the attribute
148
- # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
- end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- end # or else data not found in attributes(hash), not an issue as the data can be optional
155
- end
156
-
157
- self
158
- end
159
-
160
- # Deserializes the data based on type
161
- # @param string type Data type
162
- # @param string value Value to be deserialized
163
- # @return [Object] Deserialized data
164
- def _deserialize(type, value)
165
- case type.to_sym
166
- when :DateTime
167
- DateTime.parse(value)
168
- when :Date
169
- Date.parse(value)
170
- when :String
171
- value.to_s
172
- when :Integer
173
- value.to_i
174
- when :Float
175
- value.to_f
176
- when :BOOLEAN
177
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
- true
179
- else
180
- false
181
- end
182
- when :Object
183
- # generic object (usually a Hash), return directly
184
- value
185
- when /\AArray<(?<inner_type>.+)>\z/
186
- inner_type = Regexp.last_match[:inner_type]
187
- value.map { |v| _deserialize(inner_type, v) }
188
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
- k_type = Regexp.last_match[:k_type]
190
- v_type = Regexp.last_match[:v_type]
191
- {}.tap do |hash|
192
- value.each do |k, v|
193
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
- end
195
- end
196
- else # model
197
- temp_model = CyberSource.const_get(type).new
198
- temp_model.build_from_hash(value)
199
- end
200
- end
201
-
202
- # Returns the string representation of the object
203
- # @return [String] String presentation of the object
204
- def to_s
205
- to_hash.to_s
206
- end
207
-
208
- # to_body is an alias to to_hash (backward compatibility)
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_body
211
- to_hash
212
- end
213
-
214
- # Returns the object in the form of hash
215
- # @return [Hash] Returns the object in the form of hash
216
- def to_hash
217
- hash = {}
218
- self.class.attribute_map.each_pair do |attr, param|
219
- value = self.send(attr)
220
- next if value.nil?
221
- hash[param] = _to_hash(value)
222
- end
223
- hash
224
- end
225
-
226
- # Outputs non-array value in the form of hash
227
- # For object, use to_hash. Otherwise, just return the value
228
- # @param [Object] value Any valid value
229
- # @return [Hash] Returns the value in the form of hash
230
- def _to_hash(value)
231
- if value.is_a?(Array)
232
- value.compact.map { |v| _to_hash(v) }
233
- elsif value.is_a?(Hash)
234
- {}.tap do |hash|
235
- value.each { |k, v| hash[k] = _to_hash(v) }
236
- end
237
- elsif value.respond_to? :to_hash
238
- value.to_hash
239
- else
240
- value
241
- end
242
- end
243
- end
244
- end
@@ -1,194 +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 FileDetailsResponse
17
- attr_accessor :file_details
18
-
19
- attr_accessor :_links
20
-
21
- # Attribute mapping from ruby-style variable name to JSON key.
22
- def self.attribute_map
23
- {
24
- :'file_details' => :'fileDetails',
25
- :'_links' => :'_links'
26
- }
27
- end
28
-
29
- # Attribute type mapping.
30
- def self.swagger_types
31
- {
32
- :'file_details' => :'Array<V1FileDetailsGet200ResponseFileDetails>',
33
- :'_links' => :'V1FileDetailsGet200ResponseLinks'
34
- }
35
- end
36
-
37
- # Initializes the object
38
- # @param [Hash] attributes Model attributes in the form of hash
39
- def initialize(attributes = {})
40
- return unless attributes.is_a?(Hash)
41
-
42
- # convert string to symbol for hash key
43
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
-
45
- if attributes.has_key?(:'fileDetails')
46
- if (value = attributes[:'fileDetails']).is_a?(Array)
47
- self.file_details = value
48
- end
49
- end
50
-
51
- if attributes.has_key?(:'_links')
52
- self._links = attributes[:'_links']
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
- invalid_properties
61
- end
62
-
63
- # Check to see if the all the properties in the model are valid
64
- # @return true if the model is valid
65
- def valid?
66
- true
67
- end
68
-
69
- # Checks equality by comparing each attribute.
70
- # @param [Object] Object to be compared
71
- def ==(o)
72
- return true if self.equal?(o)
73
- self.class == o.class &&
74
- file_details == o.file_details &&
75
- _links == o._links
76
- end
77
-
78
- # @see the `==` method
79
- # @param [Object] Object to be compared
80
- def eql?(o)
81
- self == o
82
- end
83
-
84
- # Calculates hash code according to all attributes.
85
- # @return [Fixnum] Hash code
86
- def hash
87
- [file_details, _links].hash
88
- end
89
-
90
- # Builds the object from hash
91
- # @param [Hash] attributes Model attributes in the form of hash
92
- # @return [Object] Returns the model itself
93
- def build_from_hash(attributes)
94
- return nil unless attributes.is_a?(Hash)
95
- self.class.swagger_types.each_pair do |key, type|
96
- if type =~ /\AArray<(.*)>/i
97
- # check to ensure the input is an array given that the the attribute
98
- # is documented as an array but the input is not
99
- if attributes[self.class.attribute_map[key]].is_a?(Array)
100
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
- end
102
- elsif !attributes[self.class.attribute_map[key]].nil?
103
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
- end # or else data not found in attributes(hash), not an issue as the data can be optional
105
- end
106
-
107
- self
108
- end
109
-
110
- # Deserializes the data based on type
111
- # @param string type Data type
112
- # @param string value Value to be deserialized
113
- # @return [Object] Deserialized data
114
- def _deserialize(type, value)
115
- case type.to_sym
116
- when :DateTime
117
- DateTime.parse(value)
118
- when :Date
119
- Date.parse(value)
120
- when :String
121
- value.to_s
122
- when :Integer
123
- value.to_i
124
- when :Float
125
- value.to_f
126
- when :BOOLEAN
127
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
- true
129
- else
130
- false
131
- end
132
- when :Object
133
- # generic object (usually a Hash), return directly
134
- value
135
- when /\AArray<(?<inner_type>.+)>\z/
136
- inner_type = Regexp.last_match[:inner_type]
137
- value.map { |v| _deserialize(inner_type, v) }
138
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
- k_type = Regexp.last_match[:k_type]
140
- v_type = Regexp.last_match[:v_type]
141
- {}.tap do |hash|
142
- value.each do |k, v|
143
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
- end
145
- end
146
- else # model
147
- temp_model = CyberSource.const_get(type).new
148
- temp_model.build_from_hash(value)
149
- end
150
- end
151
-
152
- # Returns the string representation of the object
153
- # @return [String] String presentation of the object
154
- def to_s
155
- to_hash.to_s
156
- end
157
-
158
- # to_body is an alias to to_hash (backward compatibility)
159
- # @return [Hash] Returns the object in the form of hash
160
- def to_body
161
- to_hash
162
- end
163
-
164
- # Returns the object in the form of hash
165
- # @return [Hash] Returns the object in the form of hash
166
- def to_hash
167
- hash = {}
168
- self.class.attribute_map.each_pair do |attr, param|
169
- value = self.send(attr)
170
- next if value.nil?
171
- hash[param] = _to_hash(value)
172
- end
173
- hash
174
- end
175
-
176
- # Outputs non-array value in the form of hash
177
- # For object, use to_hash. Otherwise, just return the value
178
- # @param [Object] value Any valid value
179
- # @return [Hash] Returns the value in the form of hash
180
- def _to_hash(value)
181
- if value.is_a?(Array)
182
- value.compact.map { |v| _to_hash(v) }
183
- elsif value.is_a?(Hash)
184
- {}.tap do |hash|
185
- value.each { |k, v| hash[k] = _to_hash(v) }
186
- end
187
- elsif value.respond_to? :to_hash
188
- value.to_hash
189
- else
190
- value
191
- end
192
- end
193
- end
194
- end
@@ -1,286 +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 InstrumentIdentifier
17
- attr_accessor :_links
18
-
19
- # The id of the Instrument Identifier Token.
20
- attr_accessor :id
21
-
22
- # The type of token. Valid values: - instrumentIdentifier
23
- attr_accessor :object
24
-
25
- # Issuers state for the card number. Valid values: - ACTIVE - CLOSED : The account has been closed.
26
- attr_accessor :state
27
-
28
- # The type of Instrument Identifier. Valid values: - enrollable card
29
- attr_accessor :type
30
-
31
- attr_accessor :card
32
-
33
- attr_accessor :bank_account
34
-
35
- attr_accessor :tokenized_card
36
-
37
- attr_accessor :issuer
38
-
39
- attr_accessor :processing_information
40
-
41
- attr_accessor :bill_to
42
-
43
- attr_accessor :metadata
44
-
45
- # Attribute mapping from ruby-style variable name to JSON key.
46
- def self.attribute_map
47
- {
48
- :'_links' => :'_links',
49
- :'id' => :'id',
50
- :'object' => :'object',
51
- :'state' => :'state',
52
- :'type' => :'type',
53
- :'card' => :'card',
54
- :'bank_account' => :'bankAccount',
55
- :'tokenized_card' => :'tokenizedCard',
56
- :'issuer' => :'issuer',
57
- :'processing_information' => :'processingInformation',
58
- :'bill_to' => :'billTo',
59
- :'metadata' => :'metadata'
60
- }
61
- end
62
-
63
- # Attribute type mapping.
64
- def self.swagger_types
65
- {
66
- :'_links' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierLinks',
67
- :'id' => :'String',
68
- :'object' => :'String',
69
- :'state' => :'String',
70
- :'type' => :'String',
71
- :'card' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierCard',
72
- :'bank_account' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierBankAccount',
73
- :'tokenized_card' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierTokenizedCard',
74
- :'issuer' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierIssuer',
75
- :'processing_information' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformation',
76
- :'bill_to' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierBillTo',
77
- :'metadata' => :'Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierMetadata'
78
- }
79
- end
80
-
81
- # Initializes the object
82
- # @param [Hash] attributes Model attributes in the form of hash
83
- def initialize(attributes = {})
84
- return unless attributes.is_a?(Hash)
85
-
86
- # convert string to symbol for hash key
87
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
88
-
89
- if attributes.has_key?(:'_links')
90
- self._links = attributes[:'_links']
91
- end
92
-
93
- if attributes.has_key?(:'id')
94
- self.id = attributes[:'id']
95
- end
96
-
97
- if attributes.has_key?(:'object')
98
- self.object = attributes[:'object']
99
- end
100
-
101
- if attributes.has_key?(:'state')
102
- self.state = attributes[:'state']
103
- end
104
-
105
- if attributes.has_key?(:'type')
106
- self.type = attributes[:'type']
107
- end
108
-
109
- if attributes.has_key?(:'card')
110
- self.card = attributes[:'card']
111
- end
112
-
113
- if attributes.has_key?(:'bankAccount')
114
- self.bank_account = attributes[:'bankAccount']
115
- end
116
-
117
- if attributes.has_key?(:'tokenizedCard')
118
- self.tokenized_card = attributes[:'tokenizedCard']
119
- end
120
-
121
- if attributes.has_key?(:'issuer')
122
- self.issuer = attributes[:'issuer']
123
- end
124
-
125
- if attributes.has_key?(:'processingInformation')
126
- self.processing_information = attributes[:'processingInformation']
127
- end
128
-
129
- if attributes.has_key?(:'billTo')
130
- self.bill_to = attributes[:'billTo']
131
- end
132
-
133
- if attributes.has_key?(:'metadata')
134
- self.metadata = attributes[:'metadata']
135
- end
136
- end
137
-
138
- # Show invalid properties with the reasons. Usually used together with valid?
139
- # @return Array for valid properties with the reasons
140
- def list_invalid_properties
141
- invalid_properties = Array.new
142
- invalid_properties
143
- end
144
-
145
- # Check to see if the all the properties in the model are valid
146
- # @return true if the model is valid
147
- def valid?
148
- true
149
- end
150
-
151
- # Checks equality by comparing each attribute.
152
- # @param [Object] Object to be compared
153
- def ==(o)
154
- return true if self.equal?(o)
155
- self.class == o.class &&
156
- _links == o._links &&
157
- id == o.id &&
158
- object == o.object &&
159
- state == o.state &&
160
- type == o.type &&
161
- card == o.card &&
162
- bank_account == o.bank_account &&
163
- tokenized_card == o.tokenized_card &&
164
- issuer == o.issuer &&
165
- processing_information == o.processing_information &&
166
- bill_to == o.bill_to &&
167
- metadata == o.metadata
168
- end
169
-
170
- # @see the `==` method
171
- # @param [Object] Object to be compared
172
- def eql?(o)
173
- self == o
174
- end
175
-
176
- # Calculates hash code according to all attributes.
177
- # @return [Fixnum] Hash code
178
- def hash
179
- [_links, id, object, state, type, card, bank_account, tokenized_card, issuer, processing_information, bill_to, metadata].hash
180
- end
181
-
182
- # Builds the object from hash
183
- # @param [Hash] attributes Model attributes in the form of hash
184
- # @return [Object] Returns the model itself
185
- def build_from_hash(attributes)
186
- return nil unless attributes.is_a?(Hash)
187
- self.class.swagger_types.each_pair do |key, type|
188
- if type =~ /\AArray<(.*)>/i
189
- # check to ensure the input is an array given that the the attribute
190
- # is documented as an array but the input is not
191
- if attributes[self.class.attribute_map[key]].is_a?(Array)
192
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
- end
194
- elsif !attributes[self.class.attribute_map[key]].nil?
195
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
- end # or else data not found in attributes(hash), not an issue as the data can be optional
197
- end
198
-
199
- self
200
- end
201
-
202
- # Deserializes the data based on type
203
- # @param string type Data type
204
- # @param string value Value to be deserialized
205
- # @return [Object] Deserialized data
206
- def _deserialize(type, value)
207
- case type.to_sym
208
- when :DateTime
209
- DateTime.parse(value)
210
- when :Date
211
- Date.parse(value)
212
- when :String
213
- value.to_s
214
- when :Integer
215
- value.to_i
216
- when :Float
217
- value.to_f
218
- when :BOOLEAN
219
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
- true
221
- else
222
- false
223
- end
224
- when :Object
225
- # generic object (usually a Hash), return directly
226
- value
227
- when /\AArray<(?<inner_type>.+)>\z/
228
- inner_type = Regexp.last_match[:inner_type]
229
- value.map { |v| _deserialize(inner_type, v) }
230
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
- k_type = Regexp.last_match[:k_type]
232
- v_type = Regexp.last_match[:v_type]
233
- {}.tap do |hash|
234
- value.each do |k, v|
235
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
- end
237
- end
238
- else # model
239
- temp_model = CyberSource.const_get(type).new
240
- temp_model.build_from_hash(value)
241
- end
242
- end
243
-
244
- # Returns the string representation of the object
245
- # @return [String] String presentation of the object
246
- def to_s
247
- to_hash.to_s
248
- end
249
-
250
- # to_body is an alias to to_hash (backward compatibility)
251
- # @return [Hash] Returns the object in the form of hash
252
- def to_body
253
- to_hash
254
- end
255
-
256
- # Returns the object in the form of hash
257
- # @return [Hash] Returns the object in the form of hash
258
- def to_hash
259
- hash = {}
260
- self.class.attribute_map.each_pair do |attr, param|
261
- value = self.send(attr)
262
- next if value.nil?
263
- hash[param] = _to_hash(value)
264
- end
265
- hash
266
- end
267
-
268
- # Outputs non-array value in the form of hash
269
- # For object, use to_hash. Otherwise, just return the value
270
- # @param [Object] value Any valid value
271
- # @return [Hash] Returns the value in the form of hash
272
- def _to_hash(value)
273
- if value.is_a?(Array)
274
- value.compact.map { |v| _to_hash(v) }
275
- elsif value.is_a?(Hash)
276
- {}.tap do |hash|
277
- value.each { |k, v| hash[k] = _to_hash(v) }
278
- end
279
- elsif value.respond_to? :to_hash
280
- value.to_hash
281
- else
282
- value
283
- end
284
- end
285
- end
286
- end