conekta 6.0.0 → 6.0.1

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 (303) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +9 -1
  3. data/README.md +17 -10
  4. data/VERSION +1 -1
  5. data/conekta.gemspec +4 -3
  6. data/config-ruby.json +32 -0
  7. data/docs/BalancesApi.md +1 -1
  8. data/docs/ChargeOrderResponse.md +0 -2
  9. data/docs/ChargeRequest.md +0 -2
  10. data/docs/ChargeRequestPaymentMethod.md +2 -0
  11. data/docs/ChargeResponse.md +0 -2
  12. data/docs/ChargeUpdateRequest.md +18 -0
  13. data/docs/ChargesApi.md +76 -0
  14. data/docs/ChargesDataResponse.md +0 -2
  15. data/docs/Checkout.md +2 -2
  16. data/docs/CheckoutOrderTemplate.md +1 -1
  17. data/docs/CheckoutRequest.md +2 -2
  18. data/docs/CheckoutResponse.md +3 -3
  19. data/docs/Customer.md +1 -1
  20. data/docs/CustomerAddress.md +3 -3
  21. data/docs/CustomerFiscalEntitiesRequestAddress.md +3 -3
  22. data/docs/CustomerResponse.md +11 -9
  23. data/docs/CustomerShippingContacts.md +4 -2
  24. data/docs/CustomerShippingContactsAddress.md +2 -2
  25. data/docs/CustomerShippingContactsDataResponse.md +3 -1
  26. data/docs/CustomerShippingContactsResponse.md +3 -1
  27. data/docs/CustomerShippingContactsResponseAddress.md +2 -2
  28. data/docs/CustomerUpdateShippingContacts.md +1 -1
  29. data/docs/CustomersApi.md +2 -2
  30. data/docs/EventResponse.md +1 -1
  31. data/docs/FiscalEntityAddress.md +30 -0
  32. data/docs/LogResponse.md +5 -5
  33. data/docs/LogsResponseData.md +5 -5
  34. data/docs/{CustomerInfoResponse.md → OrderCustomerInfoResponse.md} +4 -2
  35. data/docs/OrderFiscalEntityAddressResponse.md +32 -0
  36. data/docs/{OrderResponseFiscalEntityAddressAllOf.md → OrderFiscalEntityAddressResponseAllOf.md} +2 -2
  37. data/docs/OrderFiscalEntityRequest.md +28 -0
  38. data/docs/OrderFiscalEntityResponse.md +34 -0
  39. data/docs/OrderNextActionResponse.md +20 -0
  40. data/docs/OrderNextActionResponseRedirectToUrl.md +20 -0
  41. data/docs/OrderRequest.md +7 -1
  42. data/docs/OrderResponse.md +3 -1
  43. data/docs/OrderResponseCustomerInfo.md +2 -0
  44. data/docs/OrderResponseShippingContact.md +3 -1
  45. data/docs/OrderTaxRequest.md +1 -1
  46. data/docs/OrderUpdateFiscalEntityRequest.md +28 -0
  47. data/docs/OrderUpdateRequest.md +2 -0
  48. data/docs/PaymentLinkApi.md +1 -1
  49. data/docs/Product.md +3 -3
  50. data/docs/ShippingRequest.md +1 -1
  51. data/docs/TokenResponseCheckout.md +1 -1
  52. data/docs/TransactionsApi.md +9 -3
  53. data/docs/UpdateCustomer.md +1 -1
  54. data/docs/WebhookLog.md +1 -1
  55. data/docs/WebhookResponse.md +1 -1
  56. data/docs/WebhookUpdateRequest.md +2 -2
  57. data/lib/conekta/api/antifraud_api.rb +1 -1
  58. data/lib/conekta/api/api_keys_api.rb +1 -1
  59. data/lib/conekta/api/balances_api.rb +2 -2
  60. data/lib/conekta/api/charges_api.rb +83 -1
  61. data/lib/conekta/api/companies_api.rb +1 -1
  62. data/lib/conekta/api/customers_api.rb +1 -1
  63. data/lib/conekta/api/discounts_api.rb +1 -1
  64. data/lib/conekta/api/events_api.rb +1 -1
  65. data/lib/conekta/api/logs_api.rb +1 -1
  66. data/lib/conekta/api/orders_api.rb +1 -1
  67. data/lib/conekta/api/payment_link_api.rb +1 -1
  68. data/lib/conekta/api/payment_methods_api.rb +1 -1
  69. data/lib/conekta/api/plans_api.rb +1 -1
  70. data/lib/conekta/api/products_api.rb +1 -1
  71. data/lib/conekta/api/shipping_contacts_api.rb +1 -1
  72. data/lib/conekta/api/shippings_api.rb +1 -1
  73. data/lib/conekta/api/subscriptions_api.rb +1 -1
  74. data/lib/conekta/api/taxes_api.rb +1 -1
  75. data/lib/conekta/api/tokens_api.rb +1 -1
  76. data/lib/conekta/api/transactions_api.rb +13 -4
  77. data/lib/conekta/api/transfers_api.rb +1 -1
  78. data/lib/conekta/api/webhook_keys_api.rb +1 -1
  79. data/lib/conekta/api/webhooks_api.rb +1 -1
  80. data/lib/conekta/api_client.rb +39 -36
  81. data/lib/conekta/api_error.rb +1 -1
  82. data/lib/conekta/configuration.rb +13 -10
  83. data/lib/conekta/models/api_key_create_response.rb +14 -19
  84. data/lib/conekta/models/api_key_create_response_all_of.rb +14 -19
  85. data/lib/conekta/models/api_key_request.rb +16 -19
  86. data/lib/conekta/models/api_key_response.rb +14 -19
  87. data/lib/conekta/models/api_key_response_on_delete.rb +14 -19
  88. data/lib/conekta/models/api_key_update_request.rb +14 -19
  89. data/lib/conekta/models/balance_common_field.rb +14 -19
  90. data/lib/conekta/models/balance_response.rb +14 -19
  91. data/lib/conekta/models/blacklist_rule_response.rb +14 -19
  92. data/lib/conekta/models/charge_data_payment_method_bank_transfer_response.rb +14 -19
  93. data/lib/conekta/models/charge_data_payment_method_card_response.rb +14 -43
  94. data/lib/conekta/models/charge_data_payment_method_cash_response.rb +14 -19
  95. data/lib/conekta/models/charge_order_response.rb +15 -29
  96. data/lib/conekta/models/charge_order_response_payment_method.rb +1 -1
  97. data/lib/conekta/models/charge_request.rb +17 -30
  98. data/lib/conekta/models/charge_request_payment_method.rb +27 -44
  99. data/lib/conekta/models/charge_response.rb +15 -29
  100. data/lib/conekta/models/charge_response_channel.rb +14 -19
  101. data/lib/conekta/models/charge_response_payment_method.rb +1 -1
  102. data/lib/conekta/models/charge_response_refunds.rb +18 -19
  103. data/lib/conekta/models/charge_response_refunds_all_of.rb +14 -19
  104. data/lib/conekta/models/charge_response_refunds_data.rb +22 -19
  105. data/lib/conekta/models/charge_update_request.rb +216 -0
  106. data/lib/conekta/models/charges_data_response.rb +15 -29
  107. data/lib/conekta/models/checkout.rb +26 -19
  108. data/lib/conekta/models/checkout_order_template.rb +23 -20
  109. data/lib/conekta/models/checkout_order_template_customer_info.rb +2 -2
  110. data/lib/conekta/models/checkout_request.rb +16 -19
  111. data/lib/conekta/models/checkout_response.rb +22 -19
  112. data/lib/conekta/models/checkouts_response.rb +18 -19
  113. data/lib/conekta/models/checkouts_response_all_of.rb +14 -19
  114. data/lib/conekta/models/company_fiscal_info_address_response.rb +14 -19
  115. data/lib/conekta/models/company_fiscal_info_response.rb +14 -19
  116. data/lib/conekta/models/company_payout_destination_response.rb +14 -19
  117. data/lib/conekta/models/company_response.rb +14 -19
  118. data/lib/conekta/models/create_customer_fiscal_entities_response.rb +22 -19
  119. data/lib/conekta/models/create_customer_fiscal_entities_response_all_of.rb +20 -19
  120. data/lib/conekta/models/create_customer_payment_methods_request.rb +2 -2
  121. data/lib/conekta/models/create_customer_payment_methods_response.rb +1 -1
  122. data/lib/conekta/models/create_risk_rules_data.rb +20 -19
  123. data/lib/conekta/models/customer.rb +25 -20
  124. data/lib/conekta/models/customer_address.rb +22 -19
  125. data/lib/conekta/models/customer_antifraud_info.rb +14 -19
  126. data/lib/conekta/models/customer_antifraud_info_response.rb +14 -19
  127. data/lib/conekta/models/customer_fiscal_entities_data_response.rb +22 -19
  128. data/lib/conekta/models/customer_fiscal_entities_request.rb +16 -19
  129. data/lib/conekta/models/customer_fiscal_entities_request_address.rb +22 -19
  130. data/lib/conekta/models/customer_fiscal_entities_response.rb +18 -19
  131. data/lib/conekta/models/customer_fiscal_entities_response_all_of.rb +14 -19
  132. data/lib/conekta/models/customer_info.rb +20 -19
  133. data/lib/conekta/models/customer_info_just_customer_id.rb +16 -19
  134. data/lib/conekta/models/customer_info_just_customer_id_response.rb +14 -19
  135. data/lib/conekta/models/customer_payment_method_request.rb +16 -19
  136. data/lib/conekta/models/customer_payment_methods.rb +14 -19
  137. data/lib/conekta/models/customer_payment_methods_data.rb +1 -1
  138. data/lib/conekta/models/customer_payment_methods_request.rb +2 -2
  139. data/lib/conekta/models/customer_payment_methods_response.rb +18 -19
  140. data/lib/conekta/models/customer_response.rb +67 -20
  141. data/lib/conekta/models/customer_response_shipping_contacts.rb +18 -19
  142. data/lib/conekta/models/customer_response_shipping_contacts_all_of.rb +14 -19
  143. data/lib/conekta/models/customer_shipping_contacts.rb +52 -24
  144. data/lib/conekta/models/customer_shipping_contacts_address.rb +14 -19
  145. data/lib/conekta/models/customer_shipping_contacts_data_response.rb +54 -20
  146. data/lib/conekta/models/customer_shipping_contacts_data_response_all_of.rb +20 -19
  147. data/lib/conekta/models/customer_shipping_contacts_response.rb +46 -20
  148. data/lib/conekta/models/customer_shipping_contacts_response_address.rb +15 -19
  149. data/lib/conekta/models/customer_update_fiscal_entities_request.rb +14 -19
  150. data/lib/conekta/models/customer_update_shipping_contacts.rb +14 -19
  151. data/lib/conekta/models/customers_response.rb +18 -19
  152. data/lib/conekta/models/customers_response_all_of.rb +14 -19
  153. data/lib/conekta/models/delete_api_keys_response.rb +14 -19
  154. data/lib/conekta/models/delete_api_keys_response_all_of.rb +14 -19
  155. data/lib/conekta/models/deleted_blacklist_rule_response.rb +14 -19
  156. data/lib/conekta/models/deleted_whitelist_rule_response.rb +14 -19
  157. data/lib/conekta/models/details.rb +14 -19
  158. data/lib/conekta/models/details_error.rb +14 -19
  159. data/lib/conekta/models/discount_lines_data_response.rb +26 -19
  160. data/lib/conekta/models/discount_lines_response.rb +26 -19
  161. data/lib/conekta/models/discount_lines_response_all_of.rb +20 -19
  162. data/lib/conekta/models/email_checkout_request.rb +16 -19
  163. data/lib/conekta/models/error.rb +14 -19
  164. data/lib/conekta/models/error_all_of.rb +14 -19
  165. data/lib/conekta/models/event_response.rb +19 -20
  166. data/lib/conekta/models/events_resend_response.rb +19 -20
  167. data/lib/conekta/models/fiscal_entity_address.rb +312 -0
  168. data/lib/conekta/models/get_api_keys_response.rb +18 -19
  169. data/lib/conekta/models/get_api_keys_response_all_of.rb +14 -19
  170. data/lib/conekta/models/get_charges_response.rb +18 -19
  171. data/lib/conekta/models/get_charges_response_all_of.rb +14 -19
  172. data/lib/conekta/models/get_companies_response.rb +18 -19
  173. data/lib/conekta/models/get_companies_response_all_of.rb +14 -19
  174. data/lib/conekta/models/get_customer_payment_method_data_response.rb +1 -1
  175. data/lib/conekta/models/get_events_response.rb +18 -19
  176. data/lib/conekta/models/get_events_response_all_of.rb +14 -19
  177. data/lib/conekta/models/get_order_discount_lines_response.rb +18 -19
  178. data/lib/conekta/models/get_order_discount_lines_response_all_of.rb +14 -19
  179. data/lib/conekta/models/get_orders_response.rb +20 -19
  180. data/lib/conekta/models/get_payment_method_response.rb +18 -19
  181. data/lib/conekta/models/get_payment_method_response_all_of.rb +14 -19
  182. data/lib/conekta/models/get_plans_response.rb +18 -19
  183. data/lib/conekta/models/get_plans_response_all_of.rb +14 -19
  184. data/lib/conekta/models/get_transactions_response.rb +18 -19
  185. data/lib/conekta/models/get_transactions_response_all_of.rb +14 -19
  186. data/lib/conekta/models/get_transfers_response.rb +18 -19
  187. data/lib/conekta/models/get_transfers_response_all_of.rb +14 -19
  188. data/lib/conekta/models/get_webhook_keys_response.rb +18 -19
  189. data/lib/conekta/models/get_webhook_keys_response_all_of.rb +14 -19
  190. data/lib/conekta/models/get_webhooks_response.rb +18 -19
  191. data/lib/conekta/models/get_webhooks_response_all_of.rb +14 -19
  192. data/lib/conekta/models/log_response.rb +20 -19
  193. data/lib/conekta/models/logs_response.rb +14 -19
  194. data/lib/conekta/models/logs_response_data.rb +14 -19
  195. data/lib/conekta/models/order_capture_request.rb +16 -19
  196. data/lib/conekta/models/{customer_info_response.rb → order_customer_info_response.rb} +29 -23
  197. data/lib/conekta/models/order_discount_lines_request.rb +20 -19
  198. data/lib/conekta/models/{order_response_fiscal_entity_address.rb → order_fiscal_entity_address_response.rb} +48 -34
  199. data/lib/conekta/models/{order_response_fiscal_entity_address_all_of.rb → order_fiscal_entity_address_response_all_of.rb} +17 -22
  200. data/lib/conekta/models/order_fiscal_entity_request.rb +295 -0
  201. data/lib/conekta/models/order_fiscal_entity_response.rb +347 -0
  202. data/lib/conekta/models/{order_response_fiscal_entity.rb → order_next_action_response.rb} +32 -53
  203. data/lib/conekta/models/order_next_action_response_redirect_to_url.rb +226 -0
  204. data/lib/conekta/models/order_refund_request.rb +18 -19
  205. data/lib/conekta/models/order_request.rb +58 -24
  206. data/lib/conekta/models/order_request_customer_info.rb +2 -2
  207. data/lib/conekta/models/order_response.rb +31 -22
  208. data/lib/conekta/models/order_response_charges.rb +18 -19
  209. data/lib/conekta/models/order_response_charges_all_of.rb +14 -19
  210. data/lib/conekta/models/order_response_checkout.rb +19 -20
  211. data/lib/conekta/models/order_response_customer_info.rb +27 -21
  212. data/lib/conekta/models/order_response_customer_info_all_of.rb +14 -19
  213. data/lib/conekta/models/order_response_discount_lines.rb +18 -19
  214. data/lib/conekta/models/order_response_discount_lines_all_of.rb +14 -19
  215. data/lib/conekta/models/order_response_products.rb +18 -19
  216. data/lib/conekta/models/order_response_products_all_of.rb +14 -19
  217. data/lib/conekta/models/order_response_shipping_contact.rb +46 -20
  218. data/lib/conekta/models/order_response_shipping_contact_all_of.rb +14 -19
  219. data/lib/conekta/models/order_tax_request.rb +23 -20
  220. data/lib/conekta/models/order_update_fiscal_entity_request.rb +295 -0
  221. data/lib/conekta/models/order_update_request.rb +29 -21
  222. data/lib/conekta/models/order_update_request_customer_info.rb +2 -2
  223. data/lib/conekta/models/orders_response.rb +16 -19
  224. data/lib/conekta/models/page.rb +14 -19
  225. data/lib/conekta/models/pagination.rb +18 -19
  226. data/lib/conekta/models/payment_method.rb +16 -19
  227. data/lib/conekta/models/payment_method_bank_transfer.rb +16 -19
  228. data/lib/conekta/models/payment_method_card.rb +16 -43
  229. data/lib/conekta/models/payment_method_card_request.rb +18 -19
  230. data/lib/conekta/models/payment_method_card_request_all_of.rb +14 -19
  231. data/lib/conekta/models/payment_method_card_response.rb +22 -19
  232. data/lib/conekta/models/payment_method_card_response_all_of.rb +14 -19
  233. data/lib/conekta/models/payment_method_cash.rb +16 -19
  234. data/lib/conekta/models/payment_method_cash_request.rb +16 -19
  235. data/lib/conekta/models/payment_method_cash_request_all_of.rb +14 -19
  236. data/lib/conekta/models/payment_method_cash_response.rb +22 -19
  237. data/lib/conekta/models/payment_method_cash_response_all_of.rb +14 -19
  238. data/lib/conekta/models/payment_method_response.rb +22 -19
  239. data/lib/conekta/models/payment_method_spei_recurrent.rb +22 -19
  240. data/lib/conekta/models/payment_method_spei_recurrent_all_of.rb +14 -19
  241. data/lib/conekta/models/payment_method_spei_request.rb +16 -19
  242. data/lib/conekta/models/plan_request.rb +27 -20
  243. data/lib/conekta/models/plan_response.rb +19 -20
  244. data/lib/conekta/models/plan_update_request.rb +24 -21
  245. data/lib/conekta/models/product.rb +30 -21
  246. data/lib/conekta/models/product_data_response.rb +30 -21
  247. data/lib/conekta/models/product_data_response_all_of.rb +14 -19
  248. data/lib/conekta/models/product_order_response.rb +30 -21
  249. data/lib/conekta/models/product_order_response_all_of.rb +14 -19
  250. data/lib/conekta/models/risk_rules.rb +14 -19
  251. data/lib/conekta/models/risk_rules_data.rb +14 -19
  252. data/lib/conekta/models/risk_rules_list.rb +18 -19
  253. data/lib/conekta/models/shipping_order_response.rb +21 -20
  254. data/lib/conekta/models/shipping_request.rb +21 -20
  255. data/lib/conekta/models/sms_checkout_request.rb +16 -19
  256. data/lib/conekta/models/subscription_events_response.rb +18 -19
  257. data/lib/conekta/models/subscription_request.rb +16 -19
  258. data/lib/conekta/models/subscription_response.rb +14 -19
  259. data/lib/conekta/models/subscription_update_request.rb +14 -19
  260. data/lib/conekta/models/token.rb +14 -19
  261. data/lib/conekta/models/token_card.rb +24 -19
  262. data/lib/conekta/models/token_checkout.rb +14 -19
  263. data/lib/conekta/models/token_response.rb +22 -19
  264. data/lib/conekta/models/token_response_checkout.rb +14 -19
  265. data/lib/conekta/models/transaction_response.rb +36 -19
  266. data/lib/conekta/models/transfer_destination_response.rb +14 -19
  267. data/lib/conekta/models/transfer_method_response.rb +14 -19
  268. data/lib/conekta/models/transfer_response.rb +19 -20
  269. data/lib/conekta/models/transfers_response.rb +19 -20
  270. data/lib/conekta/models/update_customer.rb +19 -20
  271. data/lib/conekta/models/update_customer_antifraud_info.rb +14 -19
  272. data/lib/conekta/models/update_customer_fiscal_entities_response.rb +22 -19
  273. data/lib/conekta/models/update_customer_fiscal_entities_response_all_of.rb +20 -19
  274. data/lib/conekta/models/update_customer_payment_methods_response.rb +1 -1
  275. data/lib/conekta/models/update_order_discount_lines_request.rb +19 -20
  276. data/lib/conekta/models/update_order_tax_request.rb +29 -22
  277. data/lib/conekta/models/update_order_tax_response.rb +25 -20
  278. data/lib/conekta/models/update_order_tax_response_all_of.rb +14 -19
  279. data/lib/conekta/models/update_payment_methods.rb +14 -19
  280. data/lib/conekta/models/update_product.rb +29 -22
  281. data/lib/conekta/models/webhook_key_create_response.rb +14 -19
  282. data/lib/conekta/models/webhook_key_delete_response.rb +14 -19
  283. data/lib/conekta/models/webhook_key_request.rb +14 -19
  284. data/lib/conekta/models/webhook_key_response.rb +14 -19
  285. data/lib/conekta/models/webhook_key_update_request.rb +14 -19
  286. data/lib/conekta/models/webhook_log.rb +19 -20
  287. data/lib/conekta/models/webhook_request.rb +16 -19
  288. data/lib/conekta/models/webhook_response.rb +14 -19
  289. data/lib/conekta/models/webhook_update_request.rb +24 -27
  290. data/lib/conekta/models/whitelistlist_rule_response.rb +14 -19
  291. data/lib/conekta/version.rb +2 -2
  292. data/lib/conekta.rb +11 -5
  293. data/spec/api/orders_api_spec.rb +27 -1
  294. data/spec/api_client_spec.rb +1 -1
  295. data/spec/configuration_spec.rb +1 -1
  296. data/spec/spec_helper.rb +1 -8
  297. data/ssl_data/ca_bundle.crt +4039 -0
  298. data/templates/ruby/CUSTOM_VERSION.mustache +1 -0
  299. data/templates/ruby/api_client.mustache +256 -0
  300. data/templates/ruby/configuration.mustache +481 -0
  301. metadata +46 -29
  302. data/docs/OrderResponseFiscalEntity.md +0 -24
  303. data/docs/OrderResponseFiscalEntityAddress.md +0 -34
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2.1.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.1.0
10
10
 
11
11
  =end
12
12
 
@@ -73,6 +73,7 @@ module Conekta
73
73
  # Show invalid properties with the reasons. Usually used together with valid?
74
74
  # @return Array for valid properties with the reasons
75
75
  def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
77
  invalid_properties = Array.new
77
78
  invalid_properties
78
79
  end
@@ -80,6 +81,7 @@ module Conekta
80
81
  # Check to see if the all the properties in the model are valid
81
82
  # @return true if the model is valid
82
83
  def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
85
  true
84
86
  end
85
87
 
@@ -108,37 +110,30 @@ module Conekta
108
110
  # @param [Hash] attributes Model attributes in the form of hash
109
111
  # @return [Object] Returns the model itself
110
112
  def self.build_from_hash(attributes)
111
- new.build_from_hash(attributes)
112
- end
113
-
114
- # Builds the object from hash
115
- # @param [Hash] attributes Model attributes in the form of hash
116
- # @return [Object] Returns the model itself
117
- def build_from_hash(attributes)
118
113
  return nil unless attributes.is_a?(Hash)
119
114
  attributes = attributes.transform_keys(&:to_sym)
120
- self.class.openapi_types.each_pair do |key, type|
121
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
- self.send("#{key}=", nil)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
123
119
  elsif type =~ /\AArray<(.*)>/i
124
120
  # check to ensure the input is an array given that the attribute
125
121
  # is documented as an array but the input is not
126
- if attributes[self.class.attribute_map[key]].is_a?(Array)
127
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
128
124
  end
129
- elsif !attributes[self.class.attribute_map[key]].nil?
130
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
131
127
  end
132
128
  end
133
-
134
- self
129
+ new(transformed_hash)
135
130
  end
136
131
 
137
132
  # Deserializes the data based on type
138
133
  # @param string type Data type
139
134
  # @param string value Value to be deserialized
140
135
  # @return [Object] Deserialized data
141
- def _deserialize(type, value)
136
+ def self._deserialize(type, value)
142
137
  case type.to_sym
143
138
  when :Time
144
139
  Time.parse(value)
@@ -173,7 +168,7 @@ module Conekta
173
168
  else # model
174
169
  # models (e.g. Pet) or oneOf
175
170
  klass = Conekta.const_get(type)
176
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
172
  end
178
173
  end
179
174
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2.1.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.1.0
10
10
 
11
11
  =end
12
12
 
@@ -107,6 +107,8 @@ module Conekta
107
107
 
108
108
  if attributes.key?(:'address')
109
109
  self.address = attributes[:'address']
110
+ else
111
+ self.address = nil
110
112
  end
111
113
 
112
114
  if attributes.key?(:'tax_id')
@@ -133,14 +135,20 @@ module Conekta
133
135
 
134
136
  if attributes.key?(:'id')
135
137
  self.id = attributes[:'id']
138
+ else
139
+ self.id = nil
136
140
  end
137
141
 
138
142
  if attributes.key?(:'object')
139
143
  self.object = attributes[:'object']
144
+ else
145
+ self.object = nil
140
146
  end
141
147
 
142
148
  if attributes.key?(:'created_at')
143
149
  self.created_at = attributes[:'created_at']
150
+ else
151
+ self.created_at = nil
144
152
  end
145
153
 
146
154
  if attributes.key?(:'parent_id')
@@ -155,6 +163,7 @@ module Conekta
155
163
  # Show invalid properties with the reasons. Usually used together with valid?
156
164
  # @return Array for valid properties with the reasons
157
165
  def list_invalid_properties
166
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
158
167
  invalid_properties = Array.new
159
168
  if @address.nil?
160
169
  invalid_properties.push('invalid value for "address", address cannot be nil.')
@@ -178,6 +187,7 @@ module Conekta
178
187
  # Check to see if the all the properties in the model are valid
179
188
  # @return true if the model is valid
180
189
  def valid?
190
+ warn '[DEPRECATED] the `valid?` method is obsolete'
181
191
  return false if @address.nil?
182
192
  return false if @id.nil?
183
193
  return false if @object.nil?
@@ -219,37 +229,30 @@ module Conekta
219
229
  # @param [Hash] attributes Model attributes in the form of hash
220
230
  # @return [Object] Returns the model itself
221
231
  def self.build_from_hash(attributes)
222
- new.build_from_hash(attributes)
223
- end
224
-
225
- # Builds the object from hash
226
- # @param [Hash] attributes Model attributes in the form of hash
227
- # @return [Object] Returns the model itself
228
- def build_from_hash(attributes)
229
232
  return nil unless attributes.is_a?(Hash)
230
233
  attributes = attributes.transform_keys(&:to_sym)
231
- self.class.openapi_types.each_pair do |key, type|
232
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
233
- self.send("#{key}=", nil)
234
+ transformed_hash = {}
235
+ openapi_types.each_pair do |key, type|
236
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
237
+ transformed_hash["#{key}"] = nil
234
238
  elsif type =~ /\AArray<(.*)>/i
235
239
  # check to ensure the input is an array given that the attribute
236
240
  # is documented as an array but the input is not
237
- if attributes[self.class.attribute_map[key]].is_a?(Array)
238
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
241
+ if attributes[attribute_map[key]].is_a?(Array)
242
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
239
243
  end
240
- elsif !attributes[self.class.attribute_map[key]].nil?
241
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
244
+ elsif !attributes[attribute_map[key]].nil?
245
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
242
246
  end
243
247
  end
244
-
245
- self
248
+ new(transformed_hash)
246
249
  end
247
250
 
248
251
  # Deserializes the data based on type
249
252
  # @param string type Data type
250
253
  # @param string value Value to be deserialized
251
254
  # @return [Object] Deserialized data
252
- def _deserialize(type, value)
255
+ def self._deserialize(type, value)
253
256
  case type.to_sym
254
257
  when :Time
255
258
  Time.parse(value)
@@ -284,7 +287,7 @@ module Conekta
284
287
  else # model
285
288
  # models (e.g. Pet) or oneOf
286
289
  klass = Conekta.const_get(type)
287
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
290
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
288
291
  end
289
292
  end
290
293
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2.1.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.1.0
10
10
 
11
11
  =end
12
12
 
@@ -75,14 +75,20 @@ module Conekta
75
75
 
76
76
  if attributes.key?(:'id')
77
77
  self.id = attributes[:'id']
78
+ else
79
+ self.id = nil
78
80
  end
79
81
 
80
82
  if attributes.key?(:'object')
81
83
  self.object = attributes[:'object']
84
+ else
85
+ self.object = nil
82
86
  end
83
87
 
84
88
  if attributes.key?(:'created_at')
85
89
  self.created_at = attributes[:'created_at']
90
+ else
91
+ self.created_at = nil
86
92
  end
87
93
 
88
94
  if attributes.key?(:'parent_id')
@@ -97,6 +103,7 @@ module Conekta
97
103
  # Show invalid properties with the reasons. Usually used together with valid?
98
104
  # @return Array for valid properties with the reasons
99
105
  def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
107
  invalid_properties = Array.new
101
108
  if @id.nil?
102
109
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -116,6 +123,7 @@ module Conekta
116
123
  # Check to see if the all the properties in the model are valid
117
124
  # @return true if the model is valid
118
125
  def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
127
  return false if @id.nil?
120
128
  return false if @object.nil?
121
129
  return false if @created_at.nil?
@@ -150,37 +158,30 @@ module Conekta
150
158
  # @param [Hash] attributes Model attributes in the form of hash
151
159
  # @return [Object] Returns the model itself
152
160
  def self.build_from_hash(attributes)
153
- new.build_from_hash(attributes)
154
- end
155
-
156
- # Builds the object from hash
157
- # @param [Hash] attributes Model attributes in the form of hash
158
- # @return [Object] Returns the model itself
159
- def build_from_hash(attributes)
160
161
  return nil unless attributes.is_a?(Hash)
161
162
  attributes = attributes.transform_keys(&:to_sym)
162
- self.class.openapi_types.each_pair do |key, type|
163
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
164
- self.send("#{key}=", nil)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
165
167
  elsif type =~ /\AArray<(.*)>/i
166
168
  # check to ensure the input is an array given that the attribute
167
169
  # is documented as an array but the input is not
168
- if attributes[self.class.attribute_map[key]].is_a?(Array)
169
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
170
172
  end
171
- elsif !attributes[self.class.attribute_map[key]].nil?
172
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
173
175
  end
174
176
  end
175
-
176
- self
177
+ new(transformed_hash)
177
178
  end
178
179
 
179
180
  # Deserializes the data based on type
180
181
  # @param string type Data type
181
182
  # @param string value Value to be deserialized
182
183
  # @return [Object] Deserialized data
183
- def _deserialize(type, value)
184
+ def self._deserialize(type, value)
184
185
  case type.to_sym
185
186
  when :Time
186
187
  Time.parse(value)
@@ -215,7 +216,7 @@ module Conekta
215
216
  else # model
216
217
  # models (e.g. Pet) or oneOf
217
218
  klass = Conekta.const_get(type)
218
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
220
  end
220
221
  end
221
222
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2.1.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2.1.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.1.0
10
10
 
11
11
  =end
12
12
 
@@ -83,6 +83,7 @@ module Conekta
83
83
  # Show invalid properties with the reasons. Usually used together with valid?
84
84
  # @return Array for valid properties with the reasons
85
85
  def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
87
  invalid_properties = Array.new
87
88
  if !@amount.nil? && @amount < 0
88
89
  invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.')
@@ -94,6 +95,7 @@ module Conekta
94
95
  # Check to see if the all the properties in the model are valid
95
96
  # @return true if the model is valid
96
97
  def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
99
  return false if !@amount.nil? && @amount < 0
98
100
  true
99
101
  end
@@ -101,7 +103,11 @@ module Conekta
101
103
  # Custom attribute writer method with validation
102
104
  # @param [Object] amount Value to be assigned
103
105
  def amount=(amount)
104
- if !amount.nil? && amount < 0
106
+ if amount.nil?
107
+ fail ArgumentError, 'amount cannot be nil'
108
+ end
109
+
110
+ if amount < 0
105
111
  fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.'
106
112
  end
107
113
 
@@ -134,37 +140,30 @@ module Conekta
134
140
  # @param [Hash] attributes Model attributes in the form of hash
135
141
  # @return [Object] Returns the model itself
136
142
  def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
143
  return nil unless attributes.is_a?(Hash)
145
144
  attributes = attributes.transform_keys(&:to_sym)
146
- self.class.openapi_types.each_pair do |key, type|
147
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
148
- self.send("#{key}=", nil)
145
+ transformed_hash = {}
146
+ openapi_types.each_pair do |key, type|
147
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
148
+ transformed_hash["#{key}"] = nil
149
149
  elsif type =~ /\AArray<(.*)>/i
150
150
  # check to ensure the input is an array given that the attribute
151
151
  # is documented as an array but the input is not
152
- if attributes[self.class.attribute_map[key]].is_a?(Array)
153
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ if attributes[attribute_map[key]].is_a?(Array)
153
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
154
154
  end
155
- elsif !attributes[self.class.attribute_map[key]].nil?
156
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ elsif !attributes[attribute_map[key]].nil?
156
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
157
157
  end
158
158
  end
159
-
160
- self
159
+ new(transformed_hash)
161
160
  end
162
161
 
163
162
  # Deserializes the data based on type
164
163
  # @param string type Data type
165
164
  # @param string value Value to be deserialized
166
165
  # @return [Object] Deserialized data
167
- def _deserialize(type, value)
166
+ def self._deserialize(type, value)
168
167
  case type.to_sym
169
168
  when :Time
170
169
  Time.parse(value)
@@ -199,7 +198,7 @@ module Conekta
199
198
  else # model
200
199
  # models (e.g. Pet) or oneOf
201
200
  klass = Conekta.const_get(type)
202
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
202
  end
204
203
  end
205
204
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2.1.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.1.0
10
10
 
11
11
  =end
12
12
 
@@ -86,6 +86,7 @@ module Conekta
86
86
  # Show invalid properties with the reasons. Usually used together with valid?
87
87
  # @return Array for valid properties with the reasons
88
88
  def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
90
  invalid_properties = Array.new
90
91
  if !@amount.nil? && @amount < 0
91
92
  invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.')
@@ -105,6 +106,7 @@ module Conekta
105
106
  # Check to see if the all the properties in the model are valid
106
107
  # @return true if the model is valid
107
108
  def valid?
109
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
110
  return false if !@amount.nil? && @amount < 0
109
111
  return false if !@description.nil? && @description.to_s.length < 2
110
112
  return false if !@metadata.nil? && @metadata.length > 100
@@ -114,7 +116,11 @@ module Conekta
114
116
  # Custom attribute writer method with validation
115
117
  # @param [Object] amount Value to be assigned
116
118
  def amount=(amount)
117
- if !amount.nil? && amount < 0
119
+ if amount.nil?
120
+ fail ArgumentError, 'amount cannot be nil'
121
+ end
122
+
123
+ if amount < 0
118
124
  fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.'
119
125
  end
120
126
 
@@ -124,7 +130,11 @@ module Conekta
124
130
  # Custom attribute writer method with validation
125
131
  # @param [Object] description Value to be assigned
126
132
  def description=(description)
127
- if !description.nil? && description.to_s.length < 2
133
+ if description.nil?
134
+ fail ArgumentError, 'description cannot be nil'
135
+ end
136
+
137
+ if description.to_s.length < 2
128
138
  fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 2.'
129
139
  end
130
140
 
@@ -134,7 +144,11 @@ module Conekta
134
144
  # Custom attribute writer method with validation
135
145
  # @param [Object] metadata Value to be assigned
136
146
  def metadata=(metadata)
137
- if !metadata.nil? && metadata.length > 100
147
+ if metadata.nil?
148
+ fail ArgumentError, 'metadata cannot be nil'
149
+ end
150
+
151
+ if metadata.length > 100
138
152
  fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
139
153
  end
140
154
 
@@ -167,37 +181,30 @@ module Conekta
167
181
  # @param [Hash] attributes Model attributes in the form of hash
168
182
  # @return [Object] Returns the model itself
169
183
  def self.build_from_hash(attributes)
170
- new.build_from_hash(attributes)
171
- end
172
-
173
- # Builds the object from hash
174
- # @param [Hash] attributes Model attributes in the form of hash
175
- # @return [Object] Returns the model itself
176
- def build_from_hash(attributes)
177
184
  return nil unless attributes.is_a?(Hash)
178
185
  attributes = attributes.transform_keys(&:to_sym)
179
- self.class.openapi_types.each_pair do |key, type|
180
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
181
- self.send("#{key}=", nil)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
182
190
  elsif type =~ /\AArray<(.*)>/i
183
191
  # check to ensure the input is an array given that the attribute
184
192
  # 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) })
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
195
  end
188
- elsif !attributes[self.class.attribute_map[key]].nil?
189
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
198
  end
191
199
  end
192
-
193
- self
200
+ new(transformed_hash)
194
201
  end
195
202
 
196
203
  # Deserializes the data based on type
197
204
  # @param string type Data type
198
205
  # @param string value Value to be deserialized
199
206
  # @return [Object] Deserialized data
200
- def _deserialize(type, value)
207
+ def self._deserialize(type, value)
201
208
  case type.to_sym
202
209
  when :Time
203
210
  Time.parse(value)
@@ -232,7 +239,7 @@ module Conekta
232
239
  else # model
233
240
  # models (e.g. Pet) or oneOf
234
241
  klass = Conekta.const_get(type)
235
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
242
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
243
  end
237
244
  end
238
245
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2.1.0
7
7
  Contact: engineering@conekta.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.1.0
10
10
 
11
11
  =end
12
12
 
@@ -90,10 +90,14 @@ module Conekta
90
90
 
91
91
  if attributes.key?(:'amount')
92
92
  self.amount = attributes[:'amount']
93
+ else
94
+ self.amount = nil
93
95
  end
94
96
 
95
97
  if attributes.key?(:'description')
96
98
  self.description = attributes[:'description']
99
+ else
100
+ self.description = nil
97
101
  end
98
102
 
99
103
  if attributes.key?(:'metadata')
@@ -104,6 +108,8 @@ module Conekta
104
108
 
105
109
  if attributes.key?(:'id')
106
110
  self.id = attributes[:'id']
111
+ else
112
+ self.id = nil
107
113
  end
108
114
 
109
115
  if attributes.key?(:'object')
@@ -118,6 +124,7 @@ module Conekta
118
124
  # Show invalid properties with the reasons. Usually used together with valid?
119
125
  # @return Array for valid properties with the reasons
120
126
  def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
128
  invalid_properties = Array.new
122
129
  if @amount.nil?
123
130
  invalid_properties.push('invalid value for "amount", amount cannot be nil.')
@@ -149,6 +156,7 @@ module Conekta
149
156
  # Check to see if the all the properties in the model are valid
150
157
  # @return true if the model is valid
151
158
  def valid?
159
+ warn '[DEPRECATED] the `valid?` method is obsolete'
152
160
  return false if @amount.nil?
153
161
  return false if @amount < 0
154
162
  return false if @description.nil?
@@ -189,7 +197,11 @@ module Conekta
189
197
  # Custom attribute writer method with validation
190
198
  # @param [Object] metadata Value to be assigned
191
199
  def metadata=(metadata)
192
- if !metadata.nil? && metadata.length > 100
200
+ if metadata.nil?
201
+ fail ArgumentError, 'metadata cannot be nil'
202
+ end
203
+
204
+ if metadata.length > 100
193
205
  fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
194
206
  end
195
207
 
@@ -225,37 +237,30 @@ module Conekta
225
237
  # @param [Hash] attributes Model attributes in the form of hash
226
238
  # @return [Object] Returns the model itself
227
239
  def self.build_from_hash(attributes)
228
- new.build_from_hash(attributes)
229
- end
230
-
231
- # Builds the object from hash
232
- # @param [Hash] attributes Model attributes in the form of hash
233
- # @return [Object] Returns the model itself
234
- def build_from_hash(attributes)
235
240
  return nil unless attributes.is_a?(Hash)
236
241
  attributes = attributes.transform_keys(&:to_sym)
237
- self.class.openapi_types.each_pair do |key, type|
238
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
239
- self.send("#{key}=", nil)
242
+ transformed_hash = {}
243
+ openapi_types.each_pair do |key, type|
244
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
245
+ transformed_hash["#{key}"] = nil
240
246
  elsif type =~ /\AArray<(.*)>/i
241
247
  # check to ensure the input is an array given that the attribute
242
248
  # is documented as an array but the input is not
243
- if attributes[self.class.attribute_map[key]].is_a?(Array)
244
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
249
+ if attributes[attribute_map[key]].is_a?(Array)
250
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
245
251
  end
246
- elsif !attributes[self.class.attribute_map[key]].nil?
247
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
252
+ elsif !attributes[attribute_map[key]].nil?
253
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
248
254
  end
249
255
  end
250
-
251
- self
256
+ new(transformed_hash)
252
257
  end
253
258
 
254
259
  # Deserializes the data based on type
255
260
  # @param string type Data type
256
261
  # @param string value Value to be deserialized
257
262
  # @return [Object] Deserialized data
258
- def _deserialize(type, value)
263
+ def self._deserialize(type, value)
259
264
  case type.to_sym
260
265
  when :Time
261
266
  Time.parse(value)
@@ -290,7 +295,7 @@ module Conekta
290
295
  else # model
291
296
  # models (e.g. Pet) or oneOf
292
297
  klass = Conekta.const_get(type)
293
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
298
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
294
299
  end
295
300
  end
296
301