cybersource_rest_client 0.0.17 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/core/MerchantConfig.rb +2 -0
  3. data/lib/cybersource_rest_client.rb +81 -5
  4. data/lib/cybersource_rest_client/api/authentication_exemptions_api.rb +89 -0
  5. data/lib/cybersource_rest_client/api/payer_authentication_api.rb +154 -0
  6. data/lib/cybersource_rest_client/api/report_definitions_api.rb +9 -0
  7. data/lib/cybersource_rest_client/api/report_downloads_api.rb +3 -0
  8. data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +79 -0
  9. data/lib/cybersource_rest_client/api/reports_api.rb +2 -2
  10. data/lib/cybersource_rest_client/api_client.rb +12 -0
  11. data/lib/cybersource_rest_client/models/authentication_exemptions_request.rb +228 -0
  12. data/lib/cybersource_rest_client/models/buyer_information.rb +20 -20
  13. data/lib/cybersource_rest_client/models/check_payer_auth_enrollment_request.rb +284 -0
  14. data/lib/cybersource_rest_client/models/create_payment_instrument_request.rb +2 -41
  15. data/lib/cybersource_rest_client/models/create_report_subscription_request.rb +27 -2
  16. data/lib/cybersource_rest_client/models/embedded_instrument_identifier_request.rb +226 -0
  17. data/lib/cybersource_rest_client/models/{embedded_instrument_identifier.rb → embedded_instrument_identifier_response.rb} +11 -2
  18. data/lib/cybersource_rest_client/models/{tms_v1_instrument_identifiers_delete409_response__links_payment_instruments.rb → instrument_identifier_payment_instruments_link.rb} +1 -1
  19. data/lib/cybersource_rest_client/models/{instrument_identifier.rb → instrument_identifier_response.rb} +11 -2
  20. data/lib/cybersource_rest_client/models/issuer.rb +208 -0
  21. data/lib/cybersource_rest_client/models/links.rb +10 -1
  22. data/lib/cybersource_rest_client/models/model_409_links.rb +1 -1
  23. data/lib/cybersource_rest_client/models/payment_instrument.rb +9 -9
  24. data/lib/cybersource_rest_client/models/payment_instrument_card.rb +2 -2
  25. data/lib/cybersource_rest_client/models/payment_instrument_instrument_identifier_request.rb +246 -0
  26. data/lib/cybersource_rest_client/models/payment_instrument_self_link.rb +183 -0
  27. data/lib/cybersource_rest_client/models/payment_instruments_links.rb +183 -0
  28. data/lib/cybersource_rest_client/models/personal_identification.rb +1 -1
  29. data/lib/cybersource_rest_client/models/predefined_subscription_request_bean.rb +392 -0
  30. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +225 -0
  31. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +1 -1
  32. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information_emv.rb +2 -2
  33. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb +0 -15
  34. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +2 -2
  35. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +1 -1
  36. data/lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb +60 -0
  37. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +22 -27
  38. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +2 -2
  39. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +26 -1
  40. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +4 -4
  41. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +2 -2
  42. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
  43. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +2 -2
  44. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +1 -1
  45. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_installment_information.rb +270 -0
  46. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +2 -2
  47. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +1 -1
  48. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +2 -2
  49. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +0 -30
  50. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +2 -2
  51. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +2 -2
  52. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_payouts_options.rb +1 -1
  53. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_get200_response_report_definitions.rb +23 -4
  54. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response.rb +23 -4
  55. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response_default_settings.rb +255 -0
  56. data/lib/cybersource_rest_client/models/reporting_v3_report_subscriptions_get200_response_subscriptions.rb +27 -2
  57. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response__link.rb +183 -0
  58. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response__link_report_download.rb +192 -0
  59. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response_report_search_results.rb +13 -4
  60. data/lib/cybersource_rest_client/models/request.rb +210 -0
  61. data/lib/cybersource_rest_client/models/risk_v1_authentication_excemptions_post400_response.rb +225 -0
  62. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_consumer_authentication_information_strong_authentication.rb +269 -0
  63. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response.rb +255 -0
  64. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_consumer_authentication_information.rb +183 -0
  65. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_risk_information.rb +199 -0
  66. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response.rb +285 -0
  67. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response_consumer_authentication_information.rb +324 -0
  68. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response.rb +294 -0
  69. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_consumer_authentication_information.rb +444 -0
  70. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information.rb +183 -0
  71. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information_amount_details.rb +199 -0
  72. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_acquirer_information.rb +199 -0
  73. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_device_information.rb +183 -0
  74. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_merchant_information.rb +258 -0
  75. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_merchant_information_merchant_descriptor.rb +229 -0
  76. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information.rb +212 -0
  77. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_bill_to.rb +496 -0
  78. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_line_items.rb +283 -0
  79. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_ship_to.rb +399 -0
  80. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information.rb +192 -0
  81. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information_card.rb +325 -0
  82. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information_tokenized_card.rb +291 -0
  83. data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +524 -0
  84. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information.rb +194 -0
  85. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information_line_items.rb +267 -0
  86. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information.rb +192 -0
  87. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +298 -0
  88. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +264 -0
  89. data/lib/cybersource_rest_client/models/riskv1authentications_acquirer_information.rb +274 -0
  90. data/lib/cybersource_rest_client/models/riskv1authentications_buyer_information.rb +196 -0
  91. data/lib/cybersource_rest_client/models/riskv1authentications_client_reference_information.rb +208 -0
  92. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information.rb +1359 -0
  93. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information_ivr.rb +319 -0
  94. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information_strong_authentication.rb +199 -0
  95. data/lib/cybersource_rest_client/models/riskv1authentications_device_information.rb +430 -0
  96. data/lib/cybersource_rest_client/models/riskv1authentications_device_information_raw_data.rb +209 -0
  97. data/lib/cybersource_rest_client/models/riskv1authentications_merchant_information.rb +208 -0
  98. data/lib/cybersource_rest_client/models/{tss_v2_transactions_get200_response_payment_information_payment_type_funding_source.rb → riskv1authentications_merchant_information_merchant_descriptor.rb} +25 -40
  99. data/lib/cybersource_rest_client/models/riskv1authentications_order_information.rb +283 -0
  100. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_line_items.rb +396 -0
  101. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_ship_to.rb +459 -0
  102. data/lib/cybersource_rest_client/models/riskv1authentications_recurring_payment_information.rb +235 -0
  103. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information.rb +183 -0
  104. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history.rb +262 -0
  105. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_account_history.rb +209 -0
  106. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_customer_account.rb +279 -0
  107. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information.rb +206 -0
  108. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_legs.rb +259 -0
  109. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_passengers.rb +224 -0
  110. data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +26 -1
  111. data/lib/cybersource_rest_client/models/riskv1decisions_order_information.rb +13 -4
  112. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_address.rb +325 -0
  113. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_bill_to.rb +26 -1
  114. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information.rb +13 -4
  115. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_bank.rb +275 -0
  116. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +2 -2
  117. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
  118. data/lib/cybersource_rest_client/models/riskv1decisions_risk_information.rb +13 -4
  119. data/lib/cybersource_rest_client/models/riskv1decisions_risk_information_marking_details.rb +275 -0
  120. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_delete409_response__links.rb +1 -1
  121. data/lib/cybersource_rest_client/models/{tms_v1_instrument_identifiers_payment_instruments_get200_response_instrument_identifier.rb → tms_v1_instrument_identifiers_payment_instruments_embedded_instrument_identifier.rb} +11 -2
  122. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__embedded.rb +183 -0
  123. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__links.rb +183 -0
  124. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__links_self.rb +183 -0
  125. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_buyer_information.rb +20 -20
  126. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_card.rb +2 -2
  127. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_payment_instruments.rb +9 -9
  128. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_personal_identification.rb +1 -1
  129. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response.rb +10 -1
  130. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response__links.rb +10 -1
  131. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response__links_payment_instruments.rb +183 -0
  132. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response_issuer.rb +208 -0
  133. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_card.rb +1 -1
  134. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_instrument_identifier.rb +226 -0
  135. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_application_information_applications.rb +1 -1
  136. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_client_reference_information.rb +3 -3
  137. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +1 -1
  138. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +12 -31
  139. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +1 -1
  140. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_client_reference_information.rb +2 -2
  141. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +1 -1
  142. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_payment_type.rb +9 -9
  143. data/lib/cybersource_rest_client/models/update_payment_instrument_request.rb +2 -41
  144. data/lib/cybersource_rest_client/utilities/flex/token_verification.rb +42 -0
  145. metadata +79 -7
@@ -0,0 +1,224 @@
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 Riskv1authenticationsTravelInformationPassengers
17
+ # First name of the passenger to whom the ticket was issued. If there are multiple passengers, include all listed on the ticket. Do not include special characters such as commas, hyphens, or apostrophes. Only ASCII characters are supported. Required for American Express SafeKey (U.S.) for travel-related requests.
18
+ attr_accessor :first_name
19
+
20
+ # Last name of the passenger to whom the ticket was issued. If there are multiple passengers, include all listed on the ticket. Do not include special characters such as commas, hyphens, or apostrophes. Only ASCII characters are supported. Required for American Express SafeKey (U.S.) for travel-related requests.
21
+ attr_accessor :last_name
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'first_name' => :'firstName',
27
+ :'last_name' => :'lastName'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'first_name' => :'String',
35
+ :'last_name' => :'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?(:'firstName')
48
+ self.first_name = attributes[:'firstName']
49
+ end
50
+
51
+ if attributes.has_key?(:'lastName')
52
+ self.last_name = attributes[:'lastName']
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 !@first_name.nil? && @first_name.to_s.length > 60
61
+ invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 60.')
62
+ end
63
+
64
+ if !@last_name.nil? && @last_name.to_s.length > 60
65
+ invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 60.')
66
+ end
67
+
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ return false if !@first_name.nil? && @first_name.to_s.length > 60
75
+ return false if !@last_name.nil? && @last_name.to_s.length > 60
76
+ true
77
+ end
78
+
79
+ # Custom attribute writer method with validation
80
+ # @param [Object] first_name Value to be assigned
81
+ def first_name=(first_name)
82
+ if !first_name.nil? && first_name.to_s.length > 60
83
+ fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 60.'
84
+ end
85
+
86
+ @first_name = first_name
87
+ end
88
+
89
+ # Custom attribute writer method with validation
90
+ # @param [Object] last_name Value to be assigned
91
+ def last_name=(last_name)
92
+ if !last_name.nil? && last_name.to_s.length > 60
93
+ fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 60.'
94
+ end
95
+
96
+ @last_name = last_name
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
+ first_name == o.first_name &&
105
+ last_name == o.last_name
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Fixnum] Hash code
116
+ def hash
117
+ [first_name, last_name].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.swagger_types.each_pair do |key, type|
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :BOOLEAN
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ temp_model = CyberSource.const_get(type).new
178
+ temp_model.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ next if value.nil?
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end
@@ -20,6 +20,9 @@ module CyberSource
20
20
  # IP address of the customer.
21
21
  attr_accessor :ip_address
22
22
 
23
+ # Network IP address of the customer (for example, 10.1.27). A network IP address includes up to 256 IP addresses.
24
+ attr_accessor :network_ip_address
25
+
23
26
  # DNS resolved hostname from `ipAddress`.
24
27
  attr_accessor :host_name
25
28
 
@@ -37,6 +40,7 @@ module CyberSource
37
40
  {
38
41
  :'cookies_accepted' => :'cookiesAccepted',
39
42
  :'ip_address' => :'ipAddress',
43
+ :'network_ip_address' => :'networkIpAddress',
40
44
  :'host_name' => :'hostName',
41
45
  :'fingerprint_session_id' => :'fingerprintSessionId',
42
46
  :'http_browser_email' => :'httpBrowserEmail',
@@ -49,6 +53,7 @@ module CyberSource
49
53
  {
50
54
  :'cookies_accepted' => :'String',
51
55
  :'ip_address' => :'String',
56
+ :'network_ip_address' => :'String',
52
57
  :'host_name' => :'String',
53
58
  :'fingerprint_session_id' => :'String',
54
59
  :'http_browser_email' => :'String',
@@ -72,6 +77,10 @@ module CyberSource
72
77
  self.ip_address = attributes[:'ipAddress']
73
78
  end
74
79
 
80
+ if attributes.has_key?(:'networkIpAddress')
81
+ self.network_ip_address = attributes[:'networkIpAddress']
82
+ end
83
+
75
84
  if attributes.has_key?(:'hostName')
76
85
  self.host_name = attributes[:'hostName']
77
86
  end
@@ -97,6 +106,10 @@ module CyberSource
97
106
  invalid_properties.push('invalid value for "ip_address", the character length must be smaller than or equal to 48.')
98
107
  end
99
108
 
109
+ if !@network_ip_address.nil? && @network_ip_address.to_s.length > 11
110
+ invalid_properties.push('invalid value for "network_ip_address", the character length must be smaller than or equal to 11.')
111
+ end
112
+
100
113
  if !@host_name.nil? && @host_name.to_s.length > 60
101
114
  invalid_properties.push('invalid value for "host_name", the character length must be smaller than or equal to 60.')
102
115
  end
@@ -112,6 +125,7 @@ module CyberSource
112
125
  # @return true if the model is valid
113
126
  def valid?
114
127
  return false if !@ip_address.nil? && @ip_address.to_s.length > 48
128
+ return false if !@network_ip_address.nil? && @network_ip_address.to_s.length > 11
115
129
  return false if !@host_name.nil? && @host_name.to_s.length > 60
116
130
  return false if !@user_agent.nil? && @user_agent.to_s.length > 40
117
131
  true
@@ -127,6 +141,16 @@ module CyberSource
127
141
  @ip_address = ip_address
128
142
  end
129
143
 
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] network_ip_address Value to be assigned
146
+ def network_ip_address=(network_ip_address)
147
+ if !network_ip_address.nil? && network_ip_address.to_s.length > 11
148
+ fail ArgumentError, 'invalid value for "network_ip_address", the character length must be smaller than or equal to 11.'
149
+ end
150
+
151
+ @network_ip_address = network_ip_address
152
+ end
153
+
130
154
  # Custom attribute writer method with validation
131
155
  # @param [Object] host_name Value to be assigned
132
156
  def host_name=(host_name)
@@ -154,6 +178,7 @@ module CyberSource
154
178
  self.class == o.class &&
155
179
  cookies_accepted == o.cookies_accepted &&
156
180
  ip_address == o.ip_address &&
181
+ network_ip_address == o.network_ip_address &&
157
182
  host_name == o.host_name &&
158
183
  fingerprint_session_id == o.fingerprint_session_id &&
159
184
  http_browser_email == o.http_browser_email &&
@@ -169,7 +194,7 @@ module CyberSource
169
194
  # Calculates hash code according to all attributes.
170
195
  # @return [Fixnum] Hash code
171
196
  def hash
172
- [cookies_accepted, ip_address, host_name, fingerprint_session_id, http_browser_email, user_agent].hash
197
+ [cookies_accepted, ip_address, network_ip_address, host_name, fingerprint_session_id, http_browser_email, user_agent].hash
173
198
  end
174
199
 
175
200
  # Builds the object from hash
@@ -29,6 +29,8 @@ module CyberSource
29
29
 
30
30
  attr_accessor :bill_to
31
31
 
32
+ attr_accessor :address
33
+
32
34
  # Attribute mapping from ruby-style variable name to JSON key.
33
35
  def self.attribute_map
34
36
  {
@@ -37,7 +39,8 @@ module CyberSource
37
39
  :'ship_to' => :'shipTo',
38
40
  :'returns_accepted' => :'returnsAccepted',
39
41
  :'line_items' => :'lineItems',
40
- :'bill_to' => :'billTo'
42
+ :'bill_to' => :'billTo',
43
+ :'address' => :'address'
41
44
  }
42
45
  end
43
46
 
@@ -49,7 +52,8 @@ module CyberSource
49
52
  :'ship_to' => :'Riskv1decisionsOrderInformationShipTo',
50
53
  :'returns_accepted' => :'BOOLEAN',
51
54
  :'line_items' => :'Array<Riskv1decisionsOrderInformationLineItems>',
52
- :'bill_to' => :'Riskv1decisionsOrderInformationBillTo'
55
+ :'bill_to' => :'Riskv1decisionsOrderInformationBillTo',
56
+ :'address' => :'Riskv1decisionsOrderInformationAddress'
53
57
  }
54
58
  end
55
59
 
@@ -86,6 +90,10 @@ module CyberSource
86
90
  if attributes.has_key?(:'billTo')
87
91
  self.bill_to = attributes[:'billTo']
88
92
  end
93
+
94
+ if attributes.has_key?(:'address')
95
+ self.address = attributes[:'address']
96
+ end
89
97
  end
90
98
 
91
99
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,7 +119,8 @@ module CyberSource
111
119
  ship_to == o.ship_to &&
112
120
  returns_accepted == o.returns_accepted &&
113
121
  line_items == o.line_items &&
114
- bill_to == o.bill_to
122
+ bill_to == o.bill_to &&
123
+ address == o.address
115
124
  end
116
125
 
117
126
  # @see the `==` method
@@ -123,7 +132,7 @@ module CyberSource
123
132
  # Calculates hash code according to all attributes.
124
133
  # @return [Fixnum] Hash code
125
134
  def hash
126
- [amount_details, shipping_details, ship_to, returns_accepted, line_items, bill_to].hash
135
+ [amount_details, shipping_details, ship_to, returns_accepted, line_items, bill_to, address].hash
127
136
  end
128
137
 
129
138
  # Builds the object from hash
@@ -0,0 +1,325 @@
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
+ # Contains address information related to the order
17
+ class Riskv1decisionsOrderInformationAddress
18
+ # First line of the street address
19
+ attr_accessor :address1
20
+
21
+ # Second line of the street address
22
+ attr_accessor :address2
23
+
24
+ # City of the street address. Required when adding the address to a list.
25
+ attr_accessor :locality
26
+
27
+ # Country of the street address. Use the two-character codes located in the Support Center. Required if address1 is present.
28
+ attr_accessor :country
29
+
30
+ # State, province, or territory of the street address. Use the two-character codes located in the Support Center.
31
+ attr_accessor :administrative_area
32
+
33
+ # Postal code of the street address. Required when adding the address to a list.
34
+ attr_accessor :postal_code
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'address1' => :'address1',
40
+ :'address2' => :'address2',
41
+ :'locality' => :'locality',
42
+ :'country' => :'country',
43
+ :'administrative_area' => :'administrativeArea',
44
+ :'postal_code' => :'postalCode'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'address1' => :'String',
52
+ :'address2' => :'String',
53
+ :'locality' => :'String',
54
+ :'country' => :'String',
55
+ :'administrative_area' => :'String',
56
+ :'postal_code' => :'String'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ return unless attributes.is_a?(Hash)
64
+
65
+ # convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
67
+
68
+ if attributes.has_key?(:'address1')
69
+ self.address1 = attributes[:'address1']
70
+ end
71
+
72
+ if attributes.has_key?(:'address2')
73
+ self.address2 = attributes[:'address2']
74
+ end
75
+
76
+ if attributes.has_key?(:'locality')
77
+ self.locality = attributes[:'locality']
78
+ end
79
+
80
+ if attributes.has_key?(:'country')
81
+ self.country = attributes[:'country']
82
+ end
83
+
84
+ if attributes.has_key?(:'administrativeArea')
85
+ self.administrative_area = attributes[:'administrativeArea']
86
+ end
87
+
88
+ if attributes.has_key?(:'postalCode')
89
+ self.postal_code = attributes[:'postalCode']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ if !@address1.nil? && @address1.to_s.length > 60
98
+ invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 60.')
99
+ end
100
+
101
+ if !@address2.nil? && @address2.to_s.length > 60
102
+ invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 60.')
103
+ end
104
+
105
+ if !@locality.nil? && @locality.to_s.length > 50
106
+ invalid_properties.push('invalid value for "locality", the character length must be smaller than or equal to 50.')
107
+ end
108
+
109
+ if !@country.nil? && @country.to_s.length > 2
110
+ invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 2.')
111
+ end
112
+
113
+ if !@administrative_area.nil? && @administrative_area.to_s.length > 2
114
+ invalid_properties.push('invalid value for "administrative_area", the character length must be smaller than or equal to 2.')
115
+ end
116
+
117
+ if !@postal_code.nil? && @postal_code.to_s.length > 10
118
+ invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 10.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ return false if !@address1.nil? && @address1.to_s.length > 60
128
+ return false if !@address2.nil? && @address2.to_s.length > 60
129
+ return false if !@locality.nil? && @locality.to_s.length > 50
130
+ return false if !@country.nil? && @country.to_s.length > 2
131
+ return false if !@administrative_area.nil? && @administrative_area.to_s.length > 2
132
+ return false if !@postal_code.nil? && @postal_code.to_s.length > 10
133
+ true
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] address1 Value to be assigned
138
+ def address1=(address1)
139
+ if !address1.nil? && address1.to_s.length > 60
140
+ fail ArgumentError, 'invalid value for "address1", the character length must be smaller than or equal to 60.'
141
+ end
142
+
143
+ @address1 = address1
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] address2 Value to be assigned
148
+ def address2=(address2)
149
+ if !address2.nil? && address2.to_s.length > 60
150
+ fail ArgumentError, 'invalid value for "address2", the character length must be smaller than or equal to 60.'
151
+ end
152
+
153
+ @address2 = address2
154
+ end
155
+
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] locality Value to be assigned
158
+ def locality=(locality)
159
+ if !locality.nil? && locality.to_s.length > 50
160
+ fail ArgumentError, 'invalid value for "locality", the character length must be smaller than or equal to 50.'
161
+ end
162
+
163
+ @locality = locality
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] country Value to be assigned
168
+ def country=(country)
169
+ if !country.nil? && country.to_s.length > 2
170
+ fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 2.'
171
+ end
172
+
173
+ @country = country
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] administrative_area Value to be assigned
178
+ def administrative_area=(administrative_area)
179
+ if !administrative_area.nil? && administrative_area.to_s.length > 2
180
+ fail ArgumentError, 'invalid value for "administrative_area", the character length must be smaller than or equal to 2.'
181
+ end
182
+
183
+ @administrative_area = administrative_area
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] postal_code Value to be assigned
188
+ def postal_code=(postal_code)
189
+ if !postal_code.nil? && postal_code.to_s.length > 10
190
+ fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 10.'
191
+ end
192
+
193
+ @postal_code = postal_code
194
+ end
195
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ address1 == o.address1 &&
202
+ address2 == o.address2 &&
203
+ locality == o.locality &&
204
+ country == o.country &&
205
+ administrative_area == o.administrative_area &&
206
+ postal_code == o.postal_code
207
+ end
208
+
209
+ # @see the `==` method
210
+ # @param [Object] Object to be compared
211
+ def eql?(o)
212
+ self == o
213
+ end
214
+
215
+ # Calculates hash code according to all attributes.
216
+ # @return [Fixnum] Hash code
217
+ def hash
218
+ [address1, address2, locality, country, administrative_area, postal_code].hash
219
+ end
220
+
221
+ # Builds the object from hash
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ # @return [Object] Returns the model itself
224
+ def build_from_hash(attributes)
225
+ return nil unless attributes.is_a?(Hash)
226
+ self.class.swagger_types.each_pair do |key, type|
227
+ if type =~ /\AArray<(.*)>/i
228
+ # check to ensure the input is an array given that the the attribute
229
+ # is documented as an array but the input is not
230
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
231
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
232
+ end
233
+ elsif !attributes[self.class.attribute_map[key]].nil?
234
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
235
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
236
+ end
237
+
238
+ self
239
+ end
240
+
241
+ # Deserializes the data based on type
242
+ # @param string type Data type
243
+ # @param string value Value to be deserialized
244
+ # @return [Object] Deserialized data
245
+ def _deserialize(type, value)
246
+ case type.to_sym
247
+ when :DateTime
248
+ DateTime.parse(value)
249
+ when :Date
250
+ Date.parse(value)
251
+ when :String
252
+ value.to_s
253
+ when :Integer
254
+ value.to_i
255
+ when :Float
256
+ value.to_f
257
+ when :BOOLEAN
258
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
259
+ true
260
+ else
261
+ false
262
+ end
263
+ when :Object
264
+ # generic object (usually a Hash), return directly
265
+ value
266
+ when /\AArray<(?<inner_type>.+)>\z/
267
+ inner_type = Regexp.last_match[:inner_type]
268
+ value.map { |v| _deserialize(inner_type, v) }
269
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
270
+ k_type = Regexp.last_match[:k_type]
271
+ v_type = Regexp.last_match[:v_type]
272
+ {}.tap do |hash|
273
+ value.each do |k, v|
274
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
275
+ end
276
+ end
277
+ else # model
278
+ temp_model = CyberSource.const_get(type).new
279
+ temp_model.build_from_hash(value)
280
+ end
281
+ end
282
+
283
+ # Returns the string representation of the object
284
+ # @return [String] String presentation of the object
285
+ def to_s
286
+ to_hash.to_s
287
+ end
288
+
289
+ # to_body is an alias to to_hash (backward compatibility)
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_body
292
+ to_hash
293
+ end
294
+
295
+ # Returns the object in the form of hash
296
+ # @return [Hash] Returns the object in the form of hash
297
+ def to_hash
298
+ hash = {}
299
+ self.class.attribute_map.each_pair do |attr, param|
300
+ value = self.send(attr)
301
+ next if value.nil?
302
+ hash[param] = _to_hash(value)
303
+ end
304
+ hash
305
+ end
306
+
307
+ # Outputs non-array value in the form of hash
308
+ # For object, use to_hash. Otherwise, just return the value
309
+ # @param [Object] value Any valid value
310
+ # @return [Hash] Returns the value in the form of hash
311
+ def _to_hash(value)
312
+ if value.is_a?(Array)
313
+ value.compact.map { |v| _to_hash(v) }
314
+ elsif value.is_a?(Hash)
315
+ {}.tap do |hash|
316
+ value.each { |k, v| hash[k] = _to_hash(v) }
317
+ end
318
+ elsif value.respond_to? :to_hash
319
+ value.to_hash
320
+ else
321
+ value
322
+ end
323
+ end
324
+ end
325
+ end