cybersource_rest_client 0.0.80 → 0.0.81

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 (152) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb +17 -7
  3. data/lib/AuthenticationSDK/core/Authorization.rb +2 -2
  4. data/lib/AuthenticationSDK/core/MerchantConfig.rb +277 -23
  5. data/lib/AuthenticationSDK/util/Cache.rb +144 -8
  6. data/lib/AuthenticationSDK/util/CachedMLEKId.rb +17 -0
  7. data/lib/AuthenticationSDK/util/CertificateUtility.rb +109 -29
  8. data/lib/AuthenticationSDK/util/Constants.rb +4 -0
  9. data/lib/AuthenticationSDK/util/MLEUtility.rb +167 -11
  10. data/lib/AuthenticationSDK/util/Utility.rb +37 -1
  11. data/lib/cybersource_rest_client/api/bank_account_validation_api.rb +6 -2
  12. data/lib/cybersource_rest_client/api/batches_api.rb +24 -8
  13. data/lib/cybersource_rest_client/api/billing_agreements_api.rb +18 -6
  14. data/lib/cybersource_rest_client/api/bin_lookup_api.rb +6 -2
  15. data/lib/cybersource_rest_client/api/capture_api.rb +6 -2
  16. data/lib/cybersource_rest_client/api/chargeback_details_api.rb +6 -2
  17. data/lib/cybersource_rest_client/api/chargeback_summaries_api.rb +6 -2
  18. data/lib/cybersource_rest_client/api/conversion_details_api.rb +6 -2
  19. data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +18 -6
  20. data/lib/cybersource_rest_client/api/credit_api.rb +6 -2
  21. data/lib/cybersource_rest_client/api/customer_api.rb +24 -8
  22. data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +30 -10
  23. data/lib/cybersource_rest_client/api/customer_shipping_address_api.rb +30 -10
  24. data/lib/cybersource_rest_client/api/decision_manager_api.rb +30 -10
  25. data/lib/cybersource_rest_client/api/device_de_association_api.rb +12 -4
  26. data/lib/cybersource_rest_client/api/device_search_api.rb +12 -4
  27. data/lib/cybersource_rest_client/api/download_dtd_api.rb +6 -2
  28. data/lib/cybersource_rest_client/api/download_xsd_api.rb +6 -2
  29. data/lib/cybersource_rest_client/api/emv_tag_details_api.rb +12 -4
  30. data/lib/cybersource_rest_client/api/enrollment_api.rb +104 -0
  31. data/lib/cybersource_rest_client/api/flex_api_api.rb +6 -2
  32. data/lib/cybersource_rest_client/api/instructions_api.rb +452 -0
  33. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +36 -12
  34. data/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb +6 -2
  35. data/lib/cybersource_rest_client/api/invoice_settings_api.rb +12 -4
  36. data/lib/cybersource_rest_client/api/invoices_api.rb +42 -14
  37. data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +42 -14
  38. data/lib/cybersource_rest_client/api/merchant_boarding_api.rb +12 -4
  39. data/lib/cybersource_rest_client/api/merchant_defined_fields_api.rb +24 -8
  40. data/lib/cybersource_rest_client/api/microform_integration_api.rb +6 -2
  41. data/lib/cybersource_rest_client/api/net_fundings_api.rb +6 -2
  42. data/lib/cybersource_rest_client/api/notification_of_changes_api.rb +6 -2
  43. data/lib/cybersource_rest_client/api/offers_api.rb +12 -4
  44. data/lib/cybersource_rest_client/api/orders_api.rb +12 -4
  45. data/lib/cybersource_rest_client/api/payer_authentication_api.rb +18 -6
  46. data/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb +6 -2
  47. data/lib/cybersource_rest_client/api/payment_instrument_api.rb +24 -8
  48. data/lib/cybersource_rest_client/api/payment_links_api.rb +24 -8
  49. data/lib/cybersource_rest_client/api/payment_tokens_api.rb +6 -2
  50. data/lib/cybersource_rest_client/api/payments_api.rb +36 -12
  51. data/lib/cybersource_rest_client/api/payouts_api.rb +6 -2
  52. data/lib/cybersource_rest_client/api/plans_api.rb +48 -16
  53. data/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb +6 -2
  54. data/lib/cybersource_rest_client/api/push_funds_api.rb +6 -2
  55. data/lib/cybersource_rest_client/api/refund_api.rb +12 -4
  56. data/lib/cybersource_rest_client/api/report_definitions_api.rb +12 -4
  57. data/lib/cybersource_rest_client/api/report_downloads_api.rb +6 -2
  58. data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +30 -10
  59. data/lib/cybersource_rest_client/api/reports_api.rb +18 -6
  60. data/lib/cybersource_rest_client/api/retrieval_details_api.rb +6 -2
  61. data/lib/cybersource_rest_client/api/retrieval_summaries_api.rb +6 -2
  62. data/lib/cybersource_rest_client/api/reversal_api.rb +12 -4
  63. data/lib/cybersource_rest_client/api/search_transactions_api.rb +12 -4
  64. data/lib/cybersource_rest_client/api/secure_file_share_api.rb +12 -4
  65. data/lib/cybersource_rest_client/api/subscriptions_api.rb +48 -16
  66. data/lib/cybersource_rest_client/api/subscriptions_follow_ons_api.rb +12 -4
  67. data/lib/cybersource_rest_client/api/taxes_api.rb +12 -4
  68. data/lib/cybersource_rest_client/api/token_api.rb +12 -4
  69. data/lib/cybersource_rest_client/api/tokenize_api.rb +6 -2
  70. data/lib/cybersource_rest_client/api/tokenized_card_api.rb +24 -8
  71. data/lib/cybersource_rest_client/api/transaction_batches_api.rb +24 -8
  72. data/lib/cybersource_rest_client/api/transaction_details_api.rb +6 -2
  73. data/lib/cybersource_rest_client/api/transient_token_data_api.rb +12 -4
  74. data/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb +6 -2
  75. data/lib/cybersource_rest_client/api/user_management_api.rb +6 -2
  76. data/lib/cybersource_rest_client/api/user_management_search_api.rb +6 -2
  77. data/lib/cybersource_rest_client/api/verification_api.rb +12 -4
  78. data/lib/cybersource_rest_client/api/void_api.rb +30 -10
  79. data/lib/cybersource_rest_client/api_client.rb +20 -3
  80. data/lib/cybersource_rest_client/models/acpv1instructions_decline_threshold.rb +232 -0
  81. data/lib/cybersource_rest_client/models/acpv1instructions_mandates.rb +405 -0
  82. data/lib/cybersource_rest_client/models/acpv1instructions_recurring_payment_information.rb +191 -0
  83. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconf_processor_info_payment_instrument_verifi_results.rb +213 -0
  84. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_confirmation_data.rb +229 -0
  85. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_merchant_information.rb +258 -0
  86. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_order_information.rb +377 -0
  87. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_order_information_shipping_details.rb +206 -0
  88. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information.rb +425 -0
  89. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information_payment_instrument.rb +190 -0
  90. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_attachments.rb +258 -0
  91. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_client_reference_information.rb +215 -0
  92. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_mandate_reference_data.rb +205 -0
  93. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_merchant_information.rb +334 -0
  94. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_merchant_information_merchant_descriptor.rb +250 -0
  95. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information.rb +228 -0
  96. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_amount_detail.rb +354 -0
  97. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_items.rb +367 -0
  98. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_items_additional_info.rb +231 -0
  99. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_items_policies.rb +346 -0
  100. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_line_items.rb +190 -0
  101. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_ship_to.rb +686 -0
  102. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_payment_options.rb +217 -0
  103. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_transaction_data.rb +348 -0
  104. data/lib/cybersource_rest_client/models/acpv1tokens_assurance_data.rb +313 -0
  105. data/lib/cybersource_rest_client/models/acpv1tokens_authenticated_identities.rb +237 -0
  106. data/lib/cybersource_rest_client/models/acpv1tokens_authentication_context.rb +191 -0
  107. data/lib/cybersource_rest_client/models/acpv1tokens_bill_to.rb +400 -0
  108. data/lib/cybersource_rest_client/models/acpv1tokens_buyer_information.rb +229 -0
  109. data/lib/cybersource_rest_client/models/acpv1tokens_buyer_information_personal_identification.rb +212 -0
  110. data/lib/cybersource_rest_client/models/acpv1tokens_consent_data.rb +297 -0
  111. data/lib/cybersource_rest_client/models/acpv1tokens_consumer_identity.rb +268 -0
  112. data/lib/cybersource_rest_client/models/acpv1tokens_device_information.rb +378 -0
  113. data/lib/cybersource_rest_client/models/acpv1tokens_device_information_device_data.rb +302 -0
  114. data/lib/cybersource_rest_client/models/acpv1tokens_enrollment_reference_data.rb +207 -0
  115. data/lib/cybersource_rest_client/models/acpv1tokens_payment_information.rb +215 -0
  116. data/lib/cybersource_rest_client/models/acpv1tokens_payment_information_customer.rb +197 -0
  117. data/lib/cybersource_rest_client/models/acpv1tokens_payment_information_instrument_identifier.rb +206 -0
  118. data/lib/cybersource_rest_client/models/acpv1tokens_payment_information_payment_instrument.rb +197 -0
  119. data/lib/cybersource_rest_client/models/agentic_cancel_purchase_intent_request.rb +257 -0
  120. data/lib/cybersource_rest_client/models/agentic_card_enrollment_bad_request_response400.rb +189 -0
  121. data/lib/cybersource_rest_client/models/agentic_card_enrollment_bad_request_response400_error.rb +238 -0
  122. data/lib/cybersource_rest_client/models/agentic_card_enrollment_bad_request_response400_error_detail.rb +224 -0
  123. data/lib/cybersource_rest_client/models/agentic_card_enrollment_request.rb +325 -0
  124. data/lib/cybersource_rest_client/models/agentic_card_enrollment_response200.rb +206 -0
  125. data/lib/cybersource_rest_client/models/agentic_card_enrollment_response202.rb +219 -0
  126. data/lib/cybersource_rest_client/models/agentic_confirm_transaction_events_request.rb +247 -0
  127. data/lib/cybersource_rest_client/models/agentic_confirm_transaction_events_response202.rb +195 -0
  128. data/lib/cybersource_rest_client/models/agentic_create_purchase_intent_request.rb +327 -0
  129. data/lib/cybersource_rest_client/models/agentic_create_purchase_intent_response200.rb +222 -0
  130. data/lib/cybersource_rest_client/models/agentic_pending_purchase_intent_response202.rb +241 -0
  131. data/lib/cybersource_rest_client/models/agentic_retrieve_payment_credentials_request.rb +247 -0
  132. data/lib/cybersource_rest_client/models/agentic_retrieve_payment_credentials_response200.rb +200 -0
  133. data/lib/cybersource_rest_client/models/agentic_retrieve_payment_credentials_response200_transaction_response_complete.rb +244 -0
  134. data/lib/cybersource_rest_client/models/agentic_retrieve_payment_credentials_response200_transaction_response_with_pending_events.rb +235 -0
  135. data/lib/cybersource_rest_client/models/agentic_update_purchase_intent_request.rb +315 -0
  136. data/lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb +36 -1
  137. data/lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information_localized_names.rb +254 -0
  138. data/lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_ancillary_information.rb +22 -5
  139. data/lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_ancillary_information_service.rb +39 -5
  140. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_travel_information.rb +246 -0
  141. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_travel_information_transit.rb +189 -0
  142. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_travel_information_transit_airline.rb +889 -0
  143. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_travel_information_transit_airline_ancillary_information.rb +259 -0
  144. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_travel_information_transit_airline_ancillary_information_service.rb +213 -0
  145. data/lib/cybersource_rest_client/models/refund_capture_request.rb +1 -1
  146. data/lib/cybersource_rest_client/models/refund_payment_request.rb +1 -1
  147. data/lib/cybersource_rest_client/models/upv1capturecontexts_data.rb +4 -2
  148. data/lib/cybersource_rest_client/models/upv1capturecontexts_data_merchant_defined_information.rb +3 -2
  149. data/lib/cybersource_rest_client/utilities/jwe_utility.rb +1 -1
  150. data/lib/cybersource_rest_client.rb +64 -0
  151. metadata +68 -3
  152. /data/lib/AuthenticationSDK/util/{JWEUtility.rb → AuthJWEUtility.rb} +0 -0
@@ -0,0 +1,315 @@
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.38
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module CyberSource
15
+ class AgenticUpdatePurchaseIntentRequest
16
+ # Client Correlation Id used during the tokenization or during FIDO assertion.
17
+ attr_accessor :client_correlation_id
18
+
19
+ attr_accessor :payment_information
20
+
21
+ attr_accessor :device_information
22
+
23
+ # Assurance data.
24
+ attr_accessor :assurance_data
25
+
26
+ attr_accessor :mandates
27
+
28
+ attr_accessor :buyer_information
29
+
30
+ # Recap - A summary or condensed version of user prompts that leads to the purchase.
31
+ attr_accessor :consumer_prompt
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'client_correlation_id' => :'clientCorrelationId',
37
+ :'payment_information' => :'paymentInformation',
38
+ :'device_information' => :'deviceInformation',
39
+ :'assurance_data' => :'assuranceData',
40
+ :'mandates' => :'mandates',
41
+ :'buyer_information' => :'buyerInformation',
42
+ :'consumer_prompt' => :'consumerPrompt'
43
+ }
44
+ end
45
+
46
+ # Attribute mapping from JSON key to ruby-style variable name.
47
+ def self.json_map
48
+ {
49
+ :'client_correlation_id' => :'client_correlation_id',
50
+ :'payment_information' => :'payment_information',
51
+ :'device_information' => :'device_information',
52
+ :'assurance_data' => :'assurance_data',
53
+ :'mandates' => :'mandates',
54
+ :'buyer_information' => :'buyer_information',
55
+ :'consumer_prompt' => :'consumer_prompt'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ :'client_correlation_id' => :'String',
63
+ :'payment_information' => :'Acpv1tokensPaymentInformation',
64
+ :'device_information' => :'Acpv1tokensDeviceInformation',
65
+ :'assurance_data' => :'Array<Acpv1tokensAssuranceData>',
66
+ :'mandates' => :'Array<Acpv1instructionsMandates>',
67
+ :'buyer_information' => :'Acpv1tokensBuyerInformation',
68
+ :'consumer_prompt' => :'String'
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
79
+
80
+ if attributes.has_key?(:'clientCorrelationId')
81
+ self.client_correlation_id = attributes[:'clientCorrelationId']
82
+ end
83
+
84
+ if attributes.has_key?(:'paymentInformation')
85
+ self.payment_information = attributes[:'paymentInformation']
86
+ end
87
+
88
+ if attributes.has_key?(:'deviceInformation')
89
+ self.device_information = attributes[:'deviceInformation']
90
+ end
91
+
92
+ if attributes.has_key?(:'assuranceData')
93
+ if (value = attributes[:'assuranceData']).is_a?(Array)
94
+ self.assurance_data = value
95
+ end
96
+ end
97
+
98
+ if attributes.has_key?(:'mandates')
99
+ if (value = attributes[:'mandates']).is_a?(Array)
100
+ self.mandates = value
101
+ end
102
+ end
103
+
104
+ if attributes.has_key?(:'buyerInformation')
105
+ self.buyer_information = attributes[:'buyerInformation']
106
+ end
107
+
108
+ if attributes.has_key?(:'consumerPrompt')
109
+ self.consumer_prompt = attributes[:'consumerPrompt']
110
+ end
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ invalid_properties = Array.new
117
+ if @client_correlation_id.nil?
118
+ invalid_properties.push('invalid value for "client_correlation_id", client_correlation_id cannot be nil.')
119
+ end
120
+
121
+ #if @client_correlation_id !~ Regexp.new(/(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/)
122
+ #invalid_properties.push('invalid value for "client_correlation_id", must conform to the pattern /(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/.')
123
+ #end
124
+
125
+ if @payment_information.nil?
126
+ invalid_properties.push('invalid value for "payment_information", payment_information cannot be nil.')
127
+ end
128
+
129
+ if @device_information.nil?
130
+ invalid_properties.push('invalid value for "device_information", device_information cannot be nil.')
131
+ end
132
+
133
+ if @assurance_data.nil?
134
+ invalid_properties.push('invalid value for "assurance_data", assurance_data cannot be nil.')
135
+ end
136
+
137
+ if @mandates.nil?
138
+ invalid_properties.push('invalid value for "mandates", mandates cannot be nil.')
139
+ end
140
+
141
+ #if !@consumer_prompt.nil? && @consumer_prompt !~ Regexp.new(/(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/)
142
+ #invalid_properties.push('invalid value for "consumer_prompt", must conform to the pattern /(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/.')
143
+ #end
144
+
145
+ invalid_properties
146
+ end
147
+
148
+ # Check to see if the all the properties in the model are valid
149
+ # @return true if the model is valid
150
+ def valid?
151
+ return false if @client_correlation_id.nil?
152
+ #return false if @client_correlation_id !~ Regexp.new(/(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/)
153
+ return false if @payment_information.nil?
154
+ return false if @device_information.nil?
155
+ return false if @assurance_data.nil?
156
+ return false if @mandates.nil?
157
+ #return false if !@consumer_prompt.nil? && @consumer_prompt !~ Regexp.new(/(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/)
158
+ true
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] client_correlation_id Value to be assigned
163
+ def client_correlation_id=(client_correlation_id)
164
+ #if client_correlation_id.nil?
165
+ #fail ArgumentError, 'client_correlation_id cannot be nil'
166
+ #end
167
+
168
+ #if client_correlation_id !~ Regexp.new(/(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/)
169
+ #fail ArgumentError, 'invalid value for "client_correlation_id", must conform to the pattern /(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/.'
170
+ #end
171
+
172
+ @client_correlation_id = client_correlation_id
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] consumer_prompt Value to be assigned
177
+ def consumer_prompt=(consumer_prompt)
178
+ #if !consumer_prompt.nil? && consumer_prompt !~ Regexp.new(/(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/)
179
+ #fail ArgumentError, 'invalid value for "consumer_prompt", must conform to the pattern /(?!^[*.,'#_\/-]+$)(?!.*\\.\/.*)^.*$/.'
180
+ #end
181
+
182
+ @consumer_prompt = consumer_prompt
183
+ end
184
+
185
+ # Checks equality by comparing each attribute.
186
+ # @param [Object] Object to be compared
187
+ def ==(o)
188
+ return true if self.equal?(o)
189
+ self.class == o.class &&
190
+ client_correlation_id == o.client_correlation_id &&
191
+ payment_information == o.payment_information &&
192
+ device_information == o.device_information &&
193
+ assurance_data == o.assurance_data &&
194
+ mandates == o.mandates &&
195
+ buyer_information == o.buyer_information &&
196
+ consumer_prompt == o.consumer_prompt
197
+ end
198
+
199
+ # @see the `==` method
200
+ # @param [Object] Object to be compared
201
+ def eql?(o)
202
+ self == o
203
+ end
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Fixnum] Hash code
207
+ def hash
208
+ [client_correlation_id, payment_information, device_information, assurance_data, mandates, buyer_information, consumer_prompt].hash
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+ self.class.swagger_types.each_pair do |key, type|
217
+ if type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
221
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
222
+ end
223
+ elsif !attributes[self.class.attribute_map[key]].nil?
224
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
225
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
226
+ end
227
+
228
+ self
229
+ end
230
+
231
+ # Deserializes the data based on type
232
+ # @param string type Data type
233
+ # @param string value Value to be deserialized
234
+ # @return [Object] Deserialized data
235
+ def _deserialize(type, value)
236
+ case type.to_sym
237
+ when :DateTime
238
+ DateTime.parse(value)
239
+ when :Date
240
+ Date.parse(value)
241
+ when :String
242
+ value.to_s
243
+ when :Integer
244
+ value.to_i
245
+ when :Float
246
+ value.to_f
247
+ when :BOOLEAN
248
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
249
+ true
250
+ else
251
+ false
252
+ end
253
+ when :Object
254
+ # generic object (usually a Hash), return directly
255
+ value
256
+ when /\AArray<(?<inner_type>.+)>\z/
257
+ inner_type = Regexp.last_match[:inner_type]
258
+ value.map { |v| _deserialize(inner_type, v) }
259
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
260
+ k_type = Regexp.last_match[:k_type]
261
+ v_type = Regexp.last_match[:v_type]
262
+ {}.tap do |hash|
263
+ value.each do |k, v|
264
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
265
+ end
266
+ end
267
+ else # model
268
+ temp_model = CyberSource.const_get(type).new
269
+ temp_model.build_from_hash(value)
270
+ end
271
+ end
272
+
273
+ # Returns the string representation of the object
274
+ # @return [String] String presentation of the object
275
+ def to_s
276
+ to_hash.to_s
277
+ end
278
+
279
+ # to_body is an alias to to_hash (backward compatibility)
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_body
282
+ to_hash
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ next if value.nil?
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ # Outputs non-array value in the form of hash
298
+ # For object, use to_hash. Otherwise, just return the value
299
+ # @param [Object] value Any valid value
300
+ # @return [Hash] Returns the value in the form of hash
301
+ def _to_hash(value)
302
+ if value.is_a?(Array)
303
+ value.compact.map { |v| _to_hash(v) }
304
+ elsif value.is_a?(Hash)
305
+ {}.tap do |hash|
306
+ value.each { |k, v| hash[k] = _to_hash(v) }
307
+ end
308
+ elsif value.respond_to? :to_hash
309
+ value.to_hash
310
+ else
311
+ value
312
+ end
313
+ end
314
+ end
315
+ end
@@ -15,6 +15,10 @@ module CyberSource
15
15
  class Boardingv1registrationsOrganizationInformationBusinessInformation
16
16
  attr_accessor :name
17
17
 
18
+ attr_accessor :locale
19
+
20
+ attr_accessor :localized_names
21
+
18
22
  attr_accessor :doing_business_as
19
23
 
20
24
  attr_accessor :description
@@ -49,6 +53,8 @@ module CyberSource
49
53
  def self.attribute_map
50
54
  {
51
55
  :'name' => :'name',
56
+ :'locale' => :'locale',
57
+ :'localized_names' => :'localizedNames',
52
58
  :'doing_business_as' => :'doingBusinessAs',
53
59
  :'description' => :'description',
54
60
  :'start_date' => :'startDate',
@@ -69,6 +75,8 @@ module CyberSource
69
75
  def self.json_map
70
76
  {
71
77
  :'name' => :'name',
78
+ :'locale' => :'locale',
79
+ :'localized_names' => :'localized_names',
72
80
  :'doing_business_as' => :'doing_business_as',
73
81
  :'description' => :'description',
74
82
  :'start_date' => :'start_date',
@@ -89,6 +97,8 @@ module CyberSource
89
97
  def self.swagger_types
90
98
  {
91
99
  :'name' => :'String',
100
+ :'locale' => :'String',
101
+ :'localized_names' => :'Boardingv1registrationsOrganizationInformationBusinessInformationLocalizedNames',
92
102
  :'doing_business_as' => :'String',
93
103
  :'description' => :'String',
94
104
  :'start_date' => :'Date',
@@ -117,6 +127,14 @@ module CyberSource
117
127
  self.name = attributes[:'name']
118
128
  end
119
129
 
130
+ if attributes.has_key?(:'locale')
131
+ self.locale = attributes[:'locale']
132
+ end
133
+
134
+ if attributes.has_key?(:'localizedNames')
135
+ self.localized_names = attributes[:'localizedNames']
136
+ end
137
+
120
138
  if attributes.has_key?(:'doingBusinessAs')
121
139
  self.doing_business_as = attributes[:'doingBusinessAs']
122
140
  end
@@ -182,6 +200,10 @@ module CyberSource
182
200
  #invalid_properties.push('invalid value for "name", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.')
183
201
  #end
184
202
 
203
+ #if !@locale.nil? && @locale !~ Regexp.new(/^(de-de|en-gb|en-us|es-es|es-us|fr-ca|fr-fr|it-it|ja-jp|pt-br|zh-cn|zh-tw)$/)
204
+ #invalid_properties.push('invalid value for "locale", must conform to the pattern /^(de-de|en-gb|en-us|es-es|es-us|fr-ca|fr-fr|it-it|ja-jp|pt-br|zh-cn|zh-tw)$/.')
205
+ #end
206
+
185
207
  #if !@doing_business_as.nil? && @doing_business_as !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/)
186
208
  #invalid_properties.push('invalid value for "doing_business_as", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.')
187
209
  #end
@@ -214,6 +236,7 @@ module CyberSource
214
236
  def valid?
215
237
  return false if @name.nil?
216
238
  #return false if @name !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/)
239
+ #return false if !@locale.nil? && @locale !~ Regexp.new(/^(de-de|en-gb|en-us|es-es|es-us|fr-ca|fr-fr|it-it|ja-jp|pt-br|zh-cn|zh-tw)$/)
217
240
  #return false if !@doing_business_as.nil? && @doing_business_as !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/)
218
241
  #return false if !@description.nil? && @description !~ Regexp.new(/[À-ÖØ-öø-ǿÀ-ÖØ-öø-ǿ\\n\\ra-zA-Z0-9().\\-_#,;\/\\\\@$:&amp;!?%«»€₣«»€₣ ]{1,}$/)
219
242
  #return false if !@website_url.nil? && @website_url !~ Regexp.new(/\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/)
@@ -237,6 +260,16 @@ module CyberSource
237
260
  @name = name
238
261
  end
239
262
 
263
+ # Custom attribute writer method with validation
264
+ # @param [Object] locale Value to be assigned
265
+ def locale=(locale)
266
+ #if !locale.nil? && locale !~ Regexp.new(/^(de-de|en-gb|en-us|es-es|es-us|fr-ca|fr-fr|it-it|ja-jp|pt-br|zh-cn|zh-tw)$/)
267
+ #fail ArgumentError, 'invalid value for "locale", must conform to the pattern /^(de-de|en-gb|en-us|es-es|es-us|fr-ca|fr-fr|it-it|ja-jp|pt-br|zh-cn|zh-tw)$/.'
268
+ #end
269
+
270
+ @locale = locale
271
+ end
272
+
240
273
  # Custom attribute writer method with validation
241
274
  # @param [Object] doing_business_as Value to be assigned
242
275
  def doing_business_as=(doing_business_as)
@@ -303,6 +336,8 @@ module CyberSource
303
336
  return true if self.equal?(o)
304
337
  self.class == o.class &&
305
338
  name == o.name &&
339
+ locale == o.locale &&
340
+ localized_names == o.localized_names &&
306
341
  doing_business_as == o.doing_business_as &&
307
342
  description == o.description &&
308
343
  start_date == o.start_date &&
@@ -327,7 +362,7 @@ module CyberSource
327
362
  # Calculates hash code according to all attributes.
328
363
  # @return [Fixnum] Hash code
329
364
  def hash
330
- [name, doing_business_as, description, start_date, address, time_zone, website_url, type, tax_id, phone_number, business_contact, technical_contact, emergency_contact, merchant_category_code].hash
365
+ [name, locale, localized_names, doing_business_as, description, start_date, address, time_zone, website_url, type, tax_id, phone_number, business_contact, technical_contact, emergency_contact, merchant_category_code].hash
331
366
  end
332
367
 
333
368
  # Builds the object from hash
@@ -0,0 +1,254 @@
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.38
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module CyberSource
15
+ class Boardingv1registrationsOrganizationInformationBusinessInformationLocalizedNames
16
+ attr_accessor :romaji
17
+
18
+ attr_accessor :katakana
19
+
20
+ attr_accessor :japanese
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'romaji' => :'romaji',
26
+ :'katakana' => :'katakana',
27
+ :'japanese' => :'japanese'
28
+ }
29
+ end
30
+
31
+ # Attribute mapping from JSON key to ruby-style variable name.
32
+ def self.json_map
33
+ {
34
+ :'romaji' => :'romaji',
35
+ :'katakana' => :'katakana',
36
+ :'japanese' => :'japanese'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'romaji' => :'String',
44
+ :'katakana' => :'String',
45
+ :'japanese' => :'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?(:'romaji')
58
+ self.romaji = attributes[:'romaji']
59
+ end
60
+
61
+ if attributes.has_key?(:'katakana')
62
+ self.katakana = attributes[:'katakana']
63
+ end
64
+
65
+ if attributes.has_key?(:'japanese')
66
+ self.japanese = attributes[:'japanese']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ #if !@romaji.nil? && @romaji !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
75
+ #invalid_properties.push('invalid value for "romaji", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/.')
76
+ #end
77
+
78
+ #if !@katakana.nil? && @katakana !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
79
+ #invalid_properties.push('invalid value for "katakana", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/.')
80
+ #end
81
+
82
+ #if !@japanese.nil? && @japanese !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
83
+ #invalid_properties.push('invalid value for "japanese", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/.')
84
+ #end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ #return false if !@romaji.nil? && @romaji !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
93
+ #return false if !@katakana.nil? && @katakana !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
94
+ #return false if !@japanese.nil? && @japanese !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
95
+ true
96
+ end
97
+
98
+ # Custom attribute writer method with validation
99
+ # @param [Object] romaji Value to be assigned
100
+ def romaji=(romaji)
101
+ #if !romaji.nil? && romaji !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
102
+ #fail ArgumentError, 'invalid value for "romaji", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/.'
103
+ #end
104
+
105
+ @romaji = romaji
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] katakana Value to be assigned
110
+ def katakana=(katakana)
111
+ #if !katakana.nil? && katakana !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
112
+ #fail ArgumentError, 'invalid value for "katakana", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/.'
113
+ #end
114
+
115
+ @katakana = katakana
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] japanese Value to be assigned
120
+ def japanese=(japanese)
121
+ #if !japanese.nil? && japanese !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/)
122
+ #fail ArgumentError, 'invalid value for "japanese", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&|\\[\\]\\,\\(\\)!$;:?@\\#¡-￿]*$/.'
123
+ #end
124
+
125
+ @japanese = japanese
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ romaji == o.romaji &&
134
+ katakana == o.katakana &&
135
+ japanese == o.japanese
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Fixnum] Hash code
146
+ def hash
147
+ [romaji, katakana, japanese].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ self.class.swagger_types.each_pair do |key, type|
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
160
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
161
+ end
162
+ elsif !attributes[self.class.attribute_map[key]].nil?
163
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
165
+ end
166
+
167
+ self
168
+ end
169
+
170
+ # Deserializes the data based on type
171
+ # @param string type Data type
172
+ # @param string value Value to be deserialized
173
+ # @return [Object] Deserialized data
174
+ def _deserialize(type, value)
175
+ case type.to_sym
176
+ when :DateTime
177
+ DateTime.parse(value)
178
+ when :Date
179
+ Date.parse(value)
180
+ when :String
181
+ value.to_s
182
+ when :Integer
183
+ value.to_i
184
+ when :Float
185
+ value.to_f
186
+ when :BOOLEAN
187
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
+ true
189
+ else
190
+ false
191
+ end
192
+ when :Object
193
+ # generic object (usually a Hash), return directly
194
+ value
195
+ when /\AArray<(?<inner_type>.+)>\z/
196
+ inner_type = Regexp.last_match[:inner_type]
197
+ value.map { |v| _deserialize(inner_type, v) }
198
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
+ k_type = Regexp.last_match[:k_type]
200
+ v_type = Regexp.last_match[:v_type]
201
+ {}.tap do |hash|
202
+ value.each do |k, v|
203
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
+ end
205
+ end
206
+ else # model
207
+ temp_model = CyberSource.const_get(type).new
208
+ temp_model.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ next if value.nil?
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+ end
254
+ end