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
 
@@ -75,6 +75,8 @@ module Conekta
75
75
 
76
76
  if attributes.key?(:'currency')
77
77
  self.currency = attributes[:'currency']
78
+ else
79
+ self.currency = nil
78
80
  end
79
81
 
80
82
  if attributes.key?(:'customer_info')
@@ -85,6 +87,8 @@ module Conekta
85
87
  if (value = attributes[:'line_items']).is_a?(Array)
86
88
  self.line_items = value
87
89
  end
90
+ else
91
+ self.line_items = nil
88
92
  end
89
93
 
90
94
  if attributes.key?(:'metadata')
@@ -97,6 +101,7 @@ module Conekta
97
101
  # Show invalid properties with the reasons. Usually used together with valid?
98
102
  # @return Array for valid properties with the reasons
99
103
  def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
105
  invalid_properties = Array.new
101
106
  if @currency.nil?
102
107
  invalid_properties.push('invalid value for "currency", currency cannot be nil.')
@@ -120,6 +125,7 @@ module Conekta
120
125
  # Check to see if the all the properties in the model are valid
121
126
  # @return true if the model is valid
122
127
  def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
129
  return false if @currency.nil?
124
130
  return false if @currency.to_s.length > 3
125
131
  return false if @line_items.nil?
@@ -144,7 +150,11 @@ module Conekta
144
150
  # Custom attribute writer method with validation
145
151
  # @param [Object] metadata Value to be assigned
146
152
  def metadata=(metadata)
147
- if !metadata.nil? && metadata.length > 100
153
+ if metadata.nil?
154
+ fail ArgumentError, 'metadata cannot be nil'
155
+ end
156
+
157
+ if metadata.length > 100
148
158
  fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
149
159
  end
150
160
 
@@ -178,37 +188,30 @@ module Conekta
178
188
  # @param [Hash] attributes Model attributes in the form of hash
179
189
  # @return [Object] Returns the model itself
180
190
  def self.build_from_hash(attributes)
181
- new.build_from_hash(attributes)
182
- end
183
-
184
- # Builds the object from hash
185
- # @param [Hash] attributes Model attributes in the form of hash
186
- # @return [Object] Returns the model itself
187
- def build_from_hash(attributes)
188
191
  return nil unless attributes.is_a?(Hash)
189
192
  attributes = attributes.transform_keys(&:to_sym)
190
- self.class.openapi_types.each_pair do |key, type|
191
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
192
- self.send("#{key}=", nil)
193
+ transformed_hash = {}
194
+ openapi_types.each_pair do |key, type|
195
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = nil
193
197
  elsif type =~ /\AArray<(.*)>/i
194
198
  # check to ensure the input is an array given that the attribute
195
199
  # is documented as an array but the input is not
196
- if attributes[self.class.attribute_map[key]].is_a?(Array)
197
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
200
+ if attributes[attribute_map[key]].is_a?(Array)
201
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
198
202
  end
199
- elsif !attributes[self.class.attribute_map[key]].nil?
200
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
203
+ elsif !attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
201
205
  end
202
206
  end
203
-
204
- self
207
+ new(transformed_hash)
205
208
  end
206
209
 
207
210
  # Deserializes the data based on type
208
211
  # @param string type Data type
209
212
  # @param string value Value to be deserialized
210
213
  # @return [Object] Deserialized data
211
- def _deserialize(type, value)
214
+ def self._deserialize(type, value)
212
215
  case type.to_sym
213
216
  when :Time
214
217
  Time.parse(value)
@@ -243,7 +246,7 @@ module Conekta
243
246
  else # model
244
247
  # models (e.g. Pet) or oneOf
245
248
  klass = Conekta.const_get(type)
246
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
249
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
247
250
  end
248
251
  end
249
252
 
@@ -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
 
@@ -91,7 +91,7 @@ module Conekta
91
91
  # raise if data contains keys that are not known to the model
92
92
  raise unless (data.keys - const.acceptable_attributes).empty?
93
93
  model = const.build_from_hash(data)
94
- return model if model && model.valid?
94
+ return model if model
95
95
  end
96
96
  end
97
97
  end
@@ -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
 
@@ -100,6 +100,8 @@ module Conekta
100
100
  if (value = attributes[:'allowed_payment_methods']).is_a?(Array)
101
101
  self.allowed_payment_methods = value
102
102
  end
103
+ else
104
+ self.allowed_payment_methods = nil
103
105
  end
104
106
 
105
107
  if attributes.key?(:'expires_at')
@@ -140,6 +142,7 @@ module Conekta
140
142
  # Show invalid properties with the reasons. Usually used together with valid?
141
143
  # @return Array for valid properties with the reasons
142
144
  def list_invalid_properties
145
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
143
146
  invalid_properties = Array.new
144
147
  if @allowed_payment_methods.nil?
145
148
  invalid_properties.push('invalid value for "allowed_payment_methods", allowed_payment_methods cannot be nil.')
@@ -151,6 +154,7 @@ module Conekta
151
154
  # Check to see if the all the properties in the model are valid
152
155
  # @return true if the model is valid
153
156
  def valid?
157
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
158
  return false if @allowed_payment_methods.nil?
155
159
  true
156
160
  end
@@ -187,37 +191,30 @@ module Conekta
187
191
  # @param [Hash] attributes Model attributes in the form of hash
188
192
  # @return [Object] Returns the model itself
189
193
  def self.build_from_hash(attributes)
190
- new.build_from_hash(attributes)
191
- end
192
-
193
- # Builds the object from hash
194
- # @param [Hash] attributes Model attributes in the form of hash
195
- # @return [Object] Returns the model itself
196
- def build_from_hash(attributes)
197
194
  return nil unless attributes.is_a?(Hash)
198
195
  attributes = attributes.transform_keys(&:to_sym)
199
- self.class.openapi_types.each_pair do |key, type|
200
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
201
- self.send("#{key}=", nil)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
202
200
  elsif type =~ /\AArray<(.*)>/i
203
201
  # check to ensure the input is an array given that the attribute
204
202
  # is documented as an array but the input is not
205
- if attributes[self.class.attribute_map[key]].is_a?(Array)
206
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
207
205
  end
208
- elsif !attributes[self.class.attribute_map[key]].nil?
209
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
210
208
  end
211
209
  end
212
-
213
- self
210
+ new(transformed_hash)
214
211
  end
215
212
 
216
213
  # Deserializes the data based on type
217
214
  # @param string type Data type
218
215
  # @param string value Value to be deserialized
219
216
  # @return [Object] Deserialized data
220
- def _deserialize(type, value)
217
+ def self._deserialize(type, value)
221
218
  case type.to_sym
222
219
  when :Time
223
220
  Time.parse(value)
@@ -252,7 +249,7 @@ module Conekta
252
249
  else # model
253
250
  # models (e.g. Pet) or oneOf
254
251
  klass = Conekta.const_get(type)
255
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
252
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
256
253
  end
257
254
  end
258
255
 
@@ -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
 
@@ -190,10 +190,14 @@ module Conekta
190
190
 
191
191
  if attributes.key?(:'id')
192
192
  self.id = attributes[:'id']
193
+ else
194
+ self.id = nil
193
195
  end
194
196
 
195
197
  if attributes.key?(:'livemode')
196
198
  self.livemode = attributes[:'livemode']
199
+ else
200
+ self.livemode = nil
197
201
  end
198
202
 
199
203
  if attributes.key?(:'metadata')
@@ -214,6 +218,8 @@ module Conekta
214
218
 
215
219
  if attributes.key?(:'name')
216
220
  self.name = attributes[:'name']
221
+ else
222
+ self.name = nil
217
223
  end
218
224
 
219
225
  if attributes.key?(:'needs_shipping_contact')
@@ -222,6 +228,8 @@ module Conekta
222
228
 
223
229
  if attributes.key?(:'object')
224
230
  self.object = attributes[:'object']
231
+ else
232
+ self.object = nil
225
233
  end
226
234
 
227
235
  if attributes.key?(:'paid_payments_count')
@@ -268,6 +276,7 @@ module Conekta
268
276
  # Show invalid properties with the reasons. Usually used together with valid?
269
277
  # @return Array for valid properties with the reasons
270
278
  def list_invalid_properties
279
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
271
280
  invalid_properties = Array.new
272
281
  if @id.nil?
273
282
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -291,6 +300,7 @@ module Conekta
291
300
  # Check to see if the all the properties in the model are valid
292
301
  # @return true if the model is valid
293
302
  def valid?
303
+ warn '[DEPRECATED] the `valid?` method is obsolete'
294
304
  return false if @id.nil?
295
305
  return false if @livemode.nil?
296
306
  return false if @name.nil?
@@ -346,37 +356,30 @@ module Conekta
346
356
  # @param [Hash] attributes Model attributes in the form of hash
347
357
  # @return [Object] Returns the model itself
348
358
  def self.build_from_hash(attributes)
349
- new.build_from_hash(attributes)
350
- end
351
-
352
- # Builds the object from hash
353
- # @param [Hash] attributes Model attributes in the form of hash
354
- # @return [Object] Returns the model itself
355
- def build_from_hash(attributes)
356
359
  return nil unless attributes.is_a?(Hash)
357
360
  attributes = attributes.transform_keys(&:to_sym)
358
- self.class.openapi_types.each_pair do |key, type|
359
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
360
- self.send("#{key}=", nil)
361
+ transformed_hash = {}
362
+ openapi_types.each_pair do |key, type|
363
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
364
+ transformed_hash["#{key}"] = nil
361
365
  elsif type =~ /\AArray<(.*)>/i
362
366
  # check to ensure the input is an array given that the attribute
363
367
  # is documented as an array but the input is not
364
- if attributes[self.class.attribute_map[key]].is_a?(Array)
365
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
368
+ if attributes[attribute_map[key]].is_a?(Array)
369
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
366
370
  end
367
- elsif !attributes[self.class.attribute_map[key]].nil?
368
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
371
+ elsif !attributes[attribute_map[key]].nil?
372
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
369
373
  end
370
374
  end
371
-
372
- self
375
+ new(transformed_hash)
373
376
  end
374
377
 
375
378
  # Deserializes the data based on type
376
379
  # @param string type Data type
377
380
  # @param string value Value to be deserialized
378
381
  # @return [Object] Deserialized data
379
- def _deserialize(type, value)
382
+ def self._deserialize(type, value)
380
383
  case type.to_sym
381
384
  when :Time
382
385
  Time.parse(value)
@@ -411,7 +414,7 @@ module Conekta
411
414
  else # model
412
415
  # models (e.g. Pet) or oneOf
413
416
  klass = Conekta.const_get(type)
414
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
417
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
415
418
  end
416
419
  end
417
420
 
@@ -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?(:'has_more')
92
92
  self.has_more = attributes[:'has_more']
93
+ else
94
+ self.has_more = nil
93
95
  end
94
96
 
95
97
  if attributes.key?(:'object')
96
98
  self.object = attributes[:'object']
99
+ else
100
+ self.object = nil
97
101
  end
98
102
 
99
103
  if attributes.key?(:'next_page_url')
@@ -114,6 +118,7 @@ module Conekta
114
118
  # Show invalid properties with the reasons. Usually used together with valid?
115
119
  # @return Array for valid properties with the reasons
116
120
  def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
117
122
  invalid_properties = Array.new
118
123
  if @has_more.nil?
119
124
  invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
@@ -129,6 +134,7 @@ module Conekta
129
134
  # Check to see if the all the properties in the model are valid
130
135
  # @return true if the model is valid
131
136
  def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
138
  return false if @has_more.nil?
133
139
  return false if @object.nil?
134
140
  true
@@ -162,37 +168,30 @@ module Conekta
162
168
  # @param [Hash] attributes Model attributes in the form of hash
163
169
  # @return [Object] Returns the model itself
164
170
  def self.build_from_hash(attributes)
165
- new.build_from_hash(attributes)
166
- end
167
-
168
- # Builds the object from hash
169
- # @param [Hash] attributes Model attributes in the form of hash
170
- # @return [Object] Returns the model itself
171
- def build_from_hash(attributes)
172
171
  return nil unless attributes.is_a?(Hash)
173
172
  attributes = attributes.transform_keys(&:to_sym)
174
- self.class.openapi_types.each_pair do |key, type|
175
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
176
- self.send("#{key}=", nil)
173
+ transformed_hash = {}
174
+ openapi_types.each_pair do |key, type|
175
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = nil
177
177
  elsif type =~ /\AArray<(.*)>/i
178
178
  # check to ensure the input is an array given that the attribute
179
179
  # is documented as an array but the input is not
180
- if attributes[self.class.attribute_map[key]].is_a?(Array)
181
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ if attributes[attribute_map[key]].is_a?(Array)
181
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
182
  end
183
- elsif !attributes[self.class.attribute_map[key]].nil?
184
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ elsif !attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
185
185
  end
186
186
  end
187
-
188
- self
187
+ new(transformed_hash)
189
188
  end
190
189
 
191
190
  # Deserializes the data based on type
192
191
  # @param string type Data type
193
192
  # @param string value Value to be deserialized
194
193
  # @return [Object] Deserialized data
195
- def _deserialize(type, value)
194
+ def self._deserialize(type, value)
196
195
  case type.to_sym
197
196
  when :Time
198
197
  Time.parse(value)
@@ -227,7 +226,7 @@ module Conekta
227
226
  else # model
228
227
  # models (e.g. Pet) or oneOf
229
228
  klass = Conekta.const_get(type)
230
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
230
  end
232
231
  end
233
232
 
@@ -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
 
@@ -67,6 +67,7 @@ module Conekta
67
67
  # Show invalid properties with the reasons. Usually used together with valid?
68
68
  # @return Array for valid properties with the reasons
69
69
  def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
70
71
  invalid_properties = Array.new
71
72
  invalid_properties
72
73
  end
@@ -74,6 +75,7 @@ module Conekta
74
75
  # Check to see if the all the properties in the model are valid
75
76
  # @return true if the model is valid
76
77
  def valid?
78
+ warn '[DEPRECATED] the `valid?` method is obsolete'
77
79
  true
78
80
  end
79
81
 
@@ -101,37 +103,30 @@ module Conekta
101
103
  # @param [Hash] attributes Model attributes in the form of hash
102
104
  # @return [Object] Returns the model itself
103
105
  def self.build_from_hash(attributes)
104
- new.build_from_hash(attributes)
105
- end
106
-
107
- # Builds the object from hash
108
- # @param [Hash] attributes Model attributes in the form of hash
109
- # @return [Object] Returns the model itself
110
- def build_from_hash(attributes)
111
106
  return nil unless attributes.is_a?(Hash)
112
107
  attributes = attributes.transform_keys(&:to_sym)
113
- self.class.openapi_types.each_pair do |key, type|
114
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
- self.send("#{key}=", nil)
108
+ transformed_hash = {}
109
+ openapi_types.each_pair do |key, type|
110
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
111
+ transformed_hash["#{key}"] = nil
116
112
  elsif type =~ /\AArray<(.*)>/i
117
113
  # check to ensure the input is an array given that the attribute
118
114
  # is documented as an array but the input is not
119
- if attributes[self.class.attribute_map[key]].is_a?(Array)
120
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
115
+ if attributes[attribute_map[key]].is_a?(Array)
116
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
117
  end
122
- elsif !attributes[self.class.attribute_map[key]].nil?
123
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ elsif !attributes[attribute_map[key]].nil?
119
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
120
  end
125
121
  end
126
-
127
- self
122
+ new(transformed_hash)
128
123
  end
129
124
 
130
125
  # Deserializes the data based on type
131
126
  # @param string type Data type
132
127
  # @param string value Value to be deserialized
133
128
  # @return [Object] Deserialized data
134
- def _deserialize(type, value)
129
+ def self._deserialize(type, value)
135
130
  case type.to_sym
136
131
  when :Time
137
132
  Time.parse(value)
@@ -166,7 +161,7 @@ module Conekta
166
161
  else # model
167
162
  # models (e.g. Pet) or oneOf
168
163
  klass = Conekta.const_get(type)
169
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
165
  end
171
166
  end
172
167
 
@@ -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
 
@@ -161,6 +161,7 @@ module Conekta
161
161
  # Show invalid properties with the reasons. Usually used together with valid?
162
162
  # @return Array for valid properties with the reasons
163
163
  def list_invalid_properties
164
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
164
165
  invalid_properties = Array.new
165
166
  invalid_properties
166
167
  end
@@ -168,6 +169,7 @@ module Conekta
168
169
  # Check to see if the all the properties in the model are valid
169
170
  # @return true if the model is valid
170
171
  def valid?
172
+ warn '[DEPRECATED] the `valid?` method is obsolete'
171
173
  object_validator = EnumAttributeValidator.new('String', ["address"])
172
174
  return false unless object_validator.valid?(@object)
173
175
  true
@@ -215,37 +217,30 @@ module Conekta
215
217
  # @param [Hash] attributes Model attributes in the form of hash
216
218
  # @return [Object] Returns the model itself
217
219
  def self.build_from_hash(attributes)
218
- new.build_from_hash(attributes)
219
- end
220
-
221
- # Builds the object from hash
222
- # @param [Hash] attributes Model attributes in the form of hash
223
- # @return [Object] Returns the model itself
224
- def build_from_hash(attributes)
225
220
  return nil unless attributes.is_a?(Hash)
226
221
  attributes = attributes.transform_keys(&:to_sym)
227
- self.class.openapi_types.each_pair do |key, type|
228
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
229
- self.send("#{key}=", nil)
222
+ transformed_hash = {}
223
+ openapi_types.each_pair do |key, type|
224
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = nil
230
226
  elsif type =~ /\AArray<(.*)>/i
231
227
  # check to ensure the input is an array given that the attribute
232
228
  # is documented as an array but the input is not
233
- if attributes[self.class.attribute_map[key]].is_a?(Array)
234
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
229
+ if attributes[attribute_map[key]].is_a?(Array)
230
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
235
231
  end
236
- elsif !attributes[self.class.attribute_map[key]].nil?
237
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
232
+ elsif !attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
238
234
  end
239
235
  end
240
-
241
- self
236
+ new(transformed_hash)
242
237
  end
243
238
 
244
239
  # Deserializes the data based on type
245
240
  # @param string type Data type
246
241
  # @param string value Value to be deserialized
247
242
  # @return [Object] Deserialized data
248
- def _deserialize(type, value)
243
+ def self._deserialize(type, value)
249
244
  case type.to_sym
250
245
  when :Time
251
246
  Time.parse(value)
@@ -280,7 +275,7 @@ module Conekta
280
275
  else # model
281
276
  # models (e.g. Pet) or oneOf
282
277
  klass = Conekta.const_get(type)
283
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
278
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
284
279
  end
285
280
  end
286
281
 
@@ -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
 
@@ -142,6 +142,7 @@ module Conekta
142
142
  # Show invalid properties with the reasons. Usually used together with valid?
143
143
  # @return Array for valid properties with the reasons
144
144
  def list_invalid_properties
145
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
145
146
  invalid_properties = Array.new
146
147
  invalid_properties
147
148
  end
@@ -149,6 +150,7 @@ module Conekta
149
150
  # Check to see if the all the properties in the model are valid
150
151
  # @return true if the model is valid
151
152
  def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
152
154
  object_validator = EnumAttributeValidator.new('String', ["fiscal_info"])
153
155
  return false unless object_validator.valid?(@object)
154
156
  true
@@ -194,37 +196,30 @@ module Conekta
194
196
  # @param [Hash] attributes Model attributes in the form of hash
195
197
  # @return [Object] Returns the model itself
196
198
  def self.build_from_hash(attributes)
197
- new.build_from_hash(attributes)
198
- end
199
-
200
- # Builds the object from hash
201
- # @param [Hash] attributes Model attributes in the form of hash
202
- # @return [Object] Returns the model itself
203
- def build_from_hash(attributes)
204
199
  return nil unless attributes.is_a?(Hash)
205
200
  attributes = attributes.transform_keys(&:to_sym)
206
- self.class.openapi_types.each_pair do |key, type|
207
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
208
- self.send("#{key}=", nil)
201
+ transformed_hash = {}
202
+ openapi_types.each_pair do |key, type|
203
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = nil
209
205
  elsif type =~ /\AArray<(.*)>/i
210
206
  # check to ensure the input is an array given that the attribute
211
207
  # is documented as an array but the input is not
212
- if attributes[self.class.attribute_map[key]].is_a?(Array)
213
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
208
+ if attributes[attribute_map[key]].is_a?(Array)
209
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
214
210
  end
215
- elsif !attributes[self.class.attribute_map[key]].nil?
216
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
211
+ elsif !attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
217
213
  end
218
214
  end
219
-
220
- self
215
+ new(transformed_hash)
221
216
  end
222
217
 
223
218
  # Deserializes the data based on type
224
219
  # @param string type Data type
225
220
  # @param string value Value to be deserialized
226
221
  # @return [Object] Deserialized data
227
- def _deserialize(type, value)
222
+ def self._deserialize(type, value)
228
223
  case type.to_sym
229
224
  when :Time
230
225
  Time.parse(value)
@@ -259,7 +254,7 @@ module Conekta
259
254
  else # model
260
255
  # models (e.g. Pet) or oneOf
261
256
  klass = Conekta.const_get(type)
262
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
257
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
263
258
  end
264
259
  end
265
260