first_data_gateway 1.0.3 → 1.1.0

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 (387) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/README.md +144 -65
  4. data/Rakefile +2 -0
  5. data/docs/AVSResponse.md +9 -0
  6. data/docs/AccessTokenResponse.md +2 -3
  7. data/docs/AdditionalAmountRate.md +9 -0
  8. data/docs/AdditionalTransactionDetails.md +10 -0
  9. data/docs/Address.md +5 -5
  10. data/docs/Airline.md +14 -14
  11. data/docs/AirlineAncillaryServiceCategory.md +2 -2
  12. data/docs/AirlineTravelRoute.md +8 -8
  13. data/docs/AliPay.md +11 -0
  14. data/docs/Amount.md +2 -2
  15. data/docs/AmountComponents.md +8 -8
  16. data/docs/AuthenticationApi.md +19 -24
  17. data/docs/AuthenticationRequest.md +9 -0
  18. data/docs/AuthenticationResponseVerification.md +5 -4
  19. data/docs/AuthenticationResponseVerificationRequest.md +11 -0
  20. data/docs/BasicResponse.md +10 -0
  21. data/docs/BasketItem.md +2 -2
  22. data/docs/Billing.md +6 -5
  23. data/docs/BillingAddress.md +17 -0
  24. data/docs/BillingAddressPhone.md +9 -0
  25. data/docs/CarRental.md +9 -9
  26. data/docs/CarRentalExtraCharges.md +2 -2
  27. data/docs/Card.md +15 -0
  28. data/docs/CardInfo.md +13 -0
  29. data/docs/CardInfoLookupApi.md +68 -0
  30. data/docs/CardInfoLookupRequest.md +9 -0
  31. data/docs/CardInfoLookupResponse.md +12 -0
  32. data/docs/CardVerificationApi.md +68 -0
  33. data/docs/CardVerificationRequest.md +9 -0
  34. data/docs/CardVerificationsTransaction.md +2 -2
  35. data/docs/ChinaDomestic.md +15 -0
  36. data/docs/ClientLocale.md +3 -3
  37. data/docs/Contact.md +5 -5
  38. data/docs/CurrencyConversionApi.md +68 -0
  39. data/docs/Customer.md +19 -0
  40. data/docs/CustomerAddress.md +14 -0
  41. data/docs/CustomerAddressPhone.md +9 -0
  42. data/docs/Dcc.md +9 -0
  43. data/docs/Device.md +19 -0
  44. data/docs/DeviceNetworks.md +21 -0
  45. data/docs/Document.md +9 -0
  46. data/docs/Error.md +1 -1
  47. data/docs/ErrorDetails.md +1 -1
  48. data/docs/ErrorResponse.md +4 -4
  49. data/docs/ExchangeRateRequest.md +12 -0
  50. data/docs/ExchangeRateResponse.md +21 -0
  51. data/docs/Expiration.md +3 -3
  52. data/docs/FraudDetectApi.md +68 -0
  53. data/docs/FraudOrder.md +10 -0
  54. data/docs/FraudOrderItems.md +15 -0
  55. data/docs/FraudOrderShipToAddress.md +14 -0
  56. data/docs/Frequency.md +3 -3
  57. data/docs/IndustrySpecificExtensions.md +1 -1
  58. data/docs/InstallmentOptions.md +1 -1
  59. data/docs/Lodging.md +3 -3
  60. data/docs/LodgingExtraCharges.md +1 -1
  61. data/docs/Loyalty.md +10 -0
  62. data/docs/Merchant.md +11 -0
  63. data/docs/MerchantLocation.md +12 -0
  64. data/docs/MerchantLocationMerchantAddress.md +13 -0
  65. data/docs/Order.md +2 -2
  66. data/docs/OrderApi.md +107 -55
  67. data/docs/OrderErrorResponse.md +19 -0
  68. data/docs/OrderResponse.md +18 -0
  69. data/docs/PayPal.md +1 -1
  70. data/docs/Payment.md +18 -0
  71. data/docs/PaymentApi.md +164 -124
  72. data/docs/PaymentCard.md +10 -6
  73. data/docs/PaymentCardAuthenticationResult.md +1 -1
  74. data/docs/PaymentFacilitator.md +12 -0
  75. data/docs/PaymentIssuerResponse.md +10 -0
  76. data/docs/PaymentMethod.md +5 -2
  77. data/docs/PaymentPayMethod.md +13 -0
  78. data/docs/PaymentSchedulesApi.md +256 -0
  79. data/docs/PaymentSchedulesErrorResponse.md +14 -0
  80. data/docs/PaymentSchedulesRequest.md +10 -7
  81. data/docs/PaymentSchedulesResponse.md +7 -5
  82. data/docs/PaymentTokenApi.md +134 -0
  83. data/docs/PaymentTokenization.md +16 -0
  84. data/docs/PaymentTokenizationErrorResponse.md +19 -0
  85. data/docs/PaymentTokenizationRequest.md +11 -0
  86. data/docs/PaymentTokenizationResponse.md +18 -0
  87. data/docs/PaymentURLApi.md +68 -0
  88. data/docs/PaymentUrlErrorResponse.md +15 -0
  89. data/docs/PaymentUrlRequest.md +13 -3
  90. data/docs/PaymentUrlResponse.md +6 -5
  91. data/docs/PaymentVerification3ds.md +10 -0
  92. data/docs/PaymentVerificationAvs.md +10 -0
  93. data/docs/PaymentVerificationCvv.md +10 -0
  94. data/docs/PrimaryTransaction.md +7 -3
  95. data/docs/PrimaryTransactionAdditionalDetails.md +7 -5
  96. data/docs/ProcessorData.md +8 -4
  97. data/docs/PurchaseCards.md +9 -0
  98. data/docs/PurchaseCardsLevel2.md +12 -0
  99. data/docs/PurchaseCardsLevel3.md +8 -0
  100. data/docs/PurchaseCardsLevel3LineItems.md +16 -0
  101. data/docs/RecurringPaymentDetails.md +20 -0
  102. data/docs/RecurringPaymentDetailsResponse.md +19 -0
  103. data/docs/ReferencedOrder.md +9 -0
  104. data/docs/ResponseType.md +1 -1
  105. data/docs/ScoreOnlyRequest.md +21 -0
  106. data/docs/ScoreOnlyResponse.md +13 -0
  107. data/docs/ScoreOnlyResponseFraudScore.md +10 -0
  108. data/docs/ScoreOnlyResponseFraudScoreExplanations.md +10 -0
  109. data/docs/SecondaryTransaction.md +4 -1
  110. data/docs/SecondaryTransactionAdditionalDetails.md +8 -0
  111. data/docs/Secure3dResponse.md +8 -0
  112. data/docs/Sepa.md +1 -1
  113. data/docs/SepaMandate.md +3 -3
  114. data/docs/Shipping.md +1 -1
  115. data/docs/SoftDescriptor.md +9 -0
  116. data/docs/SplitShipment.md +3 -3
  117. data/docs/StoredCredential.md +4 -4
  118. data/docs/SubMerchantData.md +13 -0
  119. data/docs/Transaction.md +19 -0
  120. data/docs/TransactionErrorResponse.md +13 -11
  121. data/docs/TransactionOrigin.md +7 -0
  122. data/docs/TransactionResponse.md +13 -11
  123. data/docs/TransactionType.md +1 -1
  124. data/first_data_gateway.gemspec +9 -9
  125. data/git_push.sh +2 -2
  126. data/lib/openapi_client/.DS_Store +0 -0
  127. data/lib/{swagger_client → openapi_client}/api/authentication_api.rb +22 -27
  128. data/lib/openapi_client/api/card_info_lookup_api.rb +117 -0
  129. data/lib/openapi_client/api/card_verification_api.rb +117 -0
  130. data/lib/openapi_client/api/currency_conversion_api.rb +117 -0
  131. data/lib/openapi_client/api/fraud_detect_api.rb +122 -0
  132. data/lib/openapi_client/api/order_api.rb +327 -0
  133. data/lib/{swagger_client → openapi_client}/api/payment_api.rb +212 -111
  134. data/lib/openapi_client/api/payment_schedules_api.rb +411 -0
  135. data/lib/openapi_client/api/payment_token_api.rb +218 -0
  136. data/lib/openapi_client/api/payment_url_api.rb +117 -0
  137. data/lib/{swagger_client → openapi_client}/api_client.rb +50 -38
  138. data/lib/{swagger_client → openapi_client}/api_error.rb +6 -6
  139. data/lib/{swagger_client → openapi_client}/configuration.rb +49 -7
  140. data/lib/openapi_client/models/.DS_Store +0 -0
  141. data/lib/{swagger_client → openapi_client}/models/access_token_response.rb +20 -33
  142. data/lib/{swagger_client/models/secondary_transaction.rb → openapi_client/models/additional_amount_rate.rb} +25 -28
  143. data/lib/{swagger_client/models/primary_transaction_additional_details.rb → openapi_client/models/additional_transaction_details.rb} +68 -62
  144. data/lib/{swagger_client → openapi_client}/models/address.rb +33 -44
  145. data/lib/{swagger_client → openapi_client}/models/airline.rb +48 -47
  146. data/lib/{swagger_client → openapi_client}/models/airline_ancillary_service_category.rb +18 -21
  147. data/lib/{swagger_client → openapi_client}/models/airline_travel_route.rb +39 -42
  148. data/lib/openapi_client/models/ali_pay.rb +326 -0
  149. data/lib/{swagger_client → openapi_client}/models/amount.rb +18 -21
  150. data/lib/{swagger_client → openapi_client}/models/amount_components.rb +22 -19
  151. data/lib/{swagger_client/models/transaction_response_authentication_redirect.rb → openapi_client/models/authentication_request.rb} +33 -38
  152. data/lib/{swagger_client → openapi_client}/models/authentication_response_verification.rb +43 -30
  153. data/lib/{swagger_client/models/payment_url_request.rb → openapi_client/models/authentication_response_verification_request.rb} +35 -56
  154. data/lib/openapi_client/models/avs_response.rb +239 -0
  155. data/lib/openapi_client/models/basic_response.rb +209 -0
  156. data/lib/{swagger_client → openapi_client}/models/basket_item.rb +16 -20
  157. data/lib/{swagger_client → openapi_client}/models/billing.rb +65 -25
  158. data/lib/openapi_client/models/billing_address.rb +279 -0
  159. data/lib/{swagger_client/models/transaction_response_authentication_redirect_params.rb → openapi_client/models/billing_address_phone.rb} +31 -42
  160. data/lib/{swagger_client → openapi_client}/models/car_rental.rb +31 -31
  161. data/lib/{swagger_client → openapi_client}/models/car_rental_extra_charges.rb +18 -21
  162. data/lib/openapi_client/models/card.rb +254 -0
  163. data/lib/{swagger_client/models/payment_card.rb → openapi_client/models/card_info.rb} +68 -81
  164. data/lib/openapi_client/models/card_info_lookup_request.rb +214 -0
  165. data/lib/openapi_client/models/card_info_lookup_response.rb +265 -0
  166. data/lib/openapi_client/models/card_verification_request.rb +198 -0
  167. data/lib/{swagger_client → openapi_client}/models/card_verifications_transaction.rb +31 -20
  168. data/lib/openapi_client/models/china_domestic.rb +386 -0
  169. data/lib/{swagger_client → openapi_client}/models/client_locale.rb +19 -23
  170. data/lib/{swagger_client → openapi_client}/models/contact.rb +26 -31
  171. data/lib/openapi_client/models/customer.rb +333 -0
  172. data/lib/openapi_client/models/customer_address.rb +259 -0
  173. data/lib/openapi_client/models/customer_address_phone.rb +195 -0
  174. data/lib/openapi_client/models/dcc.rb +200 -0
  175. data/lib/openapi_client/models/device.rb +340 -0
  176. data/lib/openapi_client/models/device_networks.rb +353 -0
  177. data/lib/{swagger_client/models/payment_card_authentication_request.rb → openapi_client/models/document.rb} +62 -26
  178. data/lib/{swagger_client → openapi_client}/models/error.rb +14 -18
  179. data/lib/{swagger_client → openapi_client}/models/error_details.rb +14 -19
  180. data/lib/{swagger_client → openapi_client}/models/error_response.rb +22 -22
  181. data/lib/openapi_client/models/exchange_rate_request.rb +307 -0
  182. data/lib/openapi_client/models/exchange_rate_response.rb +319 -0
  183. data/lib/{swagger_client → openapi_client}/models/expiration.rb +18 -20
  184. data/lib/openapi_client/models/fraud_order.rb +206 -0
  185. data/lib/openapi_client/models/fraud_order_items.rb +253 -0
  186. data/lib/openapi_client/models/fraud_order_ship_to_address.rb +245 -0
  187. data/lib/{swagger_client → openapi_client}/models/frequency.rb +27 -30
  188. data/lib/{swagger_client → openapi_client}/models/industry_specific_extensions.rb +15 -19
  189. data/lib/{swagger_client → openapi_client}/models/installment_options.rb +22 -28
  190. data/lib/{swagger_client → openapi_client}/models/lodging.rb +19 -22
  191. data/lib/{swagger_client → openapi_client}/models/lodging_extra_charges.rb +17 -21
  192. data/lib/openapi_client/models/loyalty.rb +205 -0
  193. data/lib/openapi_client/models/merchant.rb +219 -0
  194. data/lib/openapi_client/models/merchant_location.rb +224 -0
  195. data/lib/openapi_client/models/merchant_location_merchant_address.rb +250 -0
  196. data/lib/{swagger_client/models/processor_data.rb → openapi_client/models/order.rb} +49 -47
  197. data/lib/openapi_client/models/order_error_response.rb +296 -0
  198. data/lib/openapi_client/models/order_response.rb +287 -0
  199. data/lib/{swagger_client → openapi_client}/models/pay_pal.rb +19 -23
  200. data/lib/openapi_client/models/payment.rb +346 -0
  201. data/lib/openapi_client/models/payment_card.rb +363 -0
  202. data/lib/{swagger_client → openapi_client}/models/payment_card_authentication_result.rb +32 -37
  203. data/lib/openapi_client/models/payment_facilitator.rb +292 -0
  204. data/lib/openapi_client/models/payment_issuer_response.rb +249 -0
  205. data/lib/openapi_client/models/payment_method.rb +278 -0
  206. data/lib/openapi_client/models/payment_pay_method.rb +278 -0
  207. data/lib/openapi_client/models/payment_schedules_error_response.rb +281 -0
  208. data/lib/{swagger_client → openapi_client}/models/payment_schedules_request.rb +83 -80
  209. data/lib/openapi_client/models/payment_schedules_response.rb +272 -0
  210. data/lib/openapi_client/models/payment_tokenization.rb +327 -0
  211. data/lib/openapi_client/models/payment_tokenization_error_response.rb +329 -0
  212. data/lib/{swagger_client/models/payment_method.rb → openapi_client/models/payment_tokenization_request.rb} +34 -37
  213. data/lib/openapi_client/models/payment_tokenization_response.rb +319 -0
  214. data/lib/openapi_client/models/payment_url_error_response.rb +292 -0
  215. data/lib/openapi_client/models/payment_url_request.rb +335 -0
  216. data/lib/{swagger_client → openapi_client}/models/payment_url_response.rb +35 -38
  217. data/lib/openapi_client/models/payment_verification3ds.rb +215 -0
  218. data/lib/openapi_client/models/payment_verification_avs.rb +215 -0
  219. data/lib/openapi_client/models/payment_verification_cvv.rb +215 -0
  220. data/lib/{swagger_client → openapi_client}/models/primary_transaction.rb +93 -31
  221. data/lib/openapi_client/models/primary_transaction_additional_details.rb +352 -0
  222. data/lib/openapi_client/models/processor_data.rb +272 -0
  223. data/lib/openapi_client/models/purchase_cards.rb +192 -0
  224. data/lib/openapi_client/models/purchase_cards_level2.rb +267 -0
  225. data/lib/openapi_client/models/purchase_cards_level3.rb +186 -0
  226. data/lib/openapi_client/models/purchase_cards_level3_line_items.rb +337 -0
  227. data/lib/openapi_client/models/recurring_payment_details.rb +399 -0
  228. data/lib/openapi_client/models/recurring_payment_details_response.rb +296 -0
  229. data/lib/{swagger_client/models/order.rb → openapi_client/models/referenced_order.rb} +23 -36
  230. data/lib/openapi_client/models/response_type.rb +37 -0
  231. data/lib/openapi_client/models/score_only_request.rb +389 -0
  232. data/lib/{swagger_client/models/payment_schedules_response.rb → openapi_client/models/score_only_response.rb} +56 -56
  233. data/lib/openapi_client/models/score_only_response_fraud_score.rb +208 -0
  234. data/lib/openapi_client/models/score_only_response_fraud_score_explanations.rb +201 -0
  235. data/lib/openapi_client/models/secondary_transaction.rb +220 -0
  236. data/lib/openapi_client/models/secondary_transaction_additional_details.rb +183 -0
  237. data/lib/openapi_client/models/secure3d_response.rb +184 -0
  238. data/lib/{swagger_client → openapi_client}/models/sepa.rb +30 -35
  239. data/lib/{swagger_client → openapi_client}/models/sepa_mandate.rb +32 -35
  240. data/lib/{swagger_client → openapi_client}/models/shipping.rb +17 -22
  241. data/lib/openapi_client/models/soft_descriptor.rb +215 -0
  242. data/lib/{swagger_client → openapi_client}/models/split_shipment.rb +17 -21
  243. data/lib/{swagger_client → openapi_client}/models/stored_credential.rb +28 -32
  244. data/lib/openapi_client/models/sub_merchant_data.rb +302 -0
  245. data/lib/openapi_client/models/transaction.rb +337 -0
  246. data/lib/{swagger_client → openapi_client}/models/transaction_error_response.rb +110 -80
  247. data/lib/openapi_client/models/transaction_origin.rb +32 -0
  248. data/lib/{swagger_client → openapi_client}/models/transaction_response.rb +112 -82
  249. data/lib/openapi_client/models/transaction_type.rb +36 -0
  250. data/lib/openapi_client/version.rb +15 -0
  251. data/lib/openapi_client.rb +158 -0
  252. data/lib/simple/client_context.rb +2 -2
  253. data/lib/simple/gateway.rb +274 -37
  254. data/spec/api/authentication_api_spec.rb +12 -12
  255. data/spec/api/card_info_lookup_api_spec.rb +53 -0
  256. data/spec/api/card_verification_api_spec.rb +53 -0
  257. data/spec/api/currency_conversion_api_spec.rb +53 -0
  258. data/spec/api/fraud_detect_api_spec.rb +53 -0
  259. data/spec/api/order_api_spec.rb +44 -23
  260. data/spec/api/payment_api_spec.rb +50 -26
  261. data/spec/api/payment_schedules_api_spec.rb +111 -0
  262. data/spec/api/payment_token_api_spec.rb +74 -0
  263. data/spec/api/payment_url_api_spec.rb +53 -0
  264. data/spec/api_client_spec.rb +66 -66
  265. data/spec/configuration_spec.rb +15 -15
  266. data/spec/models/access_token_response_spec.rb +16 -23
  267. data/spec/models/additional_amount_rate_spec.rb +47 -0
  268. data/spec/models/additional_transaction_details_spec.rb +53 -0
  269. data/spec/models/address_spec.rb +16 -17
  270. data/spec/models/airline_ancillary_service_category_spec.rb +14 -15
  271. data/spec/models/airline_spec.rb +27 -28
  272. data/spec/models/airline_travel_route_spec.rb +22 -23
  273. data/spec/models/ali_pay_spec.rb +63 -0
  274. data/spec/models/amount_components_spec.rb +16 -17
  275. data/spec/models/amount_spec.rb +12 -13
  276. data/spec/models/authentication_request_spec.rb +51 -0
  277. data/spec/models/authentication_response_verification_request_spec.rb +59 -0
  278. data/spec/models/authentication_response_verification_spec.rb +23 -18
  279. data/spec/models/avs_response_spec.rb +55 -0
  280. data/spec/models/basic_response_spec.rb +53 -0
  281. data/spec/models/basket_item_spec.rb +13 -14
  282. data/spec/models/billing_address_phone_spec.rb +47 -0
  283. data/spec/models/billing_address_spec.rb +95 -0
  284. data/spec/models/billing_spec.rb +25 -20
  285. data/spec/models/car_rental_extra_charges_spec.rb +14 -15
  286. data/spec/models/car_rental_spec.rb +17 -18
  287. data/spec/models/card_info_lookup_request_spec.rb +47 -0
  288. data/spec/models/card_info_lookup_response_spec.rb +69 -0
  289. data/spec/models/card_info_spec.rb +79 -0
  290. data/spec/models/card_spec.rb +83 -0
  291. data/spec/models/card_verification_request_spec.rb +47 -0
  292. data/spec/models/card_verifications_transaction_spec.rb +11 -12
  293. data/spec/models/china_domestic_spec.rb +83 -0
  294. data/spec/models/client_locale_spec.rb +11 -12
  295. data/spec/models/contact_spec.rb +13 -14
  296. data/spec/models/customer_address_phone_spec.rb +47 -0
  297. data/spec/models/customer_address_spec.rb +77 -0
  298. data/spec/models/customer_spec.rb +111 -0
  299. data/spec/models/dcc_spec.rb +47 -0
  300. data/spec/models/device_networks_spec.rb +123 -0
  301. data/spec/models/device_spec.rb +111 -0
  302. data/spec/models/document_spec.rb +51 -0
  303. data/spec/models/error_details_spec.rb +11 -12
  304. data/spec/models/error_response_spec.rb +13 -14
  305. data/spec/models/error_spec.rb +12 -13
  306. data/spec/models/exchange_rate_request_spec.rb +69 -0
  307. data/spec/models/exchange_rate_response_spec.rb +119 -0
  308. data/spec/models/expiration_spec.rb +11 -12
  309. data/spec/models/fraud_order_items_spec.rb +83 -0
  310. data/spec/models/fraud_order_ship_to_address_spec.rb +77 -0
  311. data/spec/models/fraud_order_spec.rb +53 -0
  312. data/spec/models/frequency_spec.rb +15 -16
  313. data/spec/models/industry_specific_extensions_spec.rb +12 -13
  314. data/spec/models/installment_options_spec.rb +12 -13
  315. data/spec/models/lodging_extra_charges_spec.rb +14 -15
  316. data/spec/models/lodging_spec.rb +14 -15
  317. data/spec/models/loyalty_spec.rb +53 -0
  318. data/spec/models/merchant_location_merchant_address_spec.rb +71 -0
  319. data/spec/models/merchant_location_spec.rb +65 -0
  320. data/spec/models/merchant_spec.rb +59 -0
  321. data/spec/models/order_error_response_spec.rb +107 -0
  322. data/spec/models/order_response_spec.rb +101 -0
  323. data/spec/models/order_spec.rb +12 -13
  324. data/spec/models/pay_pal_spec.rb +10 -11
  325. data/spec/models/payment_card_authentication_result_spec.rb +26 -27
  326. data/spec/models/payment_card_spec.rb +41 -22
  327. data/spec/models/payment_facilitator_spec.rb +65 -0
  328. data/spec/models/payment_issuer_response_spec.rb +57 -0
  329. data/spec/models/payment_method_spec.rb +35 -18
  330. data/spec/models/payment_pay_method_spec.rb +75 -0
  331. data/spec/models/payment_schedules_error_response_spec.rb +81 -0
  332. data/spec/models/payment_schedules_request_spec.rb +43 -30
  333. data/spec/models/payment_schedules_response_spec.rb +30 -19
  334. data/spec/models/payment_spec.rb +109 -0
  335. data/spec/models/payment_tokenization_error_response_spec.rb +111 -0
  336. data/spec/models/payment_tokenization_request_spec.rb +63 -0
  337. data/spec/models/payment_tokenization_response_spec.rb +105 -0
  338. data/spec/models/payment_tokenization_spec.rb +93 -0
  339. data/spec/models/payment_url_error_response_spec.rb +87 -0
  340. data/spec/models/payment_url_request_spec.rb +73 -14
  341. data/spec/models/payment_url_response_spec.rb +25 -20
  342. data/spec/models/payment_verification3ds_spec.rb +53 -0
  343. data/spec/models/payment_verification_avs_spec.rb +53 -0
  344. data/spec/models/payment_verification_cvv_spec.rb +53 -0
  345. data/spec/models/primary_transaction_additional_details_spec.rb +28 -17
  346. data/spec/models/primary_transaction_spec.rb +45 -22
  347. data/spec/models/processor_data_spec.rb +41 -14
  348. data/spec/models/purchase_cards_level2_spec.rb +65 -0
  349. data/spec/models/purchase_cards_level3_line_items_spec.rb +89 -0
  350. data/spec/models/purchase_cards_level3_spec.rb +41 -0
  351. data/spec/models/purchase_cards_spec.rb +47 -0
  352. data/spec/models/recurring_payment_details_response_spec.rb +107 -0
  353. data/spec/models/recurring_payment_details_spec.rb +117 -0
  354. data/spec/models/referenced_order_spec.rb +47 -0
  355. data/spec/models/response_type_spec.rb +9 -10
  356. data/spec/models/score_only_request_spec.rb +127 -0
  357. data/spec/models/score_only_response_fraud_score_explanations_spec.rb +53 -0
  358. data/spec/models/score_only_response_fraud_score_spec.rb +53 -0
  359. data/spec/models/score_only_response_spec.rb +75 -0
  360. data/spec/models/secondary_transaction_additional_details_spec.rb +41 -0
  361. data/spec/models/secondary_transaction_spec.rb +29 -12
  362. data/spec/models/secure3d_response_spec.rb +41 -0
  363. data/spec/models/sepa_mandate_spec.rb +17 -18
  364. data/spec/models/sepa_spec.rb +14 -15
  365. data/spec/models/shipping_spec.rb +12 -13
  366. data/spec/models/soft_descriptor_spec.rb +47 -0
  367. data/spec/models/split_shipment_spec.rb +11 -12
  368. data/spec/models/stored_credential_spec.rb +21 -22
  369. data/spec/models/sub_merchant_data_spec.rb +71 -0
  370. data/spec/models/transaction_error_response_spec.rb +62 -51
  371. data/spec/models/transaction_origin_spec.rb +35 -0
  372. data/spec/models/transaction_response_spec.rb +61 -50
  373. data/spec/models/transaction_spec.rb +115 -0
  374. data/spec/models/transaction_type_spec.rb +9 -10
  375. data/spec/spec_helper.rb +6 -6
  376. metadata +339 -69
  377. data/docs/PaymentCardAuthenticationRequest.md +0 -8
  378. data/docs/TransactionResponseAuthenticationRedirect.md +0 -10
  379. data/docs/TransactionResponseAuthenticationRedirectParams.md +0 -10
  380. data/lib/swagger_client/api/order_api.rb +0 -229
  381. data/lib/swagger_client/models/response_type.rb +0 -37
  382. data/lib/swagger_client/models/transaction_type.rb +0 -36
  383. data/lib/swagger_client/version.rb +0 -15
  384. data/lib/swagger_client.rb +0 -91
  385. data/spec/models/payment_card_authentication_request_spec.rb +0 -46
  386. data/spec/models/transaction_response_authentication_redirect_params_spec.rb +0 -54
  387. data/spec/models/transaction_response_authentication_redirect_spec.rb +0 -58
@@ -1,37 +1,44 @@
1
1
  =begin
2
- #Payment Gateway API Specification
2
+ #Payment Gateway API Specification.
3
3
 
4
- #Payment Gateway API for payment processing.
4
+ #Payment Gateway API for payment processing. Version 6.4.0.20181018.001
5
5
 
6
- OpenAPI spec version: 0.0.1
6
+ OpenAPI spec version: 6.4.0.20181018.001
7
7
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: unset
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: unset
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
- module SwaggerClient
16
-
15
+ module OpenapiClient
16
+ # Object holding additional information about the route
17
17
  class AirlineTravelRoute
18
18
  # Date of departure
19
19
  attr_accessor :departure_date
20
20
 
21
+ # The IATA code for the departure airport.
21
22
  attr_accessor :origin
22
23
 
24
+ # The IATA code for the destination airport.
23
25
  attr_accessor :destination
24
26
 
27
+ # The IATA code for the carrier.
25
28
  attr_accessor :carrier_code
26
29
 
30
+ # The airline code for the service class of the ticket.
27
31
  attr_accessor :service_class
28
32
 
33
+ # Indicates whether the route is direct or not.
29
34
  attr_accessor :stopover_type
30
35
 
36
+ # The airline fare basis code.
31
37
  attr_accessor :fare_basis_code
32
38
 
33
39
  attr_accessor :departure_tax
34
40
 
41
+ # The airline flight number associated with the ticket.
35
42
  attr_accessor :flight_number
36
43
 
37
44
  class EnumAttributeValidator
@@ -72,7 +79,7 @@ module SwaggerClient
72
79
  end
73
80
 
74
81
  # Attribute type mapping.
75
- def self.swagger_types
82
+ def self.openapi_types
76
83
  {
77
84
  :'departure_date' => :'Date',
78
85
  :'origin' => :'String',
@@ -92,7 +99,7 @@ module SwaggerClient
92
99
  return unless attributes.is_a?(Hash)
93
100
 
94
101
  # convert string to symbol for hash key
95
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
102
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
96
103
 
97
104
  if attributes.has_key?(:'departureDate')
98
105
  self.departure_date = attributes[:'departureDate']
@@ -129,7 +136,6 @@ module SwaggerClient
129
136
  if attributes.has_key?(:'flightNumber')
130
137
  self.flight_number = attributes[:'flightNumber']
131
138
  end
132
-
133
139
  end
134
140
 
135
141
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -137,34 +143,34 @@ module SwaggerClient
137
143
  def list_invalid_properties
138
144
  invalid_properties = Array.new
139
145
  if !@origin.nil? && @origin.to_s.length > 3
140
- invalid_properties.push("invalid value for 'origin', the character length must be smaller than or equal to 3.")
146
+ invalid_properties.push('invalid value for "origin", the character length must be smaller than or equal to 3.')
141
147
  end
142
148
 
143
149
  if !@destination.nil? && @destination.to_s.length > 3
144
- invalid_properties.push("invalid value for 'destination', the character length must be smaller than or equal to 3.")
150
+ invalid_properties.push('invalid value for "destination", the character length must be smaller than or equal to 3.')
145
151
  end
146
152
 
147
153
  if !@carrier_code.nil? && @carrier_code.to_s.length > 2
148
- invalid_properties.push("invalid value for 'carrier_code', the character length must be smaller than or equal to 2.")
154
+ invalid_properties.push('invalid value for "carrier_code", the character length must be smaller than or equal to 2.')
149
155
  end
150
156
 
151
157
  if !@service_class.nil? && @service_class.to_s.length > 1
152
- invalid_properties.push("invalid value for 'service_class', the character length must be smaller than or equal to 1.")
158
+ invalid_properties.push('invalid value for "service_class", the character length must be smaller than or equal to 1.')
153
159
  end
154
160
 
155
161
  if !@fare_basis_code.nil? && @fare_basis_code.to_s.length > 2
156
- invalid_properties.push("invalid value for 'fare_basis_code', the character length must be smaller than or equal to 2.")
162
+ invalid_properties.push('invalid value for "fare_basis_code", the character length must be smaller than or equal to 2.')
157
163
  end
158
164
 
159
165
  if !@departure_tax.nil? && @departure_tax > 999999999999
160
- invalid_properties.push("invalid value for 'departure_tax', must be smaller than or equal to 999999999999.")
166
+ invalid_properties.push('invalid value for "departure_tax", must be smaller than or equal to 999999999999.')
161
167
  end
162
168
 
163
169
  if !@flight_number.nil? && @flight_number.to_s.length > 10
164
- invalid_properties.push("invalid value for 'flight_number', the character length must be smaller than or equal to 10.")
170
+ invalid_properties.push('invalid value for "flight_number", the character length must be smaller than or equal to 10.')
165
171
  end
166
172
 
167
- return invalid_properties
173
+ invalid_properties
168
174
  end
169
175
 
170
176
  # Check to see if the all the properties in the model are valid
@@ -174,20 +180,19 @@ module SwaggerClient
174
180
  return false if !@destination.nil? && @destination.to_s.length > 3
175
181
  return false if !@carrier_code.nil? && @carrier_code.to_s.length > 2
176
182
  return false if !@service_class.nil? && @service_class.to_s.length > 1
177
- stopover_type_validator = EnumAttributeValidator.new('String', ["DIRECT", "STOPOVER"])
183
+ stopover_type_validator = EnumAttributeValidator.new('String', ['DIRECT', 'STOPOVER'])
178
184
  return false unless stopover_type_validator.valid?(@stopover_type)
179
185
  return false if !@fare_basis_code.nil? && @fare_basis_code.to_s.length > 2
180
186
  return false if !@departure_tax.nil? && @departure_tax > 999999999999
181
187
  return false if !@flight_number.nil? && @flight_number.to_s.length > 10
182
- return true
188
+ true
183
189
  end
184
190
 
185
191
  # Custom attribute writer method with validation
186
192
  # @param [Object] origin Value to be assigned
187
193
  def origin=(origin)
188
-
189
194
  if !origin.nil? && origin.to_s.length > 3
190
- fail ArgumentError, "invalid value for 'origin', the character length must be smaller than or equal to 3."
195
+ fail ArgumentError, 'invalid value for "origin", the character length must be smaller than or equal to 3.'
191
196
  end
192
197
 
193
198
  @origin = origin
@@ -196,9 +201,8 @@ module SwaggerClient
196
201
  # Custom attribute writer method with validation
197
202
  # @param [Object] destination Value to be assigned
198
203
  def destination=(destination)
199
-
200
204
  if !destination.nil? && destination.to_s.length > 3
201
- fail ArgumentError, "invalid value for 'destination', the character length must be smaller than or equal to 3."
205
+ fail ArgumentError, 'invalid value for "destination", the character length must be smaller than or equal to 3.'
202
206
  end
203
207
 
204
208
  @destination = destination
@@ -207,9 +211,8 @@ module SwaggerClient
207
211
  # Custom attribute writer method with validation
208
212
  # @param [Object] carrier_code Value to be assigned
209
213
  def carrier_code=(carrier_code)
210
-
211
214
  if !carrier_code.nil? && carrier_code.to_s.length > 2
212
- fail ArgumentError, "invalid value for 'carrier_code', the character length must be smaller than or equal to 2."
215
+ fail ArgumentError, 'invalid value for "carrier_code", the character length must be smaller than or equal to 2.'
213
216
  end
214
217
 
215
218
  @carrier_code = carrier_code
@@ -218,9 +221,8 @@ module SwaggerClient
218
221
  # Custom attribute writer method with validation
219
222
  # @param [Object] service_class Value to be assigned
220
223
  def service_class=(service_class)
221
-
222
224
  if !service_class.nil? && service_class.to_s.length > 1
223
- fail ArgumentError, "invalid value for 'service_class', the character length must be smaller than or equal to 1."
225
+ fail ArgumentError, 'invalid value for "service_class", the character length must be smaller than or equal to 1.'
224
226
  end
225
227
 
226
228
  @service_class = service_class
@@ -229,9 +231,9 @@ module SwaggerClient
229
231
  # Custom attribute writer method checking allowed values (enum).
230
232
  # @param [Object] stopover_type Object to be assigned
231
233
  def stopover_type=(stopover_type)
232
- validator = EnumAttributeValidator.new('String', ["DIRECT", "STOPOVER"])
234
+ validator = EnumAttributeValidator.new('String', ['DIRECT', 'STOPOVER'])
233
235
  unless validator.valid?(stopover_type)
234
- fail ArgumentError, "invalid value for 'stopover_type', must be one of #{validator.allowable_values}."
236
+ fail ArgumentError, 'invalid value for "stopover_type", must be one of #{validator.allowable_values}.'
235
237
  end
236
238
  @stopover_type = stopover_type
237
239
  end
@@ -239,9 +241,8 @@ module SwaggerClient
239
241
  # Custom attribute writer method with validation
240
242
  # @param [Object] fare_basis_code Value to be assigned
241
243
  def fare_basis_code=(fare_basis_code)
242
-
243
244
  if !fare_basis_code.nil? && fare_basis_code.to_s.length > 2
244
- fail ArgumentError, "invalid value for 'fare_basis_code', the character length must be smaller than or equal to 2."
245
+ fail ArgumentError, 'invalid value for "fare_basis_code", the character length must be smaller than or equal to 2.'
245
246
  end
246
247
 
247
248
  @fare_basis_code = fare_basis_code
@@ -250,9 +251,8 @@ module SwaggerClient
250
251
  # Custom attribute writer method with validation
251
252
  # @param [Object] departure_tax Value to be assigned
252
253
  def departure_tax=(departure_tax)
253
-
254
254
  if !departure_tax.nil? && departure_tax > 999999999999
255
- fail ArgumentError, "invalid value for 'departure_tax', must be smaller than or equal to 999999999999."
255
+ fail ArgumentError, 'invalid value for "departure_tax", must be smaller than or equal to 999999999999.'
256
256
  end
257
257
 
258
258
  @departure_tax = departure_tax
@@ -261,9 +261,8 @@ module SwaggerClient
261
261
  # Custom attribute writer method with validation
262
262
  # @param [Object] flight_number Value to be assigned
263
263
  def flight_number=(flight_number)
264
-
265
264
  if !flight_number.nil? && flight_number.to_s.length > 10
266
- fail ArgumentError, "invalid value for 'flight_number', the character length must be smaller than or equal to 10."
265
+ fail ArgumentError, 'invalid value for "flight_number", the character length must be smaller than or equal to 10.'
267
266
  end
268
267
 
269
268
  @flight_number = flight_number
@@ -302,12 +301,12 @@ module SwaggerClient
302
301
  # @return [Object] Returns the model itself
303
302
  def build_from_hash(attributes)
304
303
  return nil unless attributes.is_a?(Hash)
305
- self.class.swagger_types.each_pair do |key, type|
304
+ self.class.openapi_types.each_pair do |key, type|
306
305
  if type =~ /\AArray<(.*)>/i
307
306
  # check to ensure the input is an array given that the the attribute
308
307
  # is documented as an array but the input is not
309
308
  if attributes[self.class.attribute_map[key]].is_a?(Array)
310
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
309
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
311
310
  end
312
311
  elsif !attributes[self.class.attribute_map[key]].nil?
313
312
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -354,7 +353,7 @@ module SwaggerClient
354
353
  end
355
354
  end
356
355
  else # model
357
- temp_model = SwaggerClient.const_get(type).new
356
+ temp_model = OpenapiClient.const_get(type).new
358
357
  temp_model.build_from_hash(value)
359
358
  end
360
359
  end
@@ -389,7 +388,7 @@ module SwaggerClient
389
388
  # @return [Hash] Returns the value in the form of hash
390
389
  def _to_hash(value)
391
390
  if value.is_a?(Array)
392
- value.compact.map{ |v| _to_hash(v) }
391
+ value.compact.map { |v| _to_hash(v) }
393
392
  elsif value.is_a?(Hash)
394
393
  {}.tap do |hash|
395
394
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -400,7 +399,5 @@ module SwaggerClient
400
399
  value
401
400
  end
402
401
  end
403
-
404
402
  end
405
-
406
403
  end
@@ -0,0 +1,326 @@
1
+ =begin
2
+ #Payment Gateway API Specification.
3
+
4
+ #Payment Gateway API for payment processing. Version 6.4.0.20181018.001
5
+
6
+ OpenAPI spec version: 6.4.0.20181018.001
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OpenapiClient
16
+ # The payment object for AliPay transactions. Use this to populate Alipay payment method details.
17
+ class AliPay
18
+ # Use this to indicate the type of machine-readable payment data for scanning.
19
+ attr_accessor :payment_data_type
20
+
21
+ # Use this to send payment related information, such as customer identity ID.
22
+ attr_accessor :payment_data
23
+
24
+ # Use this to send an order title that shows up in the statement
25
+ attr_accessor :order_title
26
+
27
+ # Use this to send order details that show up in the statement
28
+ attr_accessor :order_details
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'payment_data_type' => :'paymentDataType',
56
+ :'payment_data' => :'paymentData',
57
+ :'order_title' => :'orderTitle',
58
+ :'order_details' => :'orderDetails'
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'payment_data_type' => :'String',
66
+ :'payment_data' => :'String',
67
+ :'order_title' => :'String',
68
+ :'order_details' => :'String'
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
79
+
80
+ if attributes.has_key?(:'paymentDataType')
81
+ self.payment_data_type = attributes[:'paymentDataType']
82
+ end
83
+
84
+ if attributes.has_key?(:'paymentData')
85
+ self.payment_data = attributes[:'paymentData']
86
+ end
87
+
88
+ if attributes.has_key?(:'orderTitle')
89
+ self.order_title = attributes[:'orderTitle']
90
+ end
91
+
92
+ if attributes.has_key?(:'orderDetails')
93
+ self.order_details = attributes[:'orderDetails']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @payment_data_type.nil?
102
+ invalid_properties.push('invalid value for "payment_data_type", payment_data_type cannot be nil.')
103
+ end
104
+
105
+ if @payment_data.nil?
106
+ invalid_properties.push('invalid value for "payment_data", payment_data cannot be nil.')
107
+ end
108
+
109
+ if @payment_data.to_s.length > 100
110
+ invalid_properties.push('invalid value for "payment_data", the character length must be smaller than or equal to 100.')
111
+ end
112
+
113
+ if @order_title.nil?
114
+ invalid_properties.push('invalid value for "order_title", order_title cannot be nil.')
115
+ end
116
+
117
+ if @order_title.to_s.length > 100
118
+ invalid_properties.push('invalid value for "order_title", the character length must be smaller than or equal to 100.')
119
+ end
120
+
121
+ if @order_details.nil?
122
+ invalid_properties.push('invalid value for "order_details", order_details cannot be nil.')
123
+ end
124
+
125
+ if @order_details.to_s.length > 1024
126
+ invalid_properties.push('invalid value for "order_details", the character length must be smaller than or equal to 1024.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ return false if @payment_data_type.nil?
136
+ payment_data_type_validator = EnumAttributeValidator.new('String', ['BARCODE', 'QRCODE'])
137
+ return false unless payment_data_type_validator.valid?(@payment_data_type)
138
+ return false if @payment_data.nil?
139
+ return false if @payment_data.to_s.length > 100
140
+ return false if @order_title.nil?
141
+ return false if @order_title.to_s.length > 100
142
+ return false if @order_details.nil?
143
+ return false if @order_details.to_s.length > 1024
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method checking allowed values (enum).
148
+ # @param [Object] payment_data_type Object to be assigned
149
+ def payment_data_type=(payment_data_type)
150
+ validator = EnumAttributeValidator.new('String', ['BARCODE', 'QRCODE'])
151
+ unless validator.valid?(payment_data_type)
152
+ fail ArgumentError, 'invalid value for "payment_data_type", must be one of #{validator.allowable_values}.'
153
+ end
154
+ @payment_data_type = payment_data_type
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] payment_data Value to be assigned
159
+ def payment_data=(payment_data)
160
+ if payment_data.nil?
161
+ fail ArgumentError, 'payment_data cannot be nil'
162
+ end
163
+
164
+ if payment_data.to_s.length > 100
165
+ fail ArgumentError, 'invalid value for "payment_data", the character length must be smaller than or equal to 100.'
166
+ end
167
+
168
+ @payment_data = payment_data
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] order_title Value to be assigned
173
+ def order_title=(order_title)
174
+ if order_title.nil?
175
+ fail ArgumentError, 'order_title cannot be nil'
176
+ end
177
+
178
+ if order_title.to_s.length > 100
179
+ fail ArgumentError, 'invalid value for "order_title", the character length must be smaller than or equal to 100.'
180
+ end
181
+
182
+ @order_title = order_title
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] order_details Value to be assigned
187
+ def order_details=(order_details)
188
+ if order_details.nil?
189
+ fail ArgumentError, 'order_details cannot be nil'
190
+ end
191
+
192
+ if order_details.to_s.length > 1024
193
+ fail ArgumentError, 'invalid value for "order_details", the character length must be smaller than or equal to 1024.'
194
+ end
195
+
196
+ @order_details = order_details
197
+ end
198
+
199
+ # Checks equality by comparing each attribute.
200
+ # @param [Object] Object to be compared
201
+ def ==(o)
202
+ return true if self.equal?(o)
203
+ self.class == o.class &&
204
+ payment_data_type == o.payment_data_type &&
205
+ payment_data == o.payment_data &&
206
+ order_title == o.order_title &&
207
+ order_details == o.order_details
208
+ end
209
+
210
+ # @see the `==` method
211
+ # @param [Object] Object to be compared
212
+ def eql?(o)
213
+ self == o
214
+ end
215
+
216
+ # Calculates hash code according to all attributes.
217
+ # @return [Fixnum] Hash code
218
+ def hash
219
+ [payment_data_type, payment_data, order_title, order_details].hash
220
+ end
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+ self.class.openapi_types.each_pair do |key, type|
228
+ if type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
232
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
233
+ end
234
+ elsif !attributes[self.class.attribute_map[key]].nil?
235
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
236
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
237
+ end
238
+
239
+ self
240
+ end
241
+
242
+ # Deserializes the data based on type
243
+ # @param string type Data type
244
+ # @param string value Value to be deserialized
245
+ # @return [Object] Deserialized data
246
+ def _deserialize(type, value)
247
+ case type.to_sym
248
+ when :DateTime
249
+ DateTime.parse(value)
250
+ when :Date
251
+ Date.parse(value)
252
+ when :String
253
+ value.to_s
254
+ when :Integer
255
+ value.to_i
256
+ when :Float
257
+ value.to_f
258
+ when :BOOLEAN
259
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
260
+ true
261
+ else
262
+ false
263
+ end
264
+ when :Object
265
+ # generic object (usually a Hash), return directly
266
+ value
267
+ when /\AArray<(?<inner_type>.+)>\z/
268
+ inner_type = Regexp.last_match[:inner_type]
269
+ value.map { |v| _deserialize(inner_type, v) }
270
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
271
+ k_type = Regexp.last_match[:k_type]
272
+ v_type = Regexp.last_match[:v_type]
273
+ {}.tap do |hash|
274
+ value.each do |k, v|
275
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
276
+ end
277
+ end
278
+ else # model
279
+ temp_model = OpenapiClient.const_get(type).new
280
+ temp_model.build_from_hash(value)
281
+ end
282
+ end
283
+
284
+ # Returns the string representation of the object
285
+ # @return [String] String presentation of the object
286
+ def to_s
287
+ to_hash.to_s
288
+ end
289
+
290
+ # to_body is an alias to to_hash (backward compatibility)
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_body
293
+ to_hash
294
+ end
295
+
296
+ # Returns the object in the form of hash
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_hash
299
+ hash = {}
300
+ self.class.attribute_map.each_pair do |attr, param|
301
+ value = self.send(attr)
302
+ next if value.nil?
303
+ hash[param] = _to_hash(value)
304
+ end
305
+ hash
306
+ end
307
+
308
+ # Outputs non-array value in the form of hash
309
+ # For object, use to_hash. Otherwise, just return the value
310
+ # @param [Object] value Any valid value
311
+ # @return [Hash] Returns the value in the form of hash
312
+ def _to_hash(value)
313
+ if value.is_a?(Array)
314
+ value.compact.map { |v| _to_hash(v) }
315
+ elsif value.is_a?(Hash)
316
+ {}.tap do |hash|
317
+ value.each { |k, v| hash[k] = _to_hash(v) }
318
+ end
319
+ elsif value.respond_to? :to_hash
320
+ value.to_hash
321
+ else
322
+ value
323
+ end
324
+ end
325
+ end
326
+ end