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