cybersource_rest_client 0.0.48 → 0.0.49

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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/payments_api.rb +71 -0
  3. data/lib/cybersource_rest_client/api/push_funds_api.rb +131 -0
  4. data/lib/cybersource_rest_client/models/invoicingv2invoices_order_information_amount_details_tax_details.rb +2 -2
  5. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1.rb +262 -0
  6. data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_risk_information_providers_provider_name.rb → pts_v2_payments_post201_response_1_order_information.rb} +14 -19
  7. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information_bill_to.rb +344 -0
  8. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information_ship_to.rb +318 -0
  9. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information.rb +201 -0
  10. data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_risk_information_providers.rb → pts_v2_payments_post201_response_1_payment_information_bank.rb} +8 -10
  11. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information_bank_account.rb +184 -0
  12. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information_payment_type.rb +183 -0
  13. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information_payment_type_method.rb +184 -0
  14. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information.rb +238 -0
  15. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information_avs.rb +190 -0
  16. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information_seller_protection.rb +184 -0
  17. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +22 -4
  18. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_risk_information.rb +5 -2
  19. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +1 -1
  20. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_client_reference_information.rb +226 -0
  21. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_refund_amount_details.rb +17 -1
  22. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_aggregator_information.rb +215 -0
  23. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_aggregator_information_sub_merchant.rb +318 -0
  24. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_client_reference_information.rb +238 -0
  25. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_merchant_defined_information.rb +206 -0
  26. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_merchant_information.rb +225 -0
  27. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_merchant_information_merchant_descriptor.rb +270 -0
  28. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_order_information.rb +208 -0
  29. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_order_information_amount_details.rb +224 -0
  30. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_order_information_surcharge.rb +190 -0
  31. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_point_of_service_information.rb +236 -0
  32. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information.rb +297 -0
  33. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information_payouts_options.rb +206 -0
  34. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information_recurring_options.rb +184 -0
  35. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_options.rb +183 -0
  36. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_options_funding_options.rb +183 -0
  37. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_options_funding_options_initiator.rb +190 -0
  38. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information.rb +384 -0
  39. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information.rb +183 -0
  40. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card.rb +281 -0
  41. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card_customer.rb +190 -0
  42. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card_instrument_identifier.rb +190 -0
  43. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card_payment_instrument.rb +190 -0
  44. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_personal_identification.rb +206 -0
  45. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information.rb +425 -0
  46. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_account.rb +206 -0
  47. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_payment_information.rb +183 -0
  48. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_payment_information_card.rb +270 -0
  49. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_personal_identification.rb +222 -0
  50. data/lib/cybersource_rest_client/models/ptsv2payments_device_information.rb +11 -1
  51. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information.rb +17 -1
  52. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_tax_details.rb +2 -2
  53. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +30 -4
  54. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +21 -1
  55. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank.rb +20 -4
  56. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type.rb +2 -12
  57. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type_method.rb +15 -5
  58. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +12 -2
  59. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_buyer_information.rb +63 -4
  60. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_buyer_information_personal_identification.rb +190 -0
  61. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_bill_to.rb +65 -1
  62. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_client_reference_information.rb +297 -0
  63. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information.rb +2 -2
  64. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_bank.rb +14 -4
  65. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +36 -4
  66. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_e_wallet.rb +190 -0
  67. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_payment_type.rb +203 -0
  68. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_payment_type_method.rb +184 -0
  69. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information.rb +35 -4
  70. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information_refund_options.rb +184 -0
  71. data/lib/cybersource_rest_client/models/ptsv2paymentsidvoids_payment_information.rb +1 -1
  72. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_agreement_information.rb +184 -0
  73. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_client_reference_information.rb +206 -0
  74. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_payment_information.rb +192 -0
  75. data/lib/cybersource_rest_client/models/{tss_v2_transactions_post201_response__embedded_payment_information_customer.rb → ptsv2refreshpaymentstatusid_payment_information_customer.rb} +1 -1
  76. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_payment_information_payment_type.rb +193 -0
  77. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_processing_information.rb +186 -0
  78. data/lib/cybersource_rest_client/models/push_funds201_response.rb +301 -0
  79. data/lib/cybersource_rest_client/models/push_funds201_response__links.rb +210 -0
  80. data/lib/cybersource_rest_client/models/push_funds201_response__links_customer.rb +195 -0
  81. data/lib/cybersource_rest_client/models/push_funds201_response__links_instrument_identifier.rb +195 -0
  82. data/lib/cybersource_rest_client/models/push_funds201_response__links_payment_instrument.rb +195 -0
  83. data/lib/cybersource_rest_client/models/push_funds201_response__links_self.rb +195 -0
  84. data/lib/cybersource_rest_client/models/push_funds201_response_client_reference_information.rb +206 -0
  85. data/lib/cybersource_rest_client/models/push_funds201_response_error_information.rb +217 -0
  86. data/lib/cybersource_rest_client/models/push_funds201_response_error_information_details.rb +206 -0
  87. data/lib/cybersource_rest_client/models/push_funds201_response_merchant_information.rb +183 -0
  88. data/lib/cybersource_rest_client/models/push_funds201_response_merchant_information_merchant_descriptor.rb +222 -0
  89. data/lib/cybersource_rest_client/models/push_funds201_response_order_information.rb +183 -0
  90. data/lib/cybersource_rest_client/models/push_funds201_response_order_information_amount_details.rb +247 -0
  91. data/lib/cybersource_rest_client/models/push_funds201_response_processor_information.rb +264 -0
  92. data/lib/cybersource_rest_client/models/push_funds201_response_recipient_information.rb +183 -0
  93. data/lib/cybersource_rest_client/models/push_funds201_response_recipient_information_card.rb +206 -0
  94. data/lib/cybersource_rest_client/models/push_funds400_response.rb +247 -0
  95. data/lib/cybersource_rest_client/models/push_funds400_response_details.rb +194 -0
  96. data/lib/cybersource_rest_client/models/push_funds401_response.rb +226 -0
  97. data/lib/cybersource_rest_client/models/push_funds404_response.rb +226 -0
  98. data/lib/cybersource_rest_client/models/push_funds502_response.rb +236 -0
  99. data/lib/cybersource_rest_client/models/push_funds_request.rb +264 -0
  100. data/lib/cybersource_rest_client/models/refresh_payment_status_request.rb +210 -0
  101. data/lib/cybersource_rest_client/models/refund_capture_request.rb +1 -1
  102. data/lib/cybersource_rest_client/models/refund_payment_request.rb +1 -1
  103. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +1 -1
  104. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information.rb +1 -1
  105. data/lib/cybersource_rest_client.rb +77 -3
  106. metadata +79 -5
@@ -0,0 +1,226 @@
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 PushFunds404Response
17
+ # A unique identification number to identify the submitted request. It is also appended to the endpoint of the resource.
18
+ attr_accessor :id
19
+
20
+ # Time of request in UTC. Format: `YYYY-MM-DDThh:mm:ssZ` **Example** `2016-08-11T22:47:57Z` equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The `T` separates the date and the time. The `Z` indicates UTC.
21
+ attr_accessor :submit_time_utc
22
+
23
+ # The reason of the status. Possible values: - NOT_FOUND
24
+ attr_accessor :reason
25
+
26
+ # The detail message related to the status and reason listed above. Possible values: - The requested resource does not exist
27
+ attr_accessor :message
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'id' => :'id',
33
+ :'submit_time_utc' => :'submitTimeUtc',
34
+ :'reason' => :'reason',
35
+ :'message' => :'message'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'id' => :'String',
43
+ :'submit_time_utc' => :'String',
44
+ :'reason' => :'String',
45
+ :'message' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'id')
58
+ self.id = attributes[:'id']
59
+ end
60
+
61
+ if attributes.has_key?(:'submitTimeUtc')
62
+ self.submit_time_utc = attributes[:'submitTimeUtc']
63
+ end
64
+
65
+ if attributes.has_key?(:'reason')
66
+ self.reason = attributes[:'reason']
67
+ end
68
+
69
+ if attributes.has_key?(:'message')
70
+ self.message = attributes[:'message']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Custom attribute writer method with validation
88
+ # @param [Object] id Value to be assigned
89
+ def id=(id)
90
+ @id = id
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] submit_time_utc Value to be assigned
95
+ def submit_time_utc=(submit_time_utc)
96
+ @submit_time_utc = submit_time_utc
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ id == o.id &&
105
+ submit_time_utc == o.submit_time_utc &&
106
+ reason == o.reason &&
107
+ message == o.message
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Fixnum] Hash code
118
+ def hash
119
+ [id, submit_time_utc, reason, message].hash
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.swagger_types.each_pair do |key, type|
128
+ if type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :DateTime
149
+ DateTime.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :BOOLEAN
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ temp_model = CyberSource.const_get(type).new
180
+ temp_model.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ next if value.nil?
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,236 @@
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 PushFunds502Response
17
+ # A unique identification number to identify the submitted request. It is also appended to the endpoint of the resource.
18
+ attr_accessor :id
19
+
20
+ # Time of request in UTC. Format: `YYYY-MM-DDThh:mm:ssZ` **Example** `2016-08-11T22:47:57Z` equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The `T` separates the date and the time. The `Z` indicates UTC.
21
+ attr_accessor :submit_time_utc
22
+
23
+ # Possible values: - SERVER_ERROR
24
+ attr_accessor :status
25
+
26
+ # The reason of the status. Possible values: - SYSTEM_ERROR
27
+ attr_accessor :reason
28
+
29
+ # The detail message related to the status and reason listed above. Possible values: - Error - General system failure.
30
+ attr_accessor :message
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id' => :'id',
36
+ :'submit_time_utc' => :'submitTimeUtc',
37
+ :'status' => :'status',
38
+ :'reason' => :'reason',
39
+ :'message' => :'message'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'id' => :'String',
47
+ :'submit_time_utc' => :'String',
48
+ :'status' => :'String',
49
+ :'reason' => :'String',
50
+ :'message' => :'String'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
+
62
+ if attributes.has_key?(:'id')
63
+ self.id = attributes[:'id']
64
+ end
65
+
66
+ if attributes.has_key?(:'submitTimeUtc')
67
+ self.submit_time_utc = attributes[:'submitTimeUtc']
68
+ end
69
+
70
+ if attributes.has_key?(:'status')
71
+ self.status = attributes[:'status']
72
+ end
73
+
74
+ if attributes.has_key?(:'reason')
75
+ self.reason = attributes[:'reason']
76
+ end
77
+
78
+ if attributes.has_key?(:'message')
79
+ self.message = attributes[:'message']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param [Object] id Value to be assigned
98
+ def id=(id)
99
+ @id = id
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] submit_time_utc Value to be assigned
104
+ def submit_time_utc=(submit_time_utc)
105
+ @submit_time_utc = submit_time_utc
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ id == o.id &&
114
+ submit_time_utc == o.submit_time_utc &&
115
+ status == o.status &&
116
+ reason == o.reason &&
117
+ message == o.message
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [id, submit_time_utc, status, reason, message].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ temp_model = CyberSource.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ next if value.nil?
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+ end
236
+ end