conekta 6.0.2 → 6.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1 -1
  3. data/README.md +17 -5
  4. data/VERSION +1 -1
  5. data/conekta.gemspec +2 -1
  6. data/config-ruby.json +1 -1
  7. data/docs/CheckoutRequest.md +2 -0
  8. data/docs/EventTypes.md +15 -0
  9. data/docs/OrderResponseCheckout.md +2 -0
  10. data/docs/OrdersApi.md +15 -1
  11. data/docs/Payout.md +18 -0
  12. data/docs/PayoutMethod.md +18 -0
  13. data/docs/PayoutOrder.md +30 -0
  14. data/docs/PayoutOrderPayoutsItem.md +32 -0
  15. data/docs/PayoutOrderResponse.md +44 -0
  16. data/docs/PayoutOrderResponseCustomerInfo.md +30 -0
  17. data/docs/PayoutOrdersApi.md +235 -0
  18. data/docs/PayoutOrdersResponse.md +26 -0
  19. data/docs/Product.md +1 -1
  20. data/docs/ProductDataResponse.md +1 -1
  21. data/docs/ProductOrderResponse.md +1 -1
  22. data/docs/WebhooksApi.md +2 -0
  23. data/lib/conekta/api/antifraud_api.rb +1 -1
  24. data/lib/conekta/api/api_keys_api.rb +1 -1
  25. data/lib/conekta/api/balances_api.rb +1 -1
  26. data/lib/conekta/api/charges_api.rb +1 -1
  27. data/lib/conekta/api/companies_api.rb +1 -1
  28. data/lib/conekta/api/customers_api.rb +1 -1
  29. data/lib/conekta/api/discounts_api.rb +1 -1
  30. data/lib/conekta/api/events_api.rb +1 -1
  31. data/lib/conekta/api/logs_api.rb +1 -1
  32. data/lib/conekta/api/orders_api.rb +22 -1
  33. data/lib/conekta/api/payment_link_api.rb +1 -1
  34. data/lib/conekta/api/payment_methods_api.rb +1 -1
  35. data/lib/conekta/api/payout_orders_api.rb +251 -0
  36. data/lib/conekta/api/plans_api.rb +1 -1
  37. data/lib/conekta/api/products_api.rb +1 -1
  38. data/lib/conekta/api/shipping_contacts_api.rb +1 -1
  39. data/lib/conekta/api/shippings_api.rb +1 -1
  40. data/lib/conekta/api/subscriptions_api.rb +1 -1
  41. data/lib/conekta/api/taxes_api.rb +1 -1
  42. data/lib/conekta/api/tokens_api.rb +1 -1
  43. data/lib/conekta/api/transactions_api.rb +1 -1
  44. data/lib/conekta/api/transfers_api.rb +1 -1
  45. data/lib/conekta/api/webhook_keys_api.rb +1 -1
  46. data/lib/conekta/api/webhooks_api.rb +4 -1
  47. data/lib/conekta/api_client.rb +3 -3
  48. data/lib/conekta/api_error.rb +1 -1
  49. data/lib/conekta/configuration.rb +1 -1
  50. data/lib/conekta/models/api_key_create_response.rb +1 -1
  51. data/lib/conekta/models/api_key_request.rb +1 -1
  52. data/lib/conekta/models/api_key_response.rb +1 -1
  53. data/lib/conekta/models/api_key_response_on_delete.rb +1 -1
  54. data/lib/conekta/models/api_key_update_request.rb +1 -1
  55. data/lib/conekta/models/balance_common_field.rb +1 -1
  56. data/lib/conekta/models/balance_response.rb +1 -1
  57. data/lib/conekta/models/blacklist_rule_response.rb +1 -1
  58. data/lib/conekta/models/charge_order_response.rb +1 -1
  59. data/lib/conekta/models/charge_order_response_payment_method.rb +1 -1
  60. data/lib/conekta/models/charge_request.rb +1 -1
  61. data/lib/conekta/models/charge_request_payment_method.rb +1 -1
  62. data/lib/conekta/models/charge_response.rb +1 -1
  63. data/lib/conekta/models/charge_response_channel.rb +1 -1
  64. data/lib/conekta/models/charge_response_payment_method.rb +1 -1
  65. data/lib/conekta/models/charge_response_refunds.rb +1 -1
  66. data/lib/conekta/models/charge_response_refunds_data.rb +1 -1
  67. data/lib/conekta/models/charge_update_request.rb +1 -1
  68. data/lib/conekta/models/charges_data_response.rb +1 -1
  69. data/lib/conekta/models/checkout.rb +1 -1
  70. data/lib/conekta/models/checkout_order_template.rb +1 -1
  71. data/lib/conekta/models/checkout_order_template_customer_info.rb +2 -2
  72. data/lib/conekta/models/checkout_request.rb +12 -2
  73. data/lib/conekta/models/checkout_response.rb +1 -1
  74. data/lib/conekta/models/checkouts_response.rb +1 -1
  75. data/lib/conekta/models/company_fiscal_info_address_response.rb +1 -1
  76. data/lib/conekta/models/company_fiscal_info_response.rb +1 -1
  77. data/lib/conekta/models/company_payout_destination_response.rb +1 -1
  78. data/lib/conekta/models/company_response.rb +1 -1
  79. data/lib/conekta/models/create_customer_fiscal_entities_response.rb +1 -1
  80. data/lib/conekta/models/create_customer_payment_methods_request.rb +2 -2
  81. data/lib/conekta/models/create_customer_payment_methods_response.rb +1 -1
  82. data/lib/conekta/models/create_risk_rules_data.rb +1 -1
  83. data/lib/conekta/models/customer.rb +1 -1
  84. data/lib/conekta/models/customer_address.rb +1 -1
  85. data/lib/conekta/models/customer_antifraud_info.rb +1 -1
  86. data/lib/conekta/models/customer_antifraud_info_response.rb +1 -1
  87. data/lib/conekta/models/customer_fiscal_entities_data_response.rb +1 -1
  88. data/lib/conekta/models/customer_fiscal_entities_request.rb +1 -1
  89. data/lib/conekta/models/customer_fiscal_entities_response.rb +1 -1
  90. data/lib/conekta/models/customer_info.rb +1 -1
  91. data/lib/conekta/models/customer_info_just_customer_id.rb +1 -1
  92. data/lib/conekta/models/customer_info_just_customer_id_response.rb +1 -1
  93. data/lib/conekta/models/customer_payment_method_request.rb +1 -1
  94. data/lib/conekta/models/customer_payment_methods_data.rb +1 -1
  95. data/lib/conekta/models/customer_payment_methods_request.rb +2 -2
  96. data/lib/conekta/models/customer_payment_methods_response.rb +1 -1
  97. data/lib/conekta/models/customer_response.rb +1 -1
  98. data/lib/conekta/models/customer_response_shipping_contacts.rb +1 -1
  99. data/lib/conekta/models/customer_shipping_contacts.rb +1 -1
  100. data/lib/conekta/models/customer_shipping_contacts_address.rb +1 -1
  101. data/lib/conekta/models/customer_shipping_contacts_data_response.rb +1 -1
  102. data/lib/conekta/models/customer_shipping_contacts_response.rb +1 -1
  103. data/lib/conekta/models/customer_shipping_contacts_response_address.rb +1 -1
  104. data/lib/conekta/models/customer_update_fiscal_entities_request.rb +1 -1
  105. data/lib/conekta/models/customer_update_shipping_contacts.rb +1 -1
  106. data/lib/conekta/models/customers_response.rb +1 -1
  107. data/lib/conekta/models/delete_api_keys_response.rb +1 -1
  108. data/lib/conekta/models/deleted_blacklist_rule_response.rb +1 -1
  109. data/lib/conekta/models/deleted_whitelist_rule_response.rb +1 -1
  110. data/lib/conekta/models/details.rb +1 -1
  111. data/lib/conekta/models/details_error.rb +1 -1
  112. data/lib/conekta/models/discount_lines_data_response.rb +1 -1
  113. data/lib/conekta/models/discount_lines_response.rb +1 -1
  114. data/lib/conekta/models/email_checkout_request.rb +1 -1
  115. data/lib/conekta/models/error.rb +1 -1
  116. data/lib/conekta/models/event_response.rb +1 -1
  117. data/lib/conekta/models/event_types.rb +43 -0
  118. data/lib/conekta/models/events_resend_response.rb +1 -1
  119. data/lib/conekta/models/fiscal_entity_address.rb +1 -1
  120. data/lib/conekta/models/get_api_keys_response.rb +1 -1
  121. data/lib/conekta/models/get_charges_response.rb +1 -1
  122. data/lib/conekta/models/get_companies_response.rb +1 -1
  123. data/lib/conekta/models/get_customer_payment_method_data_response.rb +1 -1
  124. data/lib/conekta/models/get_events_response.rb +1 -1
  125. data/lib/conekta/models/get_order_discount_lines_response.rb +1 -1
  126. data/lib/conekta/models/get_orders_response.rb +1 -1
  127. data/lib/conekta/models/get_payment_method_response.rb +1 -1
  128. data/lib/conekta/models/get_plans_response.rb +1 -1
  129. data/lib/conekta/models/get_transactions_response.rb +1 -1
  130. data/lib/conekta/models/get_transfers_response.rb +1 -1
  131. data/lib/conekta/models/get_webhook_keys_response.rb +1 -1
  132. data/lib/conekta/models/get_webhooks_response.rb +1 -1
  133. data/lib/conekta/models/log_response.rb +1 -1
  134. data/lib/conekta/models/logs_response.rb +1 -1
  135. data/lib/conekta/models/logs_response_data.rb +1 -1
  136. data/lib/conekta/models/order_capture_request.rb +1 -1
  137. data/lib/conekta/models/order_customer_info_response.rb +1 -1
  138. data/lib/conekta/models/order_discount_lines_request.rb +1 -1
  139. data/lib/conekta/models/order_fiscal_entity_address_response.rb +1 -1
  140. data/lib/conekta/models/order_fiscal_entity_request.rb +1 -1
  141. data/lib/conekta/models/order_fiscal_entity_response.rb +1 -1
  142. data/lib/conekta/models/order_next_action_response.rb +1 -1
  143. data/lib/conekta/models/order_next_action_response_redirect_to_url.rb +1 -1
  144. data/lib/conekta/models/order_refund_request.rb +1 -1
  145. data/lib/conekta/models/order_request.rb +1 -1
  146. data/lib/conekta/models/order_request_customer_info.rb +2 -2
  147. data/lib/conekta/models/order_response.rb +1 -1
  148. data/lib/conekta/models/order_response_charges.rb +1 -1
  149. data/lib/conekta/models/order_response_checkout.rb +13 -2
  150. data/lib/conekta/models/order_response_customer_info.rb +1 -1
  151. data/lib/conekta/models/order_response_discount_lines.rb +1 -1
  152. data/lib/conekta/models/order_response_products.rb +1 -1
  153. data/lib/conekta/models/order_response_shipping_contact.rb +1 -1
  154. data/lib/conekta/models/order_tax_request.rb +1 -1
  155. data/lib/conekta/models/order_update_fiscal_entity_request.rb +1 -1
  156. data/lib/conekta/models/order_update_request.rb +1 -1
  157. data/lib/conekta/models/order_update_request_customer_info.rb +2 -2
  158. data/lib/conekta/models/orders_response.rb +1 -1
  159. data/lib/conekta/models/page.rb +1 -1
  160. data/lib/conekta/models/pagination.rb +1 -1
  161. data/lib/conekta/models/payment_method.rb +1 -1
  162. data/lib/conekta/models/payment_method_bank_transfer.rb +1 -1
  163. data/lib/conekta/models/payment_method_card.rb +1 -1
  164. data/lib/conekta/models/payment_method_card_request.rb +1 -1
  165. data/lib/conekta/models/payment_method_card_response.rb +1 -1
  166. data/lib/conekta/models/payment_method_cash.rb +1 -1
  167. data/lib/conekta/models/payment_method_cash_request.rb +1 -1
  168. data/lib/conekta/models/payment_method_cash_response.rb +1 -1
  169. data/lib/conekta/models/payment_method_response.rb +1 -1
  170. data/lib/conekta/models/payment_method_spei_recurrent.rb +1 -1
  171. data/lib/conekta/models/payment_method_spei_request.rb +1 -1
  172. data/lib/conekta/models/payout.rb +222 -0
  173. data/lib/conekta/models/payout_method.rb +223 -0
  174. data/lib/conekta/models/payout_order.rb +339 -0
  175. data/lib/conekta/models/payout_order_payouts_item.rb +320 -0
  176. data/lib/conekta/models/payout_order_response.rb +466 -0
  177. data/lib/conekta/models/payout_order_response_customer_info.rb +288 -0
  178. data/lib/conekta/models/payout_orders_response.rb +280 -0
  179. data/lib/conekta/models/plan_request.rb +1 -1
  180. data/lib/conekta/models/plan_response.rb +1 -1
  181. data/lib/conekta/models/plan_update_request.rb +1 -1
  182. data/lib/conekta/models/product.rb +2 -2
  183. data/lib/conekta/models/product_data_response.rb +2 -2
  184. data/lib/conekta/models/product_order_response.rb +2 -2
  185. data/lib/conekta/models/risk_rules_data.rb +1 -1
  186. data/lib/conekta/models/risk_rules_list.rb +1 -1
  187. data/lib/conekta/models/shipping_order_response.rb +1 -1
  188. data/lib/conekta/models/shipping_request.rb +1 -1
  189. data/lib/conekta/models/sms_checkout_request.rb +1 -1
  190. data/lib/conekta/models/subscription_events_response.rb +1 -1
  191. data/lib/conekta/models/subscription_request.rb +1 -1
  192. data/lib/conekta/models/subscription_response.rb +1 -1
  193. data/lib/conekta/models/subscription_update_request.rb +1 -1
  194. data/lib/conekta/models/token.rb +1 -1
  195. data/lib/conekta/models/token_card.rb +1 -1
  196. data/lib/conekta/models/token_checkout.rb +1 -1
  197. data/lib/conekta/models/token_response.rb +1 -1
  198. data/lib/conekta/models/token_response_checkout.rb +1 -1
  199. data/lib/conekta/models/transaction_response.rb +1 -1
  200. data/lib/conekta/models/transfer_destination_response.rb +1 -1
  201. data/lib/conekta/models/transfer_method_response.rb +1 -1
  202. data/lib/conekta/models/transfer_response.rb +1 -1
  203. data/lib/conekta/models/transfers_response.rb +1 -1
  204. data/lib/conekta/models/update_customer.rb +1 -1
  205. data/lib/conekta/models/update_customer_antifraud_info.rb +1 -1
  206. data/lib/conekta/models/update_customer_fiscal_entities_response.rb +1 -1
  207. data/lib/conekta/models/update_customer_payment_methods_response.rb +1 -1
  208. data/lib/conekta/models/update_order_discount_lines_request.rb +1 -1
  209. data/lib/conekta/models/update_order_tax_request.rb +1 -1
  210. data/lib/conekta/models/update_order_tax_response.rb +1 -1
  211. data/lib/conekta/models/update_payment_methods.rb +1 -1
  212. data/lib/conekta/models/update_product.rb +1 -1
  213. data/lib/conekta/models/webhook_key_create_response.rb +1 -1
  214. data/lib/conekta/models/webhook_key_delete_response.rb +1 -1
  215. data/lib/conekta/models/webhook_key_request.rb +1 -1
  216. data/lib/conekta/models/webhook_key_response.rb +1 -1
  217. data/lib/conekta/models/webhook_key_update_request.rb +1 -1
  218. data/lib/conekta/models/webhook_log.rb +1 -1
  219. data/lib/conekta/models/webhook_request.rb +1 -1
  220. data/lib/conekta/models/webhook_response.rb +1 -1
  221. data/lib/conekta/models/webhook_update_request.rb +1 -1
  222. data/lib/conekta/models/whitelistlist_rule_response.rb +1 -1
  223. data/lib/conekta/version.rb +2 -2
  224. data/lib/conekta.rb +10 -1
  225. data/spec/api/payout_orders_api_spec.rb +77 -0
  226. data/spec/spec_helper.rb +1 -1
  227. data/templates/ruby/api_client.mustache +1 -0
  228. metadata +54 -20
@@ -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.2.0
9
+ Generator version: 7.5.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: 7.2.0
9
+ Generator version: 7.5.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: 7.2.0
9
+ Generator version: 7.5.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: 7.2.0
9
+ Generator version: 7.5.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: 7.2.0
9
+ Generator version: 7.5.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: 7.2.0
9
+ Generator version: 7.5.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: 7.2.0
9
+ Generator version: 7.5.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: 7.2.0
9
+ Generator version: 7.5.0
10
10
 
11
11
  =end
12
12
 
@@ -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