cybersource_rest_client 0.0.85 → 0.0.86

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 (268) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/util/Cache.rb +9 -6
  3. data/lib/AuthenticationSDK/util/Utility.rb +16 -5
  4. data/lib/cybersource_rest_client/api/agent_capabilities_api.rb +1868 -122
  5. data/lib/cybersource_rest_client/api/bin_lookup_api.rb +3 -3
  6. data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +6 -6
  7. data/lib/cybersource_rest_client/api/emv_tag_details_api.rb +1 -1
  8. data/lib/cybersource_rest_client/api/foreign_exchange_rates_api.rb +146 -0
  9. data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +9 -9
  10. data/lib/cybersource_rest_client/api/merchant_boarding_api.rb +94 -4
  11. data/lib/cybersource_rest_client/api/merchant_capabilities_api.rb +1065 -0
  12. data/lib/cybersource_rest_client/api/merchant_defined_fields_api.rb +361 -0
  13. data/lib/cybersource_rest_client/api/network_tokens_api.rb +4 -4
  14. data/lib/cybersource_rest_client/api/offers_api.rb +3 -3
  15. data/lib/cybersource_rest_client/api/orders_api.rb +2 -2
  16. data/lib/cybersource_rest_client/api/payment_tokens_api.rb +1 -1
  17. data/lib/cybersource_rest_client/api/plans_api.rb +1 -1
  18. data/lib/cybersource_rest_client/api/pull_funds_api.rb +3 -3
  19. data/lib/cybersource_rest_client/api/subscriptions_api.rb +2 -2
  20. data/lib/cybersource_rest_client/api/subscriptions_follow_ons_api.rb +2 -2
  21. data/lib/cybersource_rest_client/api/transaction_query_api.rb +158 -0
  22. data/lib/cybersource_rest_client/api/transaction_risk_labeling_api.rb +104 -0
  23. data/lib/cybersource_rest_client/models/acp_checkout_session_response_buyer.rb +254 -0
  24. data/lib/cybersource_rest_client/models/acp_complete_checkout_request.rb +205 -0
  25. data/lib/cybersource_rest_client/models/acp_complete_checkout_response_buyer.rb +254 -0
  26. data/lib/cybersource_rest_client/models/acp_complete_checkout_session_buyer.rb +254 -0
  27. data/lib/cybersource_rest_client/models/acp_create_checkout_session_buyer.rb +254 -0
  28. data/lib/cybersource_rest_client/models/acp_create_checkout_session_request.rb +217 -0
  29. data/lib/cybersource_rest_client/models/acp_update_checkout_session_buyer.rb +254 -0
  30. data/lib/cybersource_rest_client/models/acp_update_checkout_session_request.rb +224 -0
  31. data/lib/cybersource_rest_client/models/activate_merchant_key_response200.rb +356 -0
  32. data/lib/cybersource_rest_client/models/add_agent_key_response201.rb +356 -0
  33. data/lib/cybersource_rest_client/models/agent_registration_conflict_response409.rb +196 -0
  34. data/lib/cybersource_rest_client/models/agent_registration_response201.rb +356 -0
  35. data/lib/cybersource_rest_client/models/agent_registration_response201_keys.rb +308 -0
  36. data/lib/cybersource_rest_client/models/agent_registration_validation_error_response422.rb +214 -0
  37. data/lib/cybersource_rest_client/models/agent_registration_validation_error_response422_errors.rb +212 -0
  38. data/lib/cybersource_rest_client/models/agent_request.rb +286 -0
  39. data/lib/cybersource_rest_client/models/agent_update.rb +237 -0
  40. data/lib/cybersource_rest_client/models/boardingv1registrations_integration_information_tenant_configurations.rb +1 -1
  41. data/lib/cybersource_rest_client/models/body_1.rb +189 -0
  42. data/lib/cybersource_rest_client/models/body_2.rb +224 -0
  43. data/lib/cybersource_rest_client/models/consumer_authentication_response.rb +196 -0
  44. data/lib/cybersource_rest_client/models/create_payment_link_request.rb +17 -5
  45. data/lib/cybersource_rest_client/models/deactivate_merchant_key_response200.rb +196 -0
  46. data/lib/cybersource_rest_client/models/iccv1agents_keys.rb +239 -0
  47. data/lib/cybersource_rest_client/models/iccv1checkout_sessions_fulfillment_address.rb +344 -0
  48. data/lib/cybersource_rest_client/models/iccv1checkout_sessions_items.rb +222 -0
  49. data/lib/cybersource_rest_client/models/iccv1checkout_sessionssession_id_fulfillment_address.rb +344 -0
  50. data/lib/cybersource_rest_client/models/iccv1checkout_sessionssession_idcomplete_payment_data.rb +222 -0
  51. data/lib/cybersource_rest_client/models/iccv1checkout_sessionssession_idcomplete_payment_data_billing_address.rb +344 -0
  52. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_discounts.rb +206 -0
  53. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_discounts_allocations.rb +202 -0
  54. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_discounts_applied.rb +237 -0
  55. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_fulfillment.rb +193 -0
  56. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_fulfillment_destinations.rb +246 -0
  57. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_fulfillment_groups.rb +228 -0
  58. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_fulfillment_methods.rb +252 -0
  59. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_fulfillment_options.rb +215 -0
  60. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_fulfillment_totals.rb +202 -0
  61. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_item.rb +207 -0
  62. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_line_items.rb +211 -0
  63. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_payment.rb +217 -0
  64. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_payment_billing_address.rb +235 -0
  65. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_payment_credential.rb +202 -0
  66. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_payment_handlers.rb +259 -0
  67. data/lib/cybersource_rest_client/models/iccv1checkoutsessions_payment_instruments.rb +288 -0
  68. data/lib/cybersource_rest_client/models/iccv1checkoutsessionssession_id_discounts.rb +206 -0
  69. data/lib/cybersource_rest_client/models/iccv1checkoutsessionssession_id_fulfillment.rb +193 -0
  70. data/lib/cybersource_rest_client/models/iccv1checkoutsessionssession_id_payment.rb +217 -0
  71. data/lib/cybersource_rest_client/models/iccv1merchants_api_integrations.rb +225 -0
  72. data/lib/cybersource_rest_client/models/iccv1merchants_encryption_key.rb +245 -0
  73. data/lib/cybersource_rest_client/models/iccv1merchants_protocol_interactions.rb +236 -0
  74. data/lib/cybersource_rest_client/models/iccv1merchants_web_integrations.rb +225 -0
  75. data/lib/cybersource_rest_client/models/iccv1productsfeed_products.rb +1368 -0
  76. data/lib/cybersource_rest_client/models/inline_response_200_16.rb +2 -2
  77. data/lib/cybersource_rest_client/models/inline_response_200_17.rb +317 -0
  78. data/lib/cybersource_rest_client/models/inline_response_200_17_fulfillment_address.rb +344 -0
  79. data/lib/cybersource_rest_client/models/inline_response_200_17_order.rb +213 -0
  80. data/lib/cybersource_rest_client/models/inline_response_200_18.rb +308 -0
  81. data/lib/cybersource_rest_client/models/inline_response_200_19.rb +302 -0
  82. data/lib/cybersource_rest_client/models/inline_response_200_19_errors.rb +213 -0
  83. data/lib/cybersource_rest_client/models/inline_response_200_19_google_merchant.rb +237 -0
  84. data/lib/cybersource_rest_client/models/inline_response_200_19_google_merchant_products.rb +259 -0
  85. data/lib/cybersource_rest_client/models/inline_response_200_20.rb +259 -0
  86. data/lib/cybersource_rest_client/models/inline_response_200_20_products.rb +1081 -0
  87. data/lib/cybersource_rest_client/models/inline_response_200_21.rb +201 -0
  88. data/lib/cybersource_rest_client/models/inline_response_200_5.rb +1 -1
  89. data/lib/cybersource_rest_client/models/inline_response_200_5_integration_information_tenant_configurations.rb +1 -1
  90. data/lib/cybersource_rest_client/models/inline_response_201_10.rb +277 -0
  91. data/lib/cybersource_rest_client/models/{inline_response_201_7_payloads.rb → inline_response_201_10_payloads.rb} +2 -2
  92. data/lib/cybersource_rest_client/models/{inline_response_201_7_payloads_test_payload.rb → inline_response_201_10_payloads_test_payload.rb} +1 -1
  93. data/lib/cybersource_rest_client/models/inline_response_201_11.rb +202 -0
  94. data/lib/cybersource_rest_client/models/inline_response_201_12.rb +297 -0
  95. data/lib/cybersource_rest_client/models/{inline_response_201_9_client_reference_information.rb → inline_response_201_12_client_reference_information.rb} +1 -1
  96. data/lib/cybersource_rest_client/models/{inline_response_201_9_error_information.rb → inline_response_201_12_error_information.rb} +1 -1
  97. data/lib/cybersource_rest_client/models/{inline_response_201_9_order_information.rb → inline_response_201_12_order_information.rb} +2 -2
  98. data/lib/cybersource_rest_client/models/{inline_response_201_9_order_information_currency_conversion.rb → inline_response_201_12_order_information_currency_conversion.rb} +2 -2
  99. data/lib/cybersource_rest_client/models/{inline_response_201_9_order_information_currency_conversion_offer.rb → inline_response_201_12_order_information_currency_conversion_offer.rb} +1 -1
  100. data/lib/cybersource_rest_client/models/{inline_response_201_9_processor_information.rb → inline_response_201_12_processor_information.rb} +1 -1
  101. data/lib/cybersource_rest_client/models/inline_response_201_13.rb +318 -0
  102. data/lib/cybersource_rest_client/models/inline_response_201_13_fulfillment_address.rb +344 -0
  103. data/lib/cybersource_rest_client/models/inline_response_201_13_fulfillment_options.rb +290 -0
  104. data/lib/cybersource_rest_client/models/inline_response_201_13_item.rb +213 -0
  105. data/lib/cybersource_rest_client/models/inline_response_201_13_line_items.rb +256 -0
  106. data/lib/cybersource_rest_client/models/inline_response_201_13_links.rb +212 -0
  107. data/lib/cybersource_rest_client/models/inline_response_201_13_messages.rb +250 -0
  108. data/lib/cybersource_rest_client/models/inline_response_201_13_payment_provider.rb +204 -0
  109. data/lib/cybersource_rest_client/models/inline_response_201_13_totals.rb +213 -0
  110. data/lib/cybersource_rest_client/models/inline_response_201_14.rb +312 -0
  111. data/lib/cybersource_rest_client/models/inline_response_201_14_discounts.rb +206 -0
  112. data/lib/cybersource_rest_client/models/inline_response_201_14_fulfillment.rb +193 -0
  113. data/lib/cybersource_rest_client/models/inline_response_201_14_item.rb +213 -0
  114. data/lib/cybersource_rest_client/models/inline_response_201_14_line_items.rb +225 -0
  115. data/lib/cybersource_rest_client/models/inline_response_201_14_order.rb +202 -0
  116. data/lib/cybersource_rest_client/models/inline_response_201_14_payment.rb +217 -0
  117. data/lib/cybersource_rest_client/models/inline_response_201_14_ucp.rb +204 -0
  118. data/lib/cybersource_rest_client/models/inline_response_201_14_ucp_capabilities.rb +202 -0
  119. data/lib/cybersource_rest_client/models/inline_response_201_3.rb +33 -54
  120. data/lib/cybersource_rest_client/models/inline_response_201_3_results.rb +190 -0
  121. data/lib/cybersource_rest_client/models/inline_response_201_3_results_risk_insights.rb +235 -0
  122. data/lib/cybersource_rest_client/models/inline_response_201_4.rb +51 -62
  123. data/lib/cybersource_rest_client/models/inline_response_201_4_error_information.rb +225 -0
  124. data/lib/cybersource_rest_client/models/inline_response_201_4_error_information_details.rb +213 -0
  125. data/lib/cybersource_rest_client/models/inline_response_201_4_order_information.rb +189 -0
  126. data/lib/cybersource_rest_client/models/inline_response_201_4_order_information_amount_details.rb +315 -0
  127. data/lib/cybersource_rest_client/models/inline_response_201_4_processing_information.rb +189 -0
  128. data/lib/cybersource_rest_client/models/inline_response_201_4_processing_information_routing.rb +196 -0
  129. data/lib/cybersource_rest_client/models/inline_response_201_4_processor_information.rb +213 -0
  130. data/lib/cybersource_rest_client/models/inline_response_201_5.rb +78 -19
  131. data/lib/cybersource_rest_client/models/{inline_response_401_1__links.rb → inline_response_201_5__links.rb} +2 -2
  132. data/lib/cybersource_rest_client/models/inline_response_201_5__links_self.rb +201 -0
  133. data/lib/cybersource_rest_client/models/inline_response_201_5_acquirer_information.rb +196 -0
  134. data/lib/cybersource_rest_client/models/inline_response_201_5_client_reference_information.rb +196 -0
  135. data/lib/cybersource_rest_client/models/inline_response_201_5_error_information.rb +225 -0
  136. data/lib/cybersource_rest_client/models/inline_response_201_5_error_information_details.rb +213 -0
  137. data/lib/cybersource_rest_client/models/inline_response_201_5_merchant_information.rb +196 -0
  138. data/lib/cybersource_rest_client/models/inline_response_201_5_order_information.rb +189 -0
  139. data/lib/cybersource_rest_client/models/inline_response_201_5_order_information_amount_details.rb +264 -0
  140. data/lib/cybersource_rest_client/models/inline_response_201_5_payment_information.rb +223 -0
  141. data/lib/cybersource_rest_client/models/inline_response_201_5_payment_information_card.rb +213 -0
  142. data/lib/cybersource_rest_client/models/inline_response_201_5_processing_information.rb +240 -0
  143. data/lib/cybersource_rest_client/models/inline_response_201_5_processing_information_payouts_options.rb +196 -0
  144. data/lib/cybersource_rest_client/models/inline_response_201_5_processor_information.rb +548 -0
  145. data/lib/cybersource_rest_client/models/inline_response_201_5_processor_information_card_verification.rb +196 -0
  146. data/lib/cybersource_rest_client/models/inline_response_201_5_transactions.rb +239 -0
  147. data/lib/cybersource_rest_client/models/inline_response_201_6.rb +45 -111
  148. data/lib/cybersource_rest_client/models/{inline_response_201_3_payout_information.rb → inline_response_201_6_payout_information.rb} +3 -3
  149. data/lib/cybersource_rest_client/models/{inline_response_201_3_payout_information_pull_funds.rb → inline_response_201_6_payout_information_pull_funds.rb} +1 -1
  150. data/lib/cybersource_rest_client/models/{inline_response_201_3_payout_information_push_funds.rb → inline_response_201_6_payout_information_push_funds.rb} +1 -1
  151. data/lib/cybersource_rest_client/models/inline_response_201_7.rb +76 -72
  152. data/lib/cybersource_rest_client/models/{inline_response_201_4_integration_information.rb → inline_response_201_7_integration_information.rb} +2 -2
  153. data/lib/cybersource_rest_client/models/{inline_response_201_4_integration_information_tenant_configurations.rb → inline_response_201_7_integration_information_tenant_configurations.rb} +1 -1
  154. data/lib/cybersource_rest_client/models/{inline_response_201_4_organization_information.rb → inline_response_201_7_organization_information.rb} +1 -1
  155. data/lib/cybersource_rest_client/models/{inline_response_201_4_product_information_setups.rb → inline_response_201_7_product_information_setups.rb} +2 -2
  156. data/lib/cybersource_rest_client/models/{inline_response_201_4_registration_information.rb → inline_response_201_7_registration_information.rb} +1 -1
  157. data/lib/cybersource_rest_client/models/{inline_response_201_4_setups.rb → inline_response_201_7_setups.rb} +4 -4
  158. data/lib/cybersource_rest_client/models/{inline_response_201_4_setups_commerce_solutions.rb → inline_response_201_7_setups_commerce_solutions.rb} +1 -1
  159. data/lib/cybersource_rest_client/models/{inline_response_201_4_setups_risk.rb → inline_response_201_7_setups_risk.rb} +1 -1
  160. data/lib/cybersource_rest_client/models/{inline_response_201_4_setups_value_added_services.rb → inline_response_201_7_setups_value_added_services.rb} +1 -1
  161. data/lib/cybersource_rest_client/models/inline_response_201_8.rb +26 -6
  162. data/lib/cybersource_rest_client/models/{inline_response_201_5_key_information.rb → inline_response_201_8_key_information.rb} +2 -2
  163. data/lib/cybersource_rest_client/models/{inline_response_201_5_key_information_error_information.rb → inline_response_201_8_key_information_error_information.rb} +2 -2
  164. data/lib/cybersource_rest_client/models/{inline_response_201_5_key_information_error_information_details.rb → inline_response_201_8_key_information_error_information_details.rb} +1 -1
  165. data/lib/cybersource_rest_client/models/inline_response_201_9.rb +107 -90
  166. data/lib/cybersource_rest_client/models/inline_response_202__links.rb +1 -1
  167. data/lib/cybersource_rest_client/models/inline_response_400_10.rb +58 -36
  168. data/lib/cybersource_rest_client/models/{inline_response_400_8_fields.rb → inline_response_400_10_fields.rb} +1 -1
  169. data/lib/cybersource_rest_client/models/inline_response_400_11.rb +35 -42
  170. data/lib/cybersource_rest_client/models/{inline_response_400_9_details.rb → inline_response_400_11_details.rb} +1 -1
  171. data/lib/cybersource_rest_client/models/inline_response_400_12.rb +27 -26
  172. data/lib/cybersource_rest_client/models/inline_response_400_12_details.rb +18 -7
  173. data/lib/cybersource_rest_client/models/inline_response_400_13.rb +38 -77
  174. data/lib/cybersource_rest_client/models/inline_response_400_14.rb +235 -0
  175. data/lib/cybersource_rest_client/models/{inline_response_400_10_details.rb → inline_response_400_14_details.rb} +8 -19
  176. data/lib/cybersource_rest_client/models/inline_response_400_15.rb +281 -0
  177. data/lib/cybersource_rest_client/models/inline_response_400_16.rb +235 -0
  178. data/lib/cybersource_rest_client/models/inline_response_400_3.rb +42 -13
  179. data/lib/cybersource_rest_client/models/inline_response_400_4.rb +47 -13
  180. data/lib/cybersource_rest_client/models/inline_response_400_5.rb +1 -1
  181. data/lib/cybersource_rest_client/models/inline_response_400_6.rb +1 -1
  182. data/lib/cybersource_rest_client/models/inline_response_400_7.rb +1 -1
  183. data/lib/cybersource_rest_client/models/inline_response_400_8.rb +37 -60
  184. data/lib/cybersource_rest_client/models/inline_response_400_9.rb +6 -6
  185. data/lib/cybersource_rest_client/models/inline_response_401.rb +51 -33
  186. data/lib/cybersource_rest_client/models/inline_response_401_1.rb +44 -56
  187. data/lib/cybersource_rest_client/models/inline_response_401_2.rb +223 -0
  188. data/lib/cybersource_rest_client/models/inline_response_401_3.rb +253 -0
  189. data/lib/cybersource_rest_client/models/inline_response_401_3__links.rb +189 -0
  190. data/lib/cybersource_rest_client/models/{inline_response_401_1__links_self.rb → inline_response_401_3__links_self.rb} +1 -1
  191. data/lib/cybersource_rest_client/models/{inline_response_401_1_fields.rb → inline_response_401_3_fields.rb} +1 -1
  192. data/lib/cybersource_rest_client/models/inline_response_404_3.rb +1 -1
  193. data/lib/cybersource_rest_client/models/inline_response_422_1.rb +1 -1
  194. data/lib/cybersource_rest_client/models/inline_response_502_2.rb +55 -26
  195. data/lib/cybersource_rest_client/models/inline_response_502_3.rb +21 -15
  196. data/lib/cybersource_rest_client/models/inline_response_502_4.rb +223 -0
  197. data/lib/cybersource_rest_client/models/inline_response_502_5.rb +251 -0
  198. data/lib/cybersource_rest_client/models/invoicing_v2_invoice_settings_get200_response_invoice_settings_information.rb +18 -1
  199. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response_invoice_information.rb +2 -2
  200. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_cancel200_response.rb +17 -5
  201. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_post201_response_invoice_information.rb +20 -3
  202. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_publish200_response.rb +17 -5
  203. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_send200_response.rb +17 -5
  204. data/lib/cybersource_rest_client/models/invoicingv2invoice_settings_invoice_settings_information.rb +18 -1
  205. data/lib/cybersource_rest_client/models/invoicingv2invoices_invoice_information.rb +20 -3
  206. data/lib/cybersource_rest_client/models/invoicingv2invoicesid_invoice_information.rb +20 -3
  207. data/lib/cybersource_rest_client/models/iplv2paymentlinks_order_information_line_items.rb +26 -9
  208. data/lib/cybersource_rest_client/models/iplv2paymentlinks_purchase_information.rb +85 -5
  209. data/lib/cybersource_rest_client/models/iplv2paymentlinksid_purchase_information.rb +85 -5
  210. data/lib/cybersource_rest_client/models/key_request.rb +239 -0
  211. data/lib/cybersource_rest_client/models/key_request_1.rb +245 -0
  212. data/lib/cybersource_rest_client/models/key_update.rb +224 -0
  213. data/lib/cybersource_rest_client/models/key_update_1.rb +235 -0
  214. data/lib/cybersource_rest_client/models/label_request.rb +268 -0
  215. data/lib/cybersource_rest_client/models/list_agent_keys_response200.rb +245 -0
  216. data/lib/cybersource_rest_client/models/list_agent_keys_response200_pagination.rb +276 -0
  217. data/lib/cybersource_rest_client/models/list_merchant_keys_response200.rb +262 -0
  218. data/lib/cybersource_rest_client/models/merchant_defined_field_core_1.rb +315 -0
  219. data/lib/cybersource_rest_client/models/merchant_defined_field_definition_request_1.rb +315 -0
  220. data/lib/cybersource_rest_client/models/merchant_registration_response201.rb +395 -0
  221. data/lib/cybersource_rest_client/models/merchant_registration_response201_keys.rb +324 -0
  222. data/lib/cybersource_rest_client/models/merchant_registration_validation_error_response422.rb +193 -0
  223. data/lib/cybersource_rest_client/models/merchant_registration_validation_error_response422_detail.rb +215 -0
  224. data/lib/cybersource_rest_client/models/merchant_request.rb +317 -0
  225. data/lib/cybersource_rest_client/models/merchant_update.rb +270 -0
  226. data/lib/cybersource_rest_client/models/patch_registration_body.rb +234 -0
  227. data/lib/cybersource_rest_client/models/pbl_payment_links_get200_response.rb +17 -5
  228. data/lib/cybersource_rest_client/models/pbl_payment_links_post201_response.rb +17 -5
  229. data/lib/cybersource_rest_client/models/pbl_payment_links_post201_response_purchase_information.rb +81 -1
  230. data/lib/cybersource_rest_client/models/{tms_tokenized_card_delete_request.rb → post_tokenized_card_delete_request.rb} +1 -1
  231. data/lib/cybersource_rest_client/models/processing_info_authorization_options.rb +14 -1
  232. data/lib/cybersource_rest_client/models/product_feed_request.rb +230 -0
  233. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_order_information_amount_details.rb +1 -1
  234. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information.rb +37 -3
  235. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +11 -1
  236. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_card_verification.rb +214 -0
  237. data/lib/cybersource_rest_client/models/ptsv2payments_recurring_payment_information.rb +0 -14
  238. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_amount_details.rb +1 -1
  239. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +1 -1
  240. data/lib/cybersource_rest_client/models/ptsv2payoutsfxrates_acquirer_information.rb +196 -0
  241. data/lib/cybersource_rest_client/models/ptsv2payoutsfxrates_client_reference_information.rb +257 -0
  242. data/lib/cybersource_rest_client/models/ptsv2payoutsfxrates_client_reference_information_partner.rb +213 -0
  243. data/lib/cybersource_rest_client/models/ptsv2payoutsfxrates_order_information.rb +189 -0
  244. data/lib/cybersource_rest_client/models/ptsv2payoutsfxrates_order_information_amount_details.rb +299 -0
  245. data/lib/cybersource_rest_client/models/ptsv2payoutsfxrates_processing_information.rb +240 -0
  246. data/lib/cybersource_rest_client/models/ptsv2payoutsfxrates_processing_information_routing.rb +205 -0
  247. data/lib/cybersource_rest_client/models/ptsv2payoutstransactionqueryid_client_reference_information.rb +247 -0
  248. data/lib/cybersource_rest_client/models/{boardingv1registrations_integration_information_tenant_information.rb → tenant_information.rb} +1 -1
  249. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +1 -1
  250. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_authorization_options.rb +12 -1
  251. data/lib/cybersource_rest_client/models/ucp_checkout_session_response_buyer.rb +202 -0
  252. data/lib/cybersource_rest_client/models/ucp_complete_checkout_request.rb +201 -0
  253. data/lib/cybersource_rest_client/models/ucp_create_checkout_session_buyer.rb +202 -0
  254. data/lib/cybersource_rest_client/models/ucp_create_checkout_session_request.rb +249 -0
  255. data/lib/cybersource_rest_client/models/ucp_update_checkout_session_buyer.rb +202 -0
  256. data/lib/cybersource_rest_client/models/ucp_update_checkout_session_request.rb +255 -0
  257. data/lib/cybersource_rest_client/models/unified_risk_labels_post400_response.rb +230 -0
  258. data/lib/cybersource_rest_client/models/unified_risk_labels_post400_response_errors.rb +223 -0
  259. data/lib/cybersource_rest_client/models/unifiedrisk_labels.rb +230 -0
  260. data/lib/cybersource_rest_client/models/unifiedrisk_labels_authentication_outcome.rb +201 -0
  261. data/lib/cybersource_rest_client/models/unifiedrisk_labels_payment_authorization_decision.rb +201 -0
  262. data/lib/cybersource_rest_client/models/unifiedrisk_labels_return.rb +202 -0
  263. data/lib/cybersource_rest_client/models/unifiedrisk_labels_transaction_decision.rb +201 -0
  264. data/lib/cybersource_rest_client/models/unifiedrisk_labels_transaction_outcome.rb +201 -0
  265. data/lib/cybersource_rest_client/models/unifiedrisk_transaction.rb +196 -0
  266. data/lib/cybersource_rest_client/models/update_payment_link_request.rb +17 -5
  267. data/lib/cybersource_rest_client.rb +2172 -2011
  268. metadata +194 -33
@@ -0,0 +1,256 @@
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
+ # A single line item in an ACP session response. All amounts in minor units (cents).
16
+ class InlineResponse20113LineItems
17
+ # ACG-assigned line item identifier.
18
+ attr_accessor :id
19
+
20
+ attr_accessor :item
21
+
22
+ # Unit price × quantity before discounts, in minor units.
23
+ attr_accessor :base_amount
24
+
25
+ # Discount amount for this line item, in minor units.
26
+ attr_accessor :discount
27
+
28
+ # base_amount minus discount, in minor units.
29
+ attr_accessor :subtotal
30
+
31
+ # Tax on this line item, in minor units.
32
+ attr_accessor :tax
33
+
34
+ # subtotal plus tax, in minor units.
35
+ attr_accessor :total
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'id' => :'id',
41
+ :'item' => :'item',
42
+ :'base_amount' => :'base_amount',
43
+ :'discount' => :'discount',
44
+ :'subtotal' => :'subtotal',
45
+ :'tax' => :'tax',
46
+ :'total' => :'total'
47
+ }
48
+ end
49
+
50
+ # Attribute mapping from JSON key to ruby-style variable name.
51
+ def self.json_map
52
+ {
53
+ :'id' => :'id',
54
+ :'item' => :'item',
55
+ :'base_amount' => :'base_amount',
56
+ :'discount' => :'discount',
57
+ :'subtotal' => :'subtotal',
58
+ :'tax' => :'tax',
59
+ :'total' => :'total'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ :'id' => :'String',
67
+ :'item' => :'InlineResponse20113Item',
68
+ :'base_amount' => :'Integer',
69
+ :'discount' => :'Integer',
70
+ :'subtotal' => :'Integer',
71
+ :'tax' => :'Integer',
72
+ :'total' => :'Integer'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
83
+
84
+ if attributes.has_key?(:'id')
85
+ self.id = attributes[:'id']
86
+ end
87
+
88
+ if attributes.has_key?(:'item')
89
+ self.item = attributes[:'item']
90
+ end
91
+
92
+ if attributes.has_key?(:'base_amount')
93
+ self.base_amount = attributes[:'base_amount']
94
+ end
95
+
96
+ if attributes.has_key?(:'discount')
97
+ self.discount = attributes[:'discount']
98
+ end
99
+
100
+ if attributes.has_key?(:'subtotal')
101
+ self.subtotal = attributes[:'subtotal']
102
+ end
103
+
104
+ if attributes.has_key?(:'tax')
105
+ self.tax = attributes[:'tax']
106
+ end
107
+
108
+ if attributes.has_key?(:'total')
109
+ self.total = attributes[:'total']
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
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ id == o.id &&
132
+ item == o.item &&
133
+ base_amount == o.base_amount &&
134
+ discount == o.discount &&
135
+ subtotal == o.subtotal &&
136
+ tax == o.tax &&
137
+ total == o.total
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Fixnum] Hash code
148
+ def hash
149
+ [id, item, base_amount, discount, subtotal, tax, total].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.swagger_types.each_pair do |key, type|
158
+ if type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :BOOLEAN
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ temp_model = CyberSource.const_get(type).new
210
+ temp_model.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+ end
256
+ end
@@ -0,0 +1,212 @@
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
+ # A resource link per the ACP specification. Returned in the `links` array of ACP session responses. Points to merchant legal or policy pages.
16
+ class InlineResponse20113Links
17
+ # Link category. Possible values: - terms_of_use - privacy_policy - seller_shop_policies
18
+ attr_accessor :type
19
+
20
+ # HTTPS URL to the linked resource.
21
+ attr_accessor :url
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'type' => :'type',
27
+ :'url' => :'url'
28
+ }
29
+ end
30
+
31
+ # Attribute mapping from JSON key to ruby-style variable name.
32
+ def self.json_map
33
+ {
34
+ :'type' => :'type',
35
+ :'url' => :'url'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'type' => :'String',
43
+ :'url' => :'String'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
54
+
55
+ if attributes.has_key?(:'type')
56
+ self.type = attributes[:'type']
57
+ end
58
+
59
+ if attributes.has_key?(:'url')
60
+ self.url = attributes[:'url']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ if @type.nil?
69
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
70
+ end
71
+
72
+ if @url.nil?
73
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
74
+ end
75
+
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ return false if @type.nil?
83
+ return false if @url.nil?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ type == o.type &&
93
+ url == o.url
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Fixnum] Hash code
104
+ def hash
105
+ [type, url].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.swagger_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :BOOLEAN
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ temp_model = CyberSource.const_get(type).new
166
+ temp_model.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ next if value.nil?
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map { |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end
211
+ end
212
+ end
@@ -0,0 +1,250 @@
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
+ # A message per the ACP specification. Returned in the `messages` array of ACP session responses. Carries informational notices or actionable errors from the merchant backend.
16
+ class InlineResponse20113Messages
17
+ # Message severity — `info` for informational, `error` for actionable errors. Possible values: - info - error
18
+ attr_accessor :type
19
+
20
+ # Machine-readable error code. Present only when `type` is `error`.
21
+ attr_accessor :code
22
+
23
+ # JSONPath to the request field that caused the error. Present only on validation errors.
24
+ attr_accessor :param
25
+
26
+ # Format of the `content` field. Possible values: - plain - markdown
27
+ attr_accessor :content_type
28
+
29
+ # Human-readable message text formatted according to `content_type`.
30
+ attr_accessor :content
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'type' => :'type',
36
+ :'code' => :'code',
37
+ :'param' => :'param',
38
+ :'content_type' => :'content_type',
39
+ :'content' => :'content'
40
+ }
41
+ end
42
+
43
+ # Attribute mapping from JSON key to ruby-style variable name.
44
+ def self.json_map
45
+ {
46
+ :'type' => :'type',
47
+ :'code' => :'code',
48
+ :'param' => :'param',
49
+ :'content_type' => :'content_type',
50
+ :'content' => :'content'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.swagger_types
56
+ {
57
+ :'type' => :'String',
58
+ :'code' => :'String',
59
+ :'param' => :'String',
60
+ :'content_type' => :'String',
61
+ :'content' => :'String'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ if attributes.has_key?(:'type')
74
+ self.type = attributes[:'type']
75
+ end
76
+
77
+ if attributes.has_key?(:'code')
78
+ self.code = attributes[:'code']
79
+ end
80
+
81
+ if attributes.has_key?(:'param')
82
+ self.param = attributes[:'param']
83
+ end
84
+
85
+ if attributes.has_key?(:'content_type')
86
+ self.content_type = attributes[:'content_type']
87
+ end
88
+
89
+ if attributes.has_key?(:'content')
90
+ self.content = attributes[:'content']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ if @type.nil?
99
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
100
+ end
101
+
102
+ if @content_type.nil?
103
+ invalid_properties.push('invalid value for "content_type", content_type cannot be nil.')
104
+ end
105
+
106
+ if @content.nil?
107
+ invalid_properties.push('invalid value for "content", content cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return false if @type.nil?
117
+ return false if @content_type.nil?
118
+ return false if @content.nil?
119
+ true
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ type == o.type &&
128
+ code == o.code &&
129
+ param == o.param &&
130
+ content_type == o.content_type &&
131
+ content == o.content
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Fixnum] Hash code
142
+ def hash
143
+ [type, code, param, content_type, content].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.swagger_types.each_pair do |key, type|
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :DateTime
173
+ DateTime.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :BOOLEAN
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ temp_model = CyberSource.const_get(type).new
204
+ temp_model.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ next if value.nil?
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+ end
250
+ end