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