conekta 6.0.1 → 6.0.3

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 (293) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Makefile +3 -2
  4. data/README.md +17 -48
  5. data/VERSION +1 -1
  6. data/conekta.gemspec +2 -1
  7. data/config-ruby.json +1 -1
  8. data/docs/ApiKeyCreateResponse.md +3 -3
  9. data/docs/CheckoutRequest.md +2 -0
  10. data/docs/CreateCustomerFiscalEntitiesResponse.md +1 -1
  11. data/docs/Customer.md +1 -1
  12. data/docs/CustomerFiscalEntitiesDataResponse.md +1 -1
  13. data/docs/CustomerFiscalEntitiesRequest.md +1 -1
  14. data/docs/CustomerResponse.md +1 -1
  15. data/docs/CustomerShippingContacts.md +1 -1
  16. data/docs/CustomerShippingContactsDataResponse.md +1 -1
  17. data/docs/CustomerShippingContactsResponse.md +1 -1
  18. data/docs/CustomerUpdateFiscalEntitiesRequest.md +1 -1
  19. data/docs/CustomerUpdateShippingContacts.md +1 -1
  20. data/docs/CustomersApi.md +2 -2
  21. data/docs/CustomersResponse.md +3 -3
  22. data/docs/EventTypes.md +15 -0
  23. data/docs/OrderFiscalEntityRequest.md +1 -1
  24. data/docs/OrderFiscalEntityResponse.md +1 -1
  25. data/docs/OrderResponseCheckout.md +2 -0
  26. data/docs/OrderResponseCustomerInfo.md +2 -2
  27. data/docs/OrderResponseShippingContact.md +7 -7
  28. data/docs/OrderUpdateFiscalEntityRequest.md +1 -1
  29. data/docs/OrdersApi.md +15 -1
  30. data/docs/Payout.md +18 -0
  31. data/docs/PayoutMethod.md +18 -0
  32. data/docs/PayoutOrder.md +30 -0
  33. data/docs/PayoutOrderPayoutsItem.md +32 -0
  34. data/docs/PayoutOrderResponse.md +44 -0
  35. data/docs/PayoutOrderResponseCustomerInfo.md +30 -0
  36. data/docs/PayoutOrdersApi.md +235 -0
  37. data/docs/PayoutOrdersResponse.md +26 -0
  38. data/docs/Product.md +1 -1
  39. data/docs/ProductDataResponse.md +1 -1
  40. data/docs/ProductOrderResponse.md +1 -1
  41. data/docs/UpdateCustomer.md +1 -1
  42. data/docs/UpdateCustomerFiscalEntitiesResponse.md +1 -1
  43. data/docs/WebhooksApi.md +2 -0
  44. data/lib/conekta/api/antifraud_api.rb +1 -1
  45. data/lib/conekta/api/api_keys_api.rb +1 -1
  46. data/lib/conekta/api/balances_api.rb +1 -1
  47. data/lib/conekta/api/charges_api.rb +1 -1
  48. data/lib/conekta/api/companies_api.rb +1 -1
  49. data/lib/conekta/api/customers_api.rb +1 -1
  50. data/lib/conekta/api/discounts_api.rb +1 -1
  51. data/lib/conekta/api/events_api.rb +1 -1
  52. data/lib/conekta/api/logs_api.rb +1 -1
  53. data/lib/conekta/api/orders_api.rb +22 -1
  54. data/lib/conekta/api/payment_link_api.rb +1 -1
  55. data/lib/conekta/api/payment_methods_api.rb +1 -1
  56. data/lib/conekta/api/payout_orders_api.rb +251 -0
  57. data/lib/conekta/api/plans_api.rb +1 -1
  58. data/lib/conekta/api/products_api.rb +1 -1
  59. data/lib/conekta/api/shipping_contacts_api.rb +1 -1
  60. data/lib/conekta/api/shippings_api.rb +1 -1
  61. data/lib/conekta/api/subscriptions_api.rb +1 -1
  62. data/lib/conekta/api/taxes_api.rb +1 -1
  63. data/lib/conekta/api/tokens_api.rb +1 -1
  64. data/lib/conekta/api/transactions_api.rb +1 -1
  65. data/lib/conekta/api/transfers_api.rb +1 -1
  66. data/lib/conekta/api/webhook_keys_api.rb +1 -1
  67. data/lib/conekta/api/webhooks_api.rb +4 -1
  68. data/lib/conekta/api_client.rb +4 -4
  69. data/lib/conekta/api_error.rb +1 -1
  70. data/lib/conekta/configuration.rb +1 -1
  71. data/lib/conekta/models/api_key_create_response.rb +15 -16
  72. data/lib/conekta/models/api_key_request.rb +1 -1
  73. data/lib/conekta/models/api_key_response.rb +1 -1
  74. data/lib/conekta/models/api_key_response_on_delete.rb +1 -1
  75. data/lib/conekta/models/api_key_update_request.rb +1 -1
  76. data/lib/conekta/models/balance_common_field.rb +1 -1
  77. data/lib/conekta/models/balance_response.rb +1 -1
  78. data/lib/conekta/models/blacklist_rule_response.rb +1 -1
  79. data/lib/conekta/models/charge_order_response.rb +1 -1
  80. data/lib/conekta/models/charge_order_response_payment_method.rb +1 -1
  81. data/lib/conekta/models/charge_request.rb +1 -1
  82. data/lib/conekta/models/charge_request_payment_method.rb +1 -1
  83. data/lib/conekta/models/charge_response.rb +1 -1
  84. data/lib/conekta/models/charge_response_channel.rb +1 -1
  85. data/lib/conekta/models/charge_response_payment_method.rb +1 -1
  86. data/lib/conekta/models/charge_response_refunds.rb +1 -2
  87. data/lib/conekta/models/charge_response_refunds_data.rb +1 -1
  88. data/lib/conekta/models/charge_update_request.rb +1 -1
  89. data/lib/conekta/models/charges_data_response.rb +1 -1
  90. data/lib/conekta/models/checkout.rb +1 -1
  91. data/lib/conekta/models/checkout_order_template.rb +1 -1
  92. data/lib/conekta/models/checkout_order_template_customer_info.rb +2 -2
  93. data/lib/conekta/models/checkout_request.rb +12 -2
  94. data/lib/conekta/models/checkout_response.rb +1 -1
  95. data/lib/conekta/models/checkouts_response.rb +1 -2
  96. data/lib/conekta/models/company_fiscal_info_address_response.rb +1 -1
  97. data/lib/conekta/models/company_fiscal_info_response.rb +1 -1
  98. data/lib/conekta/models/company_payout_destination_response.rb +1 -1
  99. data/lib/conekta/models/company_response.rb +1 -1
  100. data/lib/conekta/models/create_customer_fiscal_entities_response.rb +2 -3
  101. data/lib/conekta/models/create_customer_payment_methods_request.rb +2 -2
  102. data/lib/conekta/models/create_customer_payment_methods_response.rb +1 -1
  103. data/lib/conekta/models/create_risk_rules_data.rb +1 -1
  104. data/lib/conekta/models/customer.rb +1 -1
  105. data/lib/conekta/models/customer_address.rb +1 -1
  106. data/lib/conekta/models/customer_antifraud_info.rb +1 -1
  107. data/lib/conekta/models/customer_antifraud_info_response.rb +1 -1
  108. data/lib/conekta/models/customer_fiscal_entities_data_response.rb +2 -3
  109. data/lib/conekta/models/customer_fiscal_entities_request.rb +2 -2
  110. data/lib/conekta/models/customer_fiscal_entities_response.rb +1 -2
  111. data/lib/conekta/models/customer_info.rb +1 -1
  112. data/lib/conekta/models/customer_info_just_customer_id.rb +1 -1
  113. data/lib/conekta/models/customer_info_just_customer_id_response.rb +1 -1
  114. data/lib/conekta/models/customer_payment_method_request.rb +1 -1
  115. data/lib/conekta/models/customer_payment_methods_data.rb +1 -1
  116. data/lib/conekta/models/customer_payment_methods_request.rb +2 -2
  117. data/lib/conekta/models/customer_payment_methods_response.rb +1 -2
  118. data/lib/conekta/models/customer_response.rb +1 -1
  119. data/lib/conekta/models/customer_response_shipping_contacts.rb +1 -2
  120. data/lib/conekta/models/customer_shipping_contacts.rb +1 -1
  121. data/lib/conekta/models/customer_shipping_contacts_address.rb +1 -1
  122. data/lib/conekta/models/customer_shipping_contacts_data_response.rb +2 -3
  123. data/lib/conekta/models/customer_shipping_contacts_response.rb +1 -1
  124. data/lib/conekta/models/customer_shipping_contacts_response_address.rb +1 -1
  125. data/lib/conekta/models/customer_update_fiscal_entities_request.rb +2 -2
  126. data/lib/conekta/models/customer_update_shipping_contacts.rb +1 -1
  127. data/lib/conekta/models/customers_response.rb +17 -18
  128. data/lib/conekta/models/delete_api_keys_response.rb +2 -3
  129. data/lib/conekta/models/deleted_blacklist_rule_response.rb +1 -1
  130. data/lib/conekta/models/deleted_whitelist_rule_response.rb +1 -1
  131. data/lib/conekta/models/details.rb +1 -1
  132. data/lib/conekta/models/details_error.rb +1 -1
  133. data/lib/conekta/models/discount_lines_data_response.rb +1 -1
  134. data/lib/conekta/models/discount_lines_response.rb +1 -2
  135. data/lib/conekta/models/email_checkout_request.rb +1 -1
  136. data/lib/conekta/models/error.rb +2 -3
  137. data/lib/conekta/models/event_response.rb +1 -1
  138. data/lib/conekta/models/event_types.rb +43 -0
  139. data/lib/conekta/models/events_resend_response.rb +1 -1
  140. data/lib/conekta/models/fiscal_entity_address.rb +1 -1
  141. data/lib/conekta/models/get_api_keys_response.rb +1 -2
  142. data/lib/conekta/models/get_charges_response.rb +1 -2
  143. data/lib/conekta/models/get_companies_response.rb +1 -2
  144. data/lib/conekta/models/get_customer_payment_method_data_response.rb +1 -1
  145. data/lib/conekta/models/get_events_response.rb +1 -2
  146. data/lib/conekta/models/get_order_discount_lines_response.rb +1 -2
  147. data/lib/conekta/models/get_orders_response.rb +1 -1
  148. data/lib/conekta/models/get_payment_method_response.rb +1 -2
  149. data/lib/conekta/models/get_plans_response.rb +1 -2
  150. data/lib/conekta/models/get_transactions_response.rb +1 -2
  151. data/lib/conekta/models/get_transfers_response.rb +1 -2
  152. data/lib/conekta/models/get_webhook_keys_response.rb +1 -2
  153. data/lib/conekta/models/get_webhooks_response.rb +1 -2
  154. data/lib/conekta/models/log_response.rb +1 -1
  155. data/lib/conekta/models/logs_response.rb +1 -1
  156. data/lib/conekta/models/logs_response_data.rb +1 -1
  157. data/lib/conekta/models/order_capture_request.rb +1 -1
  158. data/lib/conekta/models/order_customer_info_response.rb +1 -1
  159. data/lib/conekta/models/order_discount_lines_request.rb +1 -1
  160. data/lib/conekta/models/order_fiscal_entity_address_response.rb +2 -3
  161. data/lib/conekta/models/order_fiscal_entity_request.rb +1 -1
  162. data/lib/conekta/models/order_fiscal_entity_response.rb +1 -1
  163. data/lib/conekta/models/order_next_action_response.rb +1 -1
  164. data/lib/conekta/models/order_next_action_response_redirect_to_url.rb +1 -1
  165. data/lib/conekta/models/order_refund_request.rb +1 -1
  166. data/lib/conekta/models/order_request.rb +1 -1
  167. data/lib/conekta/models/order_request_customer_info.rb +2 -2
  168. data/lib/conekta/models/order_response.rb +1 -1
  169. data/lib/conekta/models/order_response_charges.rb +1 -2
  170. data/lib/conekta/models/order_response_checkout.rb +13 -2
  171. data/lib/conekta/models/order_response_customer_info.rb +12 -13
  172. data/lib/conekta/models/order_response_discount_lines.rb +1 -2
  173. data/lib/conekta/models/order_response_products.rb +1 -2
  174. data/lib/conekta/models/order_response_shipping_contact.rb +30 -31
  175. data/lib/conekta/models/order_tax_request.rb +1 -1
  176. data/lib/conekta/models/order_update_fiscal_entity_request.rb +1 -1
  177. data/lib/conekta/models/order_update_request.rb +1 -1
  178. data/lib/conekta/models/order_update_request_customer_info.rb +2 -2
  179. data/lib/conekta/models/orders_response.rb +1 -1
  180. data/lib/conekta/models/page.rb +1 -1
  181. data/lib/conekta/models/pagination.rb +1 -1
  182. data/lib/conekta/models/payment_method.rb +1 -1
  183. data/lib/conekta/models/payment_method_bank_transfer.rb +1 -2
  184. data/lib/conekta/models/payment_method_card.rb +1 -2
  185. data/lib/conekta/models/payment_method_card_request.rb +2 -3
  186. data/lib/conekta/models/payment_method_card_response.rb +1 -2
  187. data/lib/conekta/models/payment_method_cash.rb +1 -2
  188. data/lib/conekta/models/payment_method_cash_request.rb +2 -3
  189. data/lib/conekta/models/payment_method_cash_response.rb +1 -2
  190. data/lib/conekta/models/payment_method_response.rb +1 -1
  191. data/lib/conekta/models/payment_method_spei_recurrent.rb +2 -3
  192. data/lib/conekta/models/payment_method_spei_request.rb +2 -3
  193. data/lib/conekta/models/payout.rb +222 -0
  194. data/lib/conekta/models/payout_method.rb +223 -0
  195. data/lib/conekta/models/payout_order.rb +339 -0
  196. data/lib/conekta/models/payout_order_payouts_item.rb +320 -0
  197. data/lib/conekta/models/payout_order_response.rb +466 -0
  198. data/lib/conekta/models/payout_order_response_customer_info.rb +288 -0
  199. data/lib/conekta/models/payout_orders_response.rb +280 -0
  200. data/lib/conekta/models/plan_request.rb +1 -1
  201. data/lib/conekta/models/plan_response.rb +1 -1
  202. data/lib/conekta/models/plan_update_request.rb +1 -1
  203. data/lib/conekta/models/product.rb +2 -2
  204. data/lib/conekta/models/product_data_response.rb +3 -4
  205. data/lib/conekta/models/product_order_response.rb +3 -4
  206. data/lib/conekta/models/risk_rules_data.rb +1 -1
  207. data/lib/conekta/models/risk_rules_list.rb +2 -3
  208. data/lib/conekta/models/shipping_order_response.rb +1 -2
  209. data/lib/conekta/models/shipping_request.rb +1 -1
  210. data/lib/conekta/models/sms_checkout_request.rb +1 -1
  211. data/lib/conekta/models/subscription_events_response.rb +1 -2
  212. data/lib/conekta/models/subscription_request.rb +1 -1
  213. data/lib/conekta/models/subscription_response.rb +1 -1
  214. data/lib/conekta/models/subscription_update_request.rb +1 -1
  215. data/lib/conekta/models/token.rb +1 -1
  216. data/lib/conekta/models/token_card.rb +1 -1
  217. data/lib/conekta/models/token_checkout.rb +1 -1
  218. data/lib/conekta/models/token_response.rb +1 -1
  219. data/lib/conekta/models/token_response_checkout.rb +1 -1
  220. data/lib/conekta/models/transaction_response.rb +1 -1
  221. data/lib/conekta/models/transfer_destination_response.rb +1 -1
  222. data/lib/conekta/models/transfer_method_response.rb +1 -1
  223. data/lib/conekta/models/transfer_response.rb +1 -1
  224. data/lib/conekta/models/transfers_response.rb +1 -1
  225. data/lib/conekta/models/update_customer.rb +1 -1
  226. data/lib/conekta/models/update_customer_antifraud_info.rb +1 -1
  227. data/lib/conekta/models/update_customer_fiscal_entities_response.rb +3 -4
  228. data/lib/conekta/models/update_customer_payment_methods_response.rb +1 -1
  229. data/lib/conekta/models/update_order_discount_lines_request.rb +1 -1
  230. data/lib/conekta/models/update_order_tax_request.rb +1 -1
  231. data/lib/conekta/models/update_order_tax_response.rb +2 -3
  232. data/lib/conekta/models/update_payment_methods.rb +1 -1
  233. data/lib/conekta/models/update_product.rb +1 -1
  234. data/lib/conekta/models/webhook_key_create_response.rb +1 -1
  235. data/lib/conekta/models/webhook_key_delete_response.rb +1 -1
  236. data/lib/conekta/models/webhook_key_request.rb +1 -1
  237. data/lib/conekta/models/webhook_key_response.rb +1 -1
  238. data/lib/conekta/models/webhook_key_update_request.rb +1 -1
  239. data/lib/conekta/models/webhook_log.rb +1 -1
  240. data/lib/conekta/models/webhook_request.rb +1 -1
  241. data/lib/conekta/models/webhook_response.rb +1 -1
  242. data/lib/conekta/models/webhook_update_request.rb +1 -1
  243. data/lib/conekta/models/whitelistlist_rule_response.rb +1 -1
  244. data/lib/conekta/version.rb +2 -2
  245. data/lib/conekta.rb +10 -44
  246. data/spec/api/customers_api_spec.rb +2 -2
  247. data/spec/api/payout_orders_api_spec.rb +77 -0
  248. data/spec/spec_helper.rb +1 -1
  249. data/templates/ruby/api_client.mustache +1 -0
  250. metadata +54 -63
  251. data/docs/ApiKeyCreateResponseAllOf.md +0 -18
  252. data/docs/ChargeDataPaymentMethodBankTransferResponse.md +0 -48
  253. data/docs/ChargeDataPaymentMethodCardResponse.md +0 -38
  254. data/docs/ChargeDataPaymentMethodCashResponse.md +0 -32
  255. data/docs/ChargeResponseRefundsAllOf.md +0 -18
  256. data/docs/CheckoutsResponseAllOf.md +0 -18
  257. data/docs/CreateCustomerFiscalEntitiesResponseAllOf.md +0 -26
  258. data/docs/CustomerFiscalEntitiesRequestAddress.md +0 -32
  259. data/docs/CustomerFiscalEntitiesResponseAllOf.md +0 -18
  260. data/docs/CustomerPaymentMethods.md +0 -18
  261. data/docs/CustomerResponseShippingContactsAllOf.md +0 -18
  262. data/docs/CustomerShippingContactsDataResponseAllOf.md +0 -22
  263. data/docs/CustomersResponseAllOf.md +0 -18
  264. data/docs/DeleteApiKeysResponseAllOf.md +0 -18
  265. data/docs/DiscountLinesResponseAllOf.md +0 -22
  266. data/docs/ErrorAllOf.md +0 -22
  267. data/docs/GetApiKeysResponseAllOf.md +0 -18
  268. data/docs/GetChargesResponseAllOf.md +0 -18
  269. data/docs/GetCompaniesResponseAllOf.md +0 -18
  270. data/docs/GetEventsResponseAllOf.md +0 -18
  271. data/docs/GetOrderDiscountLinesResponseAllOf.md +0 -18
  272. data/docs/GetPaymentMethodResponseAllOf.md +0 -18
  273. data/docs/GetPlansResponseAllOf.md +0 -18
  274. data/docs/GetTransactionsResponseAllOf.md +0 -18
  275. data/docs/GetTransfersResponseAllOf.md +0 -18
  276. data/docs/GetWebhookKeysResponseAllOf.md +0 -18
  277. data/docs/GetWebhooksResponseAllOf.md +0 -18
  278. data/docs/OrderFiscalEntityAddressResponseAllOf.md +0 -18
  279. data/docs/OrderResponseChargesAllOf.md +0 -18
  280. data/docs/OrderResponseCustomerInfoAllOf.md +0 -18
  281. data/docs/OrderResponseDiscountLinesAllOf.md +0 -18
  282. data/docs/OrderResponseProductsAllOf.md +0 -18
  283. data/docs/OrderResponseShippingContactAllOf.md +0 -22
  284. data/docs/PaymentMethodCardRequestAllOf.md +0 -18
  285. data/docs/PaymentMethodCardResponseAllOf.md +0 -36
  286. data/docs/PaymentMethodCashRequestAllOf.md +0 -18
  287. data/docs/PaymentMethodCashResponseAllOf.md +0 -26
  288. data/docs/PaymentMethodSpeiRecurrentAllOf.md +0 -20
  289. data/docs/ProductDataResponseAllOf.md +0 -22
  290. data/docs/ProductOrderResponseAllOf.md +0 -22
  291. data/docs/RiskRules.md +0 -18
  292. data/docs/UpdateCustomerFiscalEntitiesResponseAllOf.md +0 -26
  293. data/docs/UpdateOrderTaxResponseAllOf.md +0 -22
@@ -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: 7.1.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -69,8 +69,7 @@ module Conekta
69
69
  # List of class defined in allOf (OpenAPI v3)
70
70
  def self.openapi_all_of
71
71
  [
72
- :'PaymentMethodResponse',
73
- :'PaymentMethodSpeiRecurrentAllOf'
72
+ :'PaymentMethodResponse'
74
73
  ]
75
74
  end
76
75
 
@@ -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: 7.1.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -50,8 +50,7 @@ module Conekta
50
50
  # List of class defined in allOf (OpenAPI v3)
51
51
  def self.openapi_all_of
52
52
  [
53
- :'CustomerPaymentMethodRequest',
54
- :'PaymentMethodCashRequestAllOf'
53
+ :'CustomerPaymentMethodRequest'
55
54
  ]
56
55
  end
57
56
 
@@ -0,0 +1,222 @@
1
+ =begin
2
+ #Conekta API
3
+
4
+ #Conekta sdk
5
+
6
+ The version of the OpenAPI document: 2.1.0
7
+ Contact: engineering@conekta.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Conekta
17
+ # The payout information of the payout order.
18
+ class Payout
19
+ attr_accessor :payout_method
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'payout_method' => :'payout_method'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'payout_method' => :'PayoutMethod'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::Payout` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::Payout`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'payout_method')
62
+ self.payout_method = attributes[:'payout_method']
63
+ else
64
+ self.payout_method = nil
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
72
+ invalid_properties = Array.new
73
+ if @payout_method.nil?
74
+ invalid_properties.push('invalid value for "payout_method", payout_method cannot be nil.')
75
+ end
76
+
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ return false if @payout_method.nil?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ payout_method == o.payout_method
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [payout_method].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def self._deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = Conekta.const_get(type)
170
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #Conekta API
3
+
4
+ #Conekta sdk
5
+
6
+ The version of the OpenAPI document: 2.1.0
7
+ Contact: engineering@conekta.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Conekta
17
+ # The payout method of the payout order.
18
+ class PayoutMethod
19
+ # The type of the payout method.
20
+ attr_accessor :type
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'type' => :'type'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'type' => :'String'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::PayoutMethod` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::PayoutMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'type')
63
+ self.type = attributes[:'type']
64
+ else
65
+ self.type = nil
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
+ invalid_properties = Array.new
74
+ if @type.nil?
75
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
76
+ end
77
+
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ return false if @type.nil?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ type == o.type
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [type].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
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
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def self._deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = Conekta.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end