cybersource_rest_client 0.0.49 → 0.0.50

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/core/MerchantConfig.rb +5 -0
  3. data/lib/AuthenticationSDK/util/Constants.rb +2 -0
  4. data/lib/cybersource_rest_client/api/batches_api.rb +330 -0
  5. data/lib/cybersource_rest_client/api/customer_api.rb +55 -47
  6. data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +112 -104
  7. data/lib/cybersource_rest_client/api/customer_shipping_address_api.rb +112 -104
  8. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +93 -81
  9. data/lib/cybersource_rest_client/api/keymanagement_api.rb +3 -3
  10. data/lib/cybersource_rest_client/api/microform_integration_api.rb +89 -0
  11. data/lib/cybersource_rest_client/api/payment_instrument_api.rb +55 -49
  12. data/lib/cybersource_rest_client/api/plans_api.rb +573 -0
  13. data/lib/cybersource_rest_client/api/subscriptions_api.rb +568 -0
  14. data/lib/cybersource_rest_client/api/taxes_api.rb +2 -2
  15. data/lib/cybersource_rest_client/api/token_api.rb +112 -0
  16. data/lib/cybersource_rest_client/api/transient_token_data_api.rb +2 -2
  17. data/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb +6 -5
  18. data/lib/cybersource_rest_client/api_client.rb +11 -0
  19. data/lib/cybersource_rest_client/models/accountupdaterv1batches_included.rb +185 -0
  20. data/lib/cybersource_rest_client/models/accountupdaterv1batches_included_tokens.rb +228 -0
  21. data/lib/cybersource_rest_client/models/body.rb +42 -32
  22. data/lib/cybersource_rest_client/models/create_plan_request.rb +201 -0
  23. data/lib/cybersource_rest_client/models/create_report_subscription_request.rb +0 -18
  24. data/lib/cybersource_rest_client/models/{flexv1tokens_card_info.rb → create_subscription_request.rb} +44 -40
  25. data/lib/cybersource_rest_client/models/generate_capture_context_request.rb +216 -0
  26. data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +1 -1
  27. data/lib/cybersource_rest_client/models/inline_response_200.rb +19 -41
  28. data/lib/cybersource_rest_client/models/inline_response_200_1.rb +227 -0
  29. data/lib/cybersource_rest_client/models/inline_response_200_10.rb +200 -0
  30. data/lib/cybersource_rest_client/models/inline_response_200_11.rb +236 -0
  31. data/lib/cybersource_rest_client/models/{inline_response_200_keys.rb → inline_response_200_11_keys.rb} +1 -1
  32. data/lib/cybersource_rest_client/models/inline_response_200_12.rb +239 -0
  33. data/lib/cybersource_rest_client/models/inline_response_200_12__embedded.rb +185 -0
  34. data/lib/cybersource_rest_client/models/inline_response_200_12__embedded__links.rb +185 -0
  35. data/lib/cybersource_rest_client/models/inline_response_200_12__embedded__links_reports.rb +184 -0
  36. data/lib/cybersource_rest_client/models/inline_response_200_12__embedded_batches.rb +280 -0
  37. data/lib/cybersource_rest_client/models/inline_response_200_12__embedded_totals.rb +219 -0
  38. data/lib/cybersource_rest_client/models/inline_response_200_12__links.rb +193 -0
  39. data/lib/cybersource_rest_client/models/inline_response_200_13.rb +275 -0
  40. data/lib/cybersource_rest_client/models/inline_response_200_13__links.rb +194 -0
  41. data/lib/cybersource_rest_client/models/inline_response_200_13__links_report.rb +183 -0
  42. data/lib/cybersource_rest_client/models/{tokenize_request.rb → inline_response_200_13_billing.rb} +32 -20
  43. data/lib/cybersource_rest_client/models/inline_response_200_14.rb +277 -0
  44. data/lib/cybersource_rest_client/models/inline_response_200_14_records.rb +201 -0
  45. data/lib/cybersource_rest_client/models/inline_response_200_14_response_record.rb +292 -0
  46. data/lib/cybersource_rest_client/models/inline_response_200_14_response_record_additional_updates.rb +232 -0
  47. data/lib/cybersource_rest_client/models/inline_response_200_14_source_record.rb +282 -0
  48. data/lib/cybersource_rest_client/models/inline_response_200_2.rb +194 -0
  49. data/lib/cybersource_rest_client/models/inline_response_200_3.rb +228 -0
  50. data/lib/cybersource_rest_client/models/inline_response_200_3_plan_information.rb +200 -0
  51. data/lib/cybersource_rest_client/models/inline_response_200_4.rb +228 -0
  52. data/lib/cybersource_rest_client/models/inline_response_200_5.rb +200 -0
  53. data/lib/cybersource_rest_client/models/inline_response_200_6.rb +214 -0
  54. data/lib/cybersource_rest_client/models/inline_response_200_6__links.rb +210 -0
  55. data/lib/cybersource_rest_client/models/inline_response_200_6_order_information.rb +192 -0
  56. data/lib/cybersource_rest_client/models/inline_response_200_6_order_information_bill_to.rb +206 -0
  57. data/lib/cybersource_rest_client/models/inline_response_200_6_payment_information.rb +183 -0
  58. data/lib/cybersource_rest_client/models/inline_response_200_6_payment_information_customer.rb +190 -0
  59. data/lib/cybersource_rest_client/models/{flex_v1_keys_post200_response_jwk.rb → inline_response_200_6_plan_information.rb} +40 -41
  60. data/lib/cybersource_rest_client/models/inline_response_200_6_plan_information_billing_cycles.rb +194 -0
  61. data/lib/cybersource_rest_client/models/inline_response_200_6_subscription_information.rb +242 -0
  62. data/lib/cybersource_rest_client/models/inline_response_200_6_subscriptions.rb +236 -0
  63. data/lib/cybersource_rest_client/models/inline_response_200_7.rb +245 -0
  64. data/lib/cybersource_rest_client/models/inline_response_200_8.rb +228 -0
  65. data/lib/cybersource_rest_client/models/{generate_public_key_request.rb → inline_response_200_9.rb} +50 -21
  66. data/lib/cybersource_rest_client/models/inline_response_200_9_subscription_information.rb +200 -0
  67. data/lib/cybersource_rest_client/models/{flex_v1_keys_post200_response.rb → inline_response_200__links.rb} +20 -21
  68. data/lib/cybersource_rest_client/models/inline_response_200_order_information.rb +183 -0
  69. data/lib/cybersource_rest_client/models/inline_response_200_order_information_amount_details.rb +222 -0
  70. data/lib/cybersource_rest_client/models/inline_response_200_plan_information.rb +250 -0
  71. data/lib/cybersource_rest_client/models/inline_response_200_plan_information_billing_cycles.rb +184 -0
  72. data/lib/cybersource_rest_client/models/inline_response_200_plan_information_billing_period.rb +195 -0
  73. data/lib/cybersource_rest_client/models/inline_response_200_plans.rb +218 -0
  74. data/lib/cybersource_rest_client/models/inline_response_201.rb +228 -0
  75. data/lib/cybersource_rest_client/models/inline_response_201_1.rb +228 -0
  76. data/lib/cybersource_rest_client/models/{invoicing_v2_invoices_all_get200_response__links_1.rb → inline_response_201_1__links.rb} +23 -14
  77. data/lib/cybersource_rest_client/models/inline_response_201_1_subscription_information.rb +200 -0
  78. data/lib/cybersource_rest_client/models/inline_response_201_plan_information.rb +200 -0
  79. data/lib/cybersource_rest_client/models/inline_response_202.rb +228 -0
  80. data/lib/cybersource_rest_client/models/inline_response_202_1.rb +228 -0
  81. data/lib/cybersource_rest_client/models/inline_response_202_1_subscription_information.rb +200 -0
  82. data/lib/cybersource_rest_client/models/inline_response_202_2.rb +202 -0
  83. data/lib/cybersource_rest_client/models/inline_response_202_2__links.rb +194 -0
  84. data/lib/cybersource_rest_client/models/inline_response_202_2__links_status.rb +183 -0
  85. data/lib/cybersource_rest_client/models/inline_response_202_subscription_information.rb +200 -0
  86. data/lib/cybersource_rest_client/models/inline_response_400_1.rb +33 -55
  87. data/lib/cybersource_rest_client/models/inline_response_400_2.rb +10 -9
  88. data/lib/cybersource_rest_client/models/inline_response_400_3.rb +55 -33
  89. data/lib/cybersource_rest_client/models/{inline_response_400_1_fields.rb → inline_response_400_3_fields.rb} +1 -1
  90. data/lib/cybersource_rest_client/models/inline_response_400_4.rb +30 -71
  91. data/lib/cybersource_rest_client/models/inline_response_400_5.rb +225 -0
  92. data/lib/cybersource_rest_client/models/inline_response_400_6.rb +265 -0
  93. data/lib/cybersource_rest_client/models/{inline_response_400_4_details.rb → inline_response_400_6_details.rb} +1 -1
  94. data/lib/cybersource_rest_client/models/inline_response_400_errors.rb +2 -2
  95. data/lib/cybersource_rest_client/models/inline_response_401.rb +241 -0
  96. data/lib/cybersource_rest_client/models/inline_response_401__links.rb +183 -0
  97. data/lib/cybersource_rest_client/models/inline_response_401__links_self.rb +183 -0
  98. data/lib/cybersource_rest_client/models/inline_response_401_fields.rb +202 -0
  99. data/lib/cybersource_rest_client/models/inline_response_403.rb +185 -0
  100. data/lib/cybersource_rest_client/models/inline_response_403_errors.rb +194 -0
  101. data/lib/cybersource_rest_client/models/inline_response_404.rb +194 -0
  102. data/lib/cybersource_rest_client/models/inline_response_409.rb +185 -0
  103. data/lib/cybersource_rest_client/models/inline_response_409_errors.rb +194 -0
  104. data/lib/cybersource_rest_client/models/inline_response_410.rb +185 -0
  105. data/lib/cybersource_rest_client/models/inline_response_410_errors.rb +194 -0
  106. data/lib/cybersource_rest_client/models/inline_response_412.rb +185 -0
  107. data/lib/cybersource_rest_client/models/inline_response_412_errors.rb +194 -0
  108. data/lib/cybersource_rest_client/models/inline_response_424.rb +185 -0
  109. data/lib/cybersource_rest_client/models/inline_response_424_errors.rb +194 -0
  110. data/lib/cybersource_rest_client/models/inline_response_500.rb +9 -38
  111. data/lib/cybersource_rest_client/models/inline_response_500_1.rb +214 -0
  112. data/lib/cybersource_rest_client/models/inline_response_500_errors.rb +194 -0
  113. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response.rb +1 -1
  114. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response__links.rb +22 -13
  115. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response_invoices.rb +1 -1
  116. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_get200_response.rb +1 -1
  117. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_post201_response.rb +1 -1
  118. data/lib/cybersource_rest_client/models/invoicingv2invoices_order_information_line_items.rb +0 -18
  119. data/lib/cybersource_rest_client/models/{flex_v1_tokens_post200_response.rb → microformv2sessions_checkout_api_initialization.rb} +68 -59
  120. data/lib/cybersource_rest_client/models/patch_customer_payment_instrument_request.rb +15 -5
  121. data/lib/cybersource_rest_client/models/patch_customer_request.rb +1 -1
  122. data/lib/cybersource_rest_client/models/patch_customer_shipping_address_request.rb +2 -2
  123. data/lib/cybersource_rest_client/models/patch_instrument_identifier_request.rb +4 -4
  124. data/lib/cybersource_rest_client/models/patch_payment_instrument_request.rb +15 -5
  125. data/lib/cybersource_rest_client/models/post_customer_payment_instrument_request.rb +15 -5
  126. data/lib/cybersource_rest_client/models/post_customer_request.rb +1 -1
  127. data/lib/cybersource_rest_client/models/post_customer_shipping_address_request.rb +2 -2
  128. data/lib/cybersource_rest_client/models/post_instrument_identifier_enrollment_request.rb +4 -4
  129. data/lib/cybersource_rest_client/models/post_instrument_identifier_request.rb +4 -4
  130. data/lib/cybersource_rest_client/models/post_payment_instrument_request.rb +15 -5
  131. data/lib/cybersource_rest_client/models/predefined_subscription_request_bean.rb +0 -18
  132. data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch400_response.rb +1 -1
  133. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post400_response.rb +1 -1
  134. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information_ship_to.rb +1 -1
  135. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +0 -18
  136. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_invoice_details.rb +0 -9
  137. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card.rb +1 -1
  138. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +1 -1
  139. data/lib/cybersource_rest_client/models/pts_v2_payments_post400_response.rb +1 -1
  140. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post400_response.rb +1 -1
  141. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post400_response.rb +1 -1
  142. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post400_response.rb +1 -1
  143. data/lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb +0 -18
  144. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information.rb +0 -18
  145. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_invoice_details.rb +0 -9
  146. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +1 -19
  147. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_ship_to.rb +1 -1
  148. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +1 -21
  149. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +1 -1
  150. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
  151. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +12 -47
  152. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_capture_options.rb +0 -36
  153. data/lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb +0 -36
  154. data/lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging_room.rb +0 -18
  155. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_installment_information.rb +0 -18
  156. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_merchant_information.rb +0 -9
  157. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_ship_to.rb +1 -1
  158. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information_capture_options.rb +0 -36
  159. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_merchant_information.rb +0 -9
  160. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_line_items.rb +1 -19
  161. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +1 -1
  162. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_order_information_line_items.rb +0 -18
  163. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information.rb +0 -9
  164. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +1 -1
  165. data/lib/cybersource_rest_client/models/rbsv1plans_client_reference_information.rb +229 -0
  166. data/lib/cybersource_rest_client/models/rbsv1plans_order_information.rb +183 -0
  167. data/lib/cybersource_rest_client/models/rbsv1plans_order_information_amount_details.rb +240 -0
  168. data/lib/cybersource_rest_client/models/rbsv1plans_plan_information.rb +259 -0
  169. data/lib/cybersource_rest_client/models/rbsv1plans_plan_information_billing_cycles.rb +185 -0
  170. data/lib/cybersource_rest_client/models/rbsv1plansid_plan_information.rb +250 -0
  171. data/lib/cybersource_rest_client/models/rbsv1plansid_processing_information.rb +183 -0
  172. data/lib/cybersource_rest_client/models/rbsv1plansid_processing_information_subscription_billing_options.rb +184 -0
  173. data/lib/cybersource_rest_client/models/rbsv1subscriptions_client_reference_information.rb +245 -0
  174. data/lib/cybersource_rest_client/models/rbsv1subscriptions_payment_information.rb +183 -0
  175. data/lib/cybersource_rest_client/models/rbsv1subscriptions_payment_information_customer.rb +199 -0
  176. data/lib/cybersource_rest_client/models/rbsv1subscriptions_plan_information.rb +192 -0
  177. data/lib/cybersource_rest_client/models/rbsv1subscriptions_processing_information.rb +199 -0
  178. data/lib/cybersource_rest_client/models/rbsv1subscriptions_processing_information_authorization_options.rb +183 -0
  179. data/lib/cybersource_rest_client/models/rbsv1subscriptions_processing_information_authorization_options_initiator.rb +184 -0
  180. data/lib/cybersource_rest_client/models/rbsv1subscriptions_subscription_information.rb +246 -0
  181. data/lib/cybersource_rest_client/models/rbsv1subscriptionsid_order_information.rb +183 -0
  182. data/lib/cybersource_rest_client/models/rbsv1subscriptionsid_order_information_amount_details.rb +206 -0
  183. data/lib/cybersource_rest_client/models/rbsv1subscriptionsid_plan_information.rb +183 -0
  184. data/lib/cybersource_rest_client/models/rbsv1subscriptionsid_subscription_information.rb +232 -0
  185. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_consumer_authentication_information.rb +88 -4
  186. data/lib/cybersource_rest_client/models/risk_v1_export_compliance_inquiries_post201_response_export_compliance_information.rb +0 -18
  187. data/lib/cybersource_rest_client/models/riskv1addressverifications_order_information_line_items.rb +1 -19
  188. data/lib/cybersource_rest_client/models/riskv1addressverifications_order_information_ship_to.rb +1 -1
  189. data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +20 -4
  190. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information_line_items.rb +0 -18
  191. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +1 -1
  192. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +1 -1
  193. data/lib/cybersource_rest_client/models/riskv1authentications_buyer_information.rb +14 -4
  194. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_bill_to.rb +17 -1
  195. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_line_items.rb +152 -22
  196. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_card.rb +1 -1
  197. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +1 -1
  198. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_card.rb +1 -1
  199. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_tokenized_card.rb +1 -1
  200. data/lib/cybersource_rest_client/models/riskv1decisions_consumer_authentication_information.rb +14 -4
  201. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_line_items.rb +1 -19
  202. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_ship_to.rb +34 -2
  203. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +1 -1
  204. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
  205. data/lib/cybersource_rest_client/models/riskv1exportcomplianceinquiries_order_information_line_items.rb +1 -19
  206. data/lib/cybersource_rest_client/models/riskv1liststypeentries_order_information_ship_to.rb +1 -1
  207. data/lib/cybersource_rest_client/models/riskv1liststypeentries_payment_information_card.rb +1 -1
  208. data/lib/cybersource_rest_client/models/tms_v2_customers_response.rb +1 -1
  209. data/lib/cybersource_rest_client/models/tmsv2customers__embedded.rb +1 -1
  210. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument.rb +15 -5
  211. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded.rb +1 -1
  212. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier.rb +4 -4
  213. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_bill_to.rb +1 -1
  214. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_card.rb +3 -3
  215. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_metadata.rb +1 -1
  216. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_bank_account.rb +1 -1
  217. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_buyer_information_personal_identification.rb +1 -1
  218. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_card.rb +22 -4
  219. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_card_tokenized_information.rb +1 -1
  220. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_instrument_identifier.rb +1 -1
  221. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_merchant_information_merchant_descriptor.rb +1 -1
  222. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_metadata.rb +1 -1
  223. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_processing_information.rb +1 -1
  224. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument_processing_information_bank_transfer_options.rb +1 -1
  225. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_shipping_address.rb +2 -2
  226. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_shipping_address_metadata.rb +1 -1
  227. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_default_shipping_address_ship_to.rb +1 -1
  228. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_merchant_initiated_transaction.rb +20 -4
  229. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_tokenized_card.rb +15 -5
  230. data/lib/cybersource_rest_client/models/tmsv2customers__embedded_tokenized_card_card.rb +1 -1
  231. data/lib/cybersource_rest_client/models/tmsv2customers_default_payment_instrument.rb +1 -1
  232. data/lib/cybersource_rest_client/models/tmsv2customers_default_shipping_address.rb +1 -1
  233. data/lib/cybersource_rest_client/models/tmsv2customers_merchant_defined_information.rb +2 -2
  234. data/lib/cybersource_rest_client/models/tmsv2customers_metadata.rb +1 -1
  235. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_invoice_details.rb +0 -9
  236. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_line_items.rb +0 -18
  237. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +1 -1
  238. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_point_of_sale_information.rb +0 -18
  239. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +1 -1
  240. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_point_of_sale_information.rb +13 -4
  241. data/lib/cybersource_rest_client/models/ums_v1_users_get200_response_users.rb +15 -4
  242. data/lib/cybersource_rest_client/models/{flex_v1_keys_post200_response_der.rb → update_plan_request.rb} +20 -24
  243. data/lib/cybersource_rest_client/models/update_subscription.rb +219 -0
  244. data/lib/cybersource_rest_client/models/vas_v2_payments_post201_response_tax_information.rb +2 -2
  245. data/lib/cybersource_rest_client/models/vas_v2_payments_post400_response.rb +1 -1
  246. data/lib/cybersource_rest_client/models/vasv2tax_order_information_line_items.rb +1 -19
  247. data/lib/cybersource_rest_client/models/vasv2tax_order_information_order_acceptance.rb +5 -5
  248. data/lib/cybersource_rest_client/models/vasv2tax_order_information_order_origin.rb +5 -5
  249. data/lib/cybersource_rest_client/models/vasv2tax_order_information_ship_to.rb +1 -1
  250. data/lib/cybersource_rest_client/models/vasv2tax_tax_information.rb +3 -3
  251. data/lib/cybersource_rest_client.rb +112 -13
  252. metadata +114 -15
  253. data/lib/cybersource_rest_client/api/key_generation_api.rb +0 -96
  254. data/lib/cybersource_rest_client/api/tokenization_api.rb +0 -89
@@ -0,0 +1,280 @@
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 InlineResponse20012EmbeddedBatches
17
+ attr_accessor :_links
18
+
19
+ # Unique identification number assigned to the submitted request.
20
+ attr_accessor :batch_id
21
+
22
+ # ISO-8601 format: yyyy-MM-ddTHH:mm:ssZ
23
+ attr_accessor :batch_created_date
24
+
25
+ # ISO-8601 format: yyyy-MM-ddTHH:mm:ssZ
26
+ attr_accessor :batch_modified_date
27
+
28
+ # Valid Values: * SCHEDULER * TOKEN_API * CREDIT_CARD_FILE_UPLOAD * AMEX_REGSITRY * AMEX_REGISTRY_API * AMEX_REGISTRY_API_SYNC * AMEX_MAINTENANCE
29
+ attr_accessor :batch_source
30
+
31
+ # Valid Values: * SECURE_STORAGE * TMS * CYBERSOURCE
32
+ attr_accessor :token_source
33
+
34
+ # Reference used by merchant to identify batch.
35
+ attr_accessor :merchant_reference
36
+
37
+ # Valid Values: * VISA * MASTERCARD * AMEX
38
+ attr_accessor :batch_ca_endpoints
39
+
40
+ # Valid Values: * REJECTED * RECEIVED * VALIDATED * DECLINED * PROCESSING * COMPLETE
41
+ attr_accessor :status
42
+
43
+ attr_accessor :totals
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'_links' => :'_links',
49
+ :'batch_id' => :'batchId',
50
+ :'batch_created_date' => :'batchCreatedDate',
51
+ :'batch_modified_date' => :'batchModifiedDate',
52
+ :'batch_source' => :'batchSource',
53
+ :'token_source' => :'tokenSource',
54
+ :'merchant_reference' => :'merchantReference',
55
+ :'batch_ca_endpoints' => :'batchCaEndpoints',
56
+ :'status' => :'status',
57
+ :'totals' => :'totals'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ :'_links' => :'InlineResponse20012EmbeddedLinks',
65
+ :'batch_id' => :'String',
66
+ :'batch_created_date' => :'String',
67
+ :'batch_modified_date' => :'String',
68
+ :'batch_source' => :'String',
69
+ :'token_source' => :'String',
70
+ :'merchant_reference' => :'String',
71
+ :'batch_ca_endpoints' => :'Array<String>',
72
+ :'status' => :'String',
73
+ :'totals' => :'InlineResponse20012EmbeddedTotals'
74
+ }
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
84
+
85
+ if attributes.has_key?(:'_links')
86
+ self._links = attributes[:'_links']
87
+ end
88
+
89
+ if attributes.has_key?(:'batchId')
90
+ self.batch_id = attributes[:'batchId']
91
+ end
92
+
93
+ if attributes.has_key?(:'batchCreatedDate')
94
+ self.batch_created_date = attributes[:'batchCreatedDate']
95
+ end
96
+
97
+ if attributes.has_key?(:'batchModifiedDate')
98
+ self.batch_modified_date = attributes[:'batchModifiedDate']
99
+ end
100
+
101
+ if attributes.has_key?(:'batchSource')
102
+ self.batch_source = attributes[:'batchSource']
103
+ end
104
+
105
+ if attributes.has_key?(:'tokenSource')
106
+ self.token_source = attributes[:'tokenSource']
107
+ end
108
+
109
+ if attributes.has_key?(:'merchantReference')
110
+ self.merchant_reference = attributes[:'merchantReference']
111
+ end
112
+
113
+ if attributes.has_key?(:'batchCaEndpoints')
114
+ if (value = attributes[:'batchCaEndpoints']).is_a?(Array)
115
+ self.batch_ca_endpoints = value
116
+ end
117
+ end
118
+
119
+ if attributes.has_key?(:'status')
120
+ self.status = attributes[:'status']
121
+ end
122
+
123
+ if attributes.has_key?(:'totals')
124
+ self.totals = attributes[:'totals']
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ invalid_properties = Array.new
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ true
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] merchant_reference Value to be assigned
143
+ def merchant_reference=(merchant_reference)
144
+ @merchant_reference = merchant_reference
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ _links == o._links &&
153
+ batch_id == o.batch_id &&
154
+ batch_created_date == o.batch_created_date &&
155
+ batch_modified_date == o.batch_modified_date &&
156
+ batch_source == o.batch_source &&
157
+ token_source == o.token_source &&
158
+ merchant_reference == o.merchant_reference &&
159
+ batch_ca_endpoints == o.batch_ca_endpoints &&
160
+ status == o.status &&
161
+ totals == o.totals
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Fixnum] Hash code
172
+ def hash
173
+ [_links, batch_id, batch_created_date, batch_modified_date, batch_source, token_source, merchant_reference, batch_ca_endpoints, status, totals].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ self.class.swagger_types.each_pair do |key, type|
182
+ if type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :DateTime
203
+ DateTime.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :BOOLEAN
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ temp_model = CyberSource.const_get(type).new
234
+ temp_model.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ next if value.nil?
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+ end
280
+ end
@@ -0,0 +1,219 @@
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 InlineResponse20012EmbeddedTotals
17
+ attr_accessor :accepted_records
18
+
19
+ attr_accessor :rejected_records
20
+
21
+ attr_accessor :updated_records
22
+
23
+ attr_accessor :ca_responses
24
+
25
+ attr_accessor :ca_responses_omitted
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'accepted_records' => :'acceptedRecords',
31
+ :'rejected_records' => :'rejectedRecords',
32
+ :'updated_records' => :'updatedRecords',
33
+ :'ca_responses' => :'caResponses',
34
+ :'ca_responses_omitted' => :'caResponsesOmitted'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'accepted_records' => :'Integer',
42
+ :'rejected_records' => :'Integer',
43
+ :'updated_records' => :'Integer',
44
+ :'ca_responses' => :'Integer',
45
+ :'ca_responses_omitted' => :'Integer'
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?(:'acceptedRecords')
58
+ self.accepted_records = attributes[:'acceptedRecords']
59
+ end
60
+
61
+ if attributes.has_key?(:'rejectedRecords')
62
+ self.rejected_records = attributes[:'rejectedRecords']
63
+ end
64
+
65
+ if attributes.has_key?(:'updatedRecords')
66
+ self.updated_records = attributes[:'updatedRecords']
67
+ end
68
+
69
+ if attributes.has_key?(:'caResponses')
70
+ self.ca_responses = attributes[:'caResponses']
71
+ end
72
+
73
+ if attributes.has_key?(:'caResponsesOmitted')
74
+ self.ca_responses_omitted = attributes[:'caResponsesOmitted']
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ accepted_records == o.accepted_records &&
97
+ rejected_records == o.rejected_records &&
98
+ updated_records == o.updated_records &&
99
+ ca_responses == o.ca_responses &&
100
+ ca_responses_omitted == o.ca_responses_omitted
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Fixnum] Hash code
111
+ def hash
112
+ [accepted_records, rejected_records, updated_records, ca_responses, ca_responses_omitted].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.swagger_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ temp_model = CyberSource.const_get(type).new
173
+ temp_model.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ next if value.nil?
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+ end
219
+ end
@@ -0,0 +1,193 @@
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 InlineResponse20012Links
17
+ # Valid Values: * self * first * last * prev * next
18
+ attr_accessor :rel
19
+
20
+ attr_accessor :href
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'rel' => :'rel',
26
+ :'href' => :'href'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'rel' => :'String',
34
+ :'href' => :'String'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'rel')
47
+ self.rel = attributes[:'rel']
48
+ end
49
+
50
+ if attributes.has_key?(:'href')
51
+ self.href = attributes[:'href']
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ rel == o.rel &&
74
+ href == o.href
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Fixnum] Hash code
85
+ def hash
86
+ [rel, href].hash
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def build_from_hash(attributes)
93
+ return nil unless attributes.is_a?(Hash)
94
+ self.class.swagger_types.each_pair do |key, type|
95
+ if type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
99
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
104
+ end
105
+
106
+ self
107
+ end
108
+
109
+ # Deserializes the data based on type
110
+ # @param string type Data type
111
+ # @param string value Value to be deserialized
112
+ # @return [Object] Deserialized data
113
+ def _deserialize(type, value)
114
+ case type.to_sym
115
+ when :DateTime
116
+ DateTime.parse(value)
117
+ when :Date
118
+ Date.parse(value)
119
+ when :String
120
+ value.to_s
121
+ when :Integer
122
+ value.to_i
123
+ when :Float
124
+ value.to_f
125
+ when :BOOLEAN
126
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
+ true
128
+ else
129
+ false
130
+ end
131
+ when :Object
132
+ # generic object (usually a Hash), return directly
133
+ value
134
+ when /\AArray<(?<inner_type>.+)>\z/
135
+ inner_type = Regexp.last_match[:inner_type]
136
+ value.map { |v| _deserialize(inner_type, v) }
137
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
138
+ k_type = Regexp.last_match[:k_type]
139
+ v_type = Regexp.last_match[:v_type]
140
+ {}.tap do |hash|
141
+ value.each do |k, v|
142
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
143
+ end
144
+ end
145
+ else # model
146
+ temp_model = CyberSource.const_get(type).new
147
+ temp_model.build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ next if value.nil?
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+ end
193
+ end