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
|
|
@@ -67,6 +67,7 @@ module Conekta
|
|
67
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
68
68
|
# @return Array for valid properties with the reasons
|
69
69
|
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
71
|
invalid_properties = Array.new
|
71
72
|
invalid_properties
|
72
73
|
end
|
@@ -74,6 +75,7 @@ module Conekta
|
|
74
75
|
# Check to see if the all the properties in the model are valid
|
75
76
|
# @return true if the model is valid
|
76
77
|
def valid?
|
78
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
77
79
|
true
|
78
80
|
end
|
79
81
|
|
@@ -101,37 +103,30 @@ module Conekta
|
|
101
103
|
# @param [Hash] attributes Model attributes in the form of hash
|
102
104
|
# @return [Object] Returns the model itself
|
103
105
|
def self.build_from_hash(attributes)
|
104
|
-
new.build_from_hash(attributes)
|
105
|
-
end
|
106
|
-
|
107
|
-
# Builds the object from hash
|
108
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
-
# @return [Object] Returns the model itself
|
110
|
-
def build_from_hash(attributes)
|
111
106
|
return nil unless attributes.is_a?(Hash)
|
112
107
|
attributes = attributes.transform_keys(&:to_sym)
|
113
|
-
|
114
|
-
|
115
|
-
|
108
|
+
transformed_hash = {}
|
109
|
+
openapi_types.each_pair do |key, type|
|
110
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
111
|
+
transformed_hash["#{key}"] = nil
|
116
112
|
elsif type =~ /\AArray<(.*)>/i
|
117
113
|
# check to ensure the input is an array given that the attribute
|
118
114
|
# is documented as an array but the input is not
|
119
|
-
if attributes[
|
120
|
-
|
115
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
116
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
121
117
|
end
|
122
|
-
elsif !attributes[
|
123
|
-
|
118
|
+
elsif !attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
124
120
|
end
|
125
121
|
end
|
126
|
-
|
127
|
-
self
|
122
|
+
new(transformed_hash)
|
128
123
|
end
|
129
124
|
|
130
125
|
# Deserializes the data based on type
|
131
126
|
# @param string type Data type
|
132
127
|
# @param string value Value to be deserialized
|
133
128
|
# @return [Object] Deserialized data
|
134
|
-
def _deserialize(type, value)
|
129
|
+
def self._deserialize(type, value)
|
135
130
|
case type.to_sym
|
136
131
|
when :Time
|
137
132
|
Time.parse(value)
|
@@ -166,7 +161,7 @@ module Conekta
|
|
166
161
|
else # model
|
167
162
|
# models (e.g. Pet) or oneOf
|
168
163
|
klass = Conekta.const_get(type)
|
169
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
165
|
end
|
171
166
|
end
|
172
167
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.1.0
|
7
7
|
Contact: engineering@conekta.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -90,6 +90,7 @@ module Conekta
|
|
90
90
|
# Show invalid properties with the reasons. Usually used together with valid?
|
91
91
|
# @return Array for valid properties with the reasons
|
92
92
|
def list_invalid_properties
|
93
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
93
94
|
invalid_properties = Array.new
|
94
95
|
invalid_properties
|
95
96
|
end
|
@@ -97,6 +98,7 @@ module Conekta
|
|
97
98
|
# Check to see if the all the properties in the model are valid
|
98
99
|
# @return true if the model is valid
|
99
100
|
def valid?
|
101
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
100
102
|
true
|
101
103
|
end
|
102
104
|
|
@@ -127,37 +129,30 @@ module Conekta
|
|
127
129
|
# @param [Hash] attributes Model attributes in the form of hash
|
128
130
|
# @return [Object] Returns the model itself
|
129
131
|
def self.build_from_hash(attributes)
|
130
|
-
new.build_from_hash(attributes)
|
131
|
-
end
|
132
|
-
|
133
|
-
# Builds the object from hash
|
134
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
-
# @return [Object] Returns the model itself
|
136
|
-
def build_from_hash(attributes)
|
137
132
|
return nil unless attributes.is_a?(Hash)
|
138
133
|
attributes = attributes.transform_keys(&:to_sym)
|
139
|
-
|
140
|
-
|
141
|
-
|
134
|
+
transformed_hash = {}
|
135
|
+
openapi_types.each_pair do |key, type|
|
136
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
137
|
+
transformed_hash["#{key}"] = nil
|
142
138
|
elsif type =~ /\AArray<(.*)>/i
|
143
139
|
# check to ensure the input is an array given that the attribute
|
144
140
|
# is documented as an array but the input is not
|
145
|
-
if attributes[
|
146
|
-
|
141
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
142
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
147
143
|
end
|
148
|
-
elsif !attributes[
|
149
|
-
|
144
|
+
elsif !attributes[attribute_map[key]].nil?
|
145
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
150
146
|
end
|
151
147
|
end
|
152
|
-
|
153
|
-
self
|
148
|
+
new(transformed_hash)
|
154
149
|
end
|
155
150
|
|
156
151
|
# Deserializes the data based on type
|
157
152
|
# @param string type Data type
|
158
153
|
# @param string value Value to be deserialized
|
159
154
|
# @return [Object] Deserialized data
|
160
|
-
def _deserialize(type, value)
|
155
|
+
def self._deserialize(type, value)
|
161
156
|
case type.to_sym
|
162
157
|
when :Time
|
163
158
|
Time.parse(value)
|
@@ -192,7 +187,7 @@ module Conekta
|
|
192
187
|
else # model
|
193
188
|
# models (e.g. Pet) or oneOf
|
194
189
|
klass = Conekta.const_get(type)
|
195
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
190
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
196
191
|
end
|
197
192
|
end
|
198
193
|
|
@@ -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
|
|
@@ -92,32 +92,45 @@ module Conekta
|
|
92
92
|
|
93
93
|
if attributes.key?(:'amount')
|
94
94
|
self.amount = attributes[:'amount']
|
95
|
+
else
|
96
|
+
self.amount = nil
|
95
97
|
end
|
96
98
|
|
97
99
|
if attributes.key?(:'code')
|
98
100
|
self.code = attributes[:'code']
|
101
|
+
else
|
102
|
+
self.code = nil
|
99
103
|
end
|
100
104
|
|
101
105
|
if attributes.key?(:'type')
|
102
106
|
self.type = attributes[:'type']
|
107
|
+
else
|
108
|
+
self.type = nil
|
103
109
|
end
|
104
110
|
|
105
111
|
if attributes.key?(:'id')
|
106
112
|
self.id = attributes[:'id']
|
113
|
+
else
|
114
|
+
self.id = nil
|
107
115
|
end
|
108
116
|
|
109
117
|
if attributes.key?(:'object')
|
110
118
|
self.object = attributes[:'object']
|
119
|
+
else
|
120
|
+
self.object = nil
|
111
121
|
end
|
112
122
|
|
113
123
|
if attributes.key?(:'parent_id')
|
114
124
|
self.parent_id = attributes[:'parent_id']
|
125
|
+
else
|
126
|
+
self.parent_id = nil
|
115
127
|
end
|
116
128
|
end
|
117
129
|
|
118
130
|
# Show invalid properties with the reasons. Usually used together with valid?
|
119
131
|
# @return Array for valid properties with the reasons
|
120
132
|
def list_invalid_properties
|
133
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
121
134
|
invalid_properties = Array.new
|
122
135
|
if @amount.nil?
|
123
136
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
@@ -153,6 +166,7 @@ module Conekta
|
|
153
166
|
# Check to see if the all the properties in the model are valid
|
154
167
|
# @return true if the model is valid
|
155
168
|
def valid?
|
169
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
156
170
|
return false if @amount.nil?
|
157
171
|
return false if @amount < 0
|
158
172
|
return false if @code.nil?
|
@@ -206,37 +220,30 @@ module Conekta
|
|
206
220
|
# @param [Hash] attributes Model attributes in the form of hash
|
207
221
|
# @return [Object] Returns the model itself
|
208
222
|
def self.build_from_hash(attributes)
|
209
|
-
new.build_from_hash(attributes)
|
210
|
-
end
|
211
|
-
|
212
|
-
# Builds the object from hash
|
213
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
214
|
-
# @return [Object] Returns the model itself
|
215
|
-
def build_from_hash(attributes)
|
216
223
|
return nil unless attributes.is_a?(Hash)
|
217
224
|
attributes = attributes.transform_keys(&:to_sym)
|
218
|
-
|
219
|
-
|
220
|
-
|
225
|
+
transformed_hash = {}
|
226
|
+
openapi_types.each_pair do |key, type|
|
227
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
228
|
+
transformed_hash["#{key}"] = nil
|
221
229
|
elsif type =~ /\AArray<(.*)>/i
|
222
230
|
# check to ensure the input is an array given that the attribute
|
223
231
|
# is documented as an array but the input is not
|
224
|
-
if attributes[
|
225
|
-
|
232
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
233
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
226
234
|
end
|
227
|
-
elsif !attributes[
|
228
|
-
|
235
|
+
elsif !attributes[attribute_map[key]].nil?
|
236
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
229
237
|
end
|
230
238
|
end
|
231
|
-
|
232
|
-
self
|
239
|
+
new(transformed_hash)
|
233
240
|
end
|
234
241
|
|
235
242
|
# Deserializes the data based on type
|
236
243
|
# @param string type Data type
|
237
244
|
# @param string value Value to be deserialized
|
238
245
|
# @return [Object] Deserialized data
|
239
|
-
def _deserialize(type, value)
|
246
|
+
def self._deserialize(type, value)
|
240
247
|
case type.to_sym
|
241
248
|
when :Time
|
242
249
|
Time.parse(value)
|
@@ -271,7 +278,7 @@ module Conekta
|
|
271
278
|
else # model
|
272
279
|
# models (e.g. Pet) or oneOf
|
273
280
|
klass = Conekta.const_get(type)
|
274
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
281
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
275
282
|
end
|
276
283
|
end
|
277
284
|
|
@@ -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
|
|
@@ -93,32 +93,45 @@ module Conekta
|
|
93
93
|
|
94
94
|
if attributes.key?(:'amount')
|
95
95
|
self.amount = attributes[:'amount']
|
96
|
+
else
|
97
|
+
self.amount = nil
|
96
98
|
end
|
97
99
|
|
98
100
|
if attributes.key?(:'code')
|
99
101
|
self.code = attributes[:'code']
|
102
|
+
else
|
103
|
+
self.code = nil
|
100
104
|
end
|
101
105
|
|
102
106
|
if attributes.key?(:'type')
|
103
107
|
self.type = attributes[:'type']
|
108
|
+
else
|
109
|
+
self.type = nil
|
104
110
|
end
|
105
111
|
|
106
112
|
if attributes.key?(:'id')
|
107
113
|
self.id = attributes[:'id']
|
114
|
+
else
|
115
|
+
self.id = nil
|
108
116
|
end
|
109
117
|
|
110
118
|
if attributes.key?(:'object')
|
111
119
|
self.object = attributes[:'object']
|
120
|
+
else
|
121
|
+
self.object = nil
|
112
122
|
end
|
113
123
|
|
114
124
|
if attributes.key?(:'parent_id')
|
115
125
|
self.parent_id = attributes[:'parent_id']
|
126
|
+
else
|
127
|
+
self.parent_id = nil
|
116
128
|
end
|
117
129
|
end
|
118
130
|
|
119
131
|
# Show invalid properties with the reasons. Usually used together with valid?
|
120
132
|
# @return Array for valid properties with the reasons
|
121
133
|
def list_invalid_properties
|
134
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
122
135
|
invalid_properties = Array.new
|
123
136
|
if @amount.nil?
|
124
137
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
@@ -154,6 +167,7 @@ module Conekta
|
|
154
167
|
# Check to see if the all the properties in the model are valid
|
155
168
|
# @return true if the model is valid
|
156
169
|
def valid?
|
170
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
157
171
|
return false if @amount.nil?
|
158
172
|
return false if @amount < 0
|
159
173
|
return false if @code.nil?
|
@@ -207,37 +221,30 @@ module Conekta
|
|
207
221
|
# @param [Hash] attributes Model attributes in the form of hash
|
208
222
|
# @return [Object] Returns the model itself
|
209
223
|
def self.build_from_hash(attributes)
|
210
|
-
new.build_from_hash(attributes)
|
211
|
-
end
|
212
|
-
|
213
|
-
# Builds the object from hash
|
214
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
215
|
-
# @return [Object] Returns the model itself
|
216
|
-
def build_from_hash(attributes)
|
217
224
|
return nil unless attributes.is_a?(Hash)
|
218
225
|
attributes = attributes.transform_keys(&:to_sym)
|
219
|
-
|
220
|
-
|
221
|
-
|
226
|
+
transformed_hash = {}
|
227
|
+
openapi_types.each_pair do |key, type|
|
228
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
229
|
+
transformed_hash["#{key}"] = nil
|
222
230
|
elsif type =~ /\AArray<(.*)>/i
|
223
231
|
# check to ensure the input is an array given that the attribute
|
224
232
|
# is documented as an array but the input is not
|
225
|
-
if attributes[
|
226
|
-
|
233
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
234
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
227
235
|
end
|
228
|
-
elsif !attributes[
|
229
|
-
|
236
|
+
elsif !attributes[attribute_map[key]].nil?
|
237
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
230
238
|
end
|
231
239
|
end
|
232
|
-
|
233
|
-
self
|
240
|
+
new(transformed_hash)
|
234
241
|
end
|
235
242
|
|
236
243
|
# Deserializes the data based on type
|
237
244
|
# @param string type Data type
|
238
245
|
# @param string value Value to be deserialized
|
239
246
|
# @return [Object] Deserialized data
|
240
|
-
def _deserialize(type, value)
|
247
|
+
def self._deserialize(type, value)
|
241
248
|
case type.to_sym
|
242
249
|
when :Time
|
243
250
|
Time.parse(value)
|
@@ -272,7 +279,7 @@ module Conekta
|
|
272
279
|
else # model
|
273
280
|
# models (e.g. Pet) or oneOf
|
274
281
|
klass = Conekta.const_get(type)
|
275
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
282
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
276
283
|
end
|
277
284
|
end
|
278
285
|
|
@@ -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
|
|
@@ -70,20 +70,27 @@ module Conekta
|
|
70
70
|
|
71
71
|
if attributes.key?(:'id')
|
72
72
|
self.id = attributes[:'id']
|
73
|
+
else
|
74
|
+
self.id = nil
|
73
75
|
end
|
74
76
|
|
75
77
|
if attributes.key?(:'object')
|
76
78
|
self.object = attributes[:'object']
|
79
|
+
else
|
80
|
+
self.object = nil
|
77
81
|
end
|
78
82
|
|
79
83
|
if attributes.key?(:'parent_id')
|
80
84
|
self.parent_id = attributes[:'parent_id']
|
85
|
+
else
|
86
|
+
self.parent_id = nil
|
81
87
|
end
|
82
88
|
end
|
83
89
|
|
84
90
|
# Show invalid properties with the reasons. Usually used together with valid?
|
85
91
|
# @return Array for valid properties with the reasons
|
86
92
|
def list_invalid_properties
|
93
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
87
94
|
invalid_properties = Array.new
|
88
95
|
if @id.nil?
|
89
96
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
@@ -103,6 +110,7 @@ module Conekta
|
|
103
110
|
# Check to see if the all the properties in the model are valid
|
104
111
|
# @return true if the model is valid
|
105
112
|
def valid?
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
106
114
|
return false if @id.nil?
|
107
115
|
return false if @object.nil?
|
108
116
|
return false if @parent_id.nil?
|
@@ -135,37 +143,30 @@ module Conekta
|
|
135
143
|
# @param [Hash] attributes Model attributes in the form of hash
|
136
144
|
# @return [Object] Returns the model itself
|
137
145
|
def self.build_from_hash(attributes)
|
138
|
-
new.build_from_hash(attributes)
|
139
|
-
end
|
140
|
-
|
141
|
-
# Builds the object from hash
|
142
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
-
# @return [Object] Returns the model itself
|
144
|
-
def build_from_hash(attributes)
|
145
146
|
return nil unless attributes.is_a?(Hash)
|
146
147
|
attributes = attributes.transform_keys(&:to_sym)
|
147
|
-
|
148
|
-
|
149
|
-
|
148
|
+
transformed_hash = {}
|
149
|
+
openapi_types.each_pair do |key, type|
|
150
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
151
|
+
transformed_hash["#{key}"] = nil
|
150
152
|
elsif type =~ /\AArray<(.*)>/i
|
151
153
|
# check to ensure the input is an array given that the attribute
|
152
154
|
# is documented as an array but the input is not
|
153
|
-
if attributes[
|
154
|
-
|
155
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
156
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
155
157
|
end
|
156
|
-
elsif !attributes[
|
157
|
-
|
158
|
+
elsif !attributes[attribute_map[key]].nil?
|
159
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
158
160
|
end
|
159
161
|
end
|
160
|
-
|
161
|
-
self
|
162
|
+
new(transformed_hash)
|
162
163
|
end
|
163
164
|
|
164
165
|
# Deserializes the data based on type
|
165
166
|
# @param string type Data type
|
166
167
|
# @param string value Value to be deserialized
|
167
168
|
# @return [Object] Deserialized data
|
168
|
-
def _deserialize(type, value)
|
169
|
+
def self._deserialize(type, value)
|
169
170
|
case type.to_sym
|
170
171
|
when :Time
|
171
172
|
Time.parse(value)
|
@@ -200,7 +201,7 @@ module Conekta
|
|
200
201
|
else # model
|
201
202
|
# models (e.g. Pet) or oneOf
|
202
203
|
klass = Conekta.const_get(type)
|
203
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
205
|
end
|
205
206
|
end
|
206
207
|
|
@@ -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
|
|
@@ -59,12 +59,15 @@ module Conekta
|
|
59
59
|
|
60
60
|
if attributes.key?(:'email')
|
61
61
|
self.email = attributes[:'email']
|
62
|
+
else
|
63
|
+
self.email = nil
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
65
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
66
68
|
# @return Array for valid properties with the reasons
|
67
69
|
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
68
71
|
invalid_properties = Array.new
|
69
72
|
if @email.nil?
|
70
73
|
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
@@ -76,6 +79,7 @@ module Conekta
|
|
76
79
|
# Check to see if the all the properties in the model are valid
|
77
80
|
# @return true if the model is valid
|
78
81
|
def valid?
|
82
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
79
83
|
return false if @email.nil?
|
80
84
|
true
|
81
85
|
end
|
@@ -104,37 +108,30 @@ module Conekta
|
|
104
108
|
# @param [Hash] attributes Model attributes in the form of hash
|
105
109
|
# @return [Object] Returns the model itself
|
106
110
|
def self.build_from_hash(attributes)
|
107
|
-
new.build_from_hash(attributes)
|
108
|
-
end
|
109
|
-
|
110
|
-
# Builds the object from hash
|
111
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
-
# @return [Object] Returns the model itself
|
113
|
-
def build_from_hash(attributes)
|
114
111
|
return nil unless attributes.is_a?(Hash)
|
115
112
|
attributes = attributes.transform_keys(&:to_sym)
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
transformed_hash = {}
|
114
|
+
openapi_types.each_pair do |key, type|
|
115
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = nil
|
119
117
|
elsif type =~ /\AArray<(.*)>/i
|
120
118
|
# check to ensure the input is an array given that the attribute
|
121
119
|
# is documented as an array but the input is not
|
122
|
-
if attributes[
|
123
|
-
|
120
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
121
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
122
|
end
|
125
|
-
elsif !attributes[
|
126
|
-
|
123
|
+
elsif !attributes[attribute_map[key]].nil?
|
124
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
125
|
end
|
128
126
|
end
|
129
|
-
|
130
|
-
self
|
127
|
+
new(transformed_hash)
|
131
128
|
end
|
132
129
|
|
133
130
|
# Deserializes the data based on type
|
134
131
|
# @param string type Data type
|
135
132
|
# @param string value Value to be deserialized
|
136
133
|
# @return [Object] Deserialized data
|
137
|
-
def _deserialize(type, value)
|
134
|
+
def self._deserialize(type, value)
|
138
135
|
case type.to_sym
|
139
136
|
when :Time
|
140
137
|
Time.parse(value)
|
@@ -169,7 +166,7 @@ module Conekta
|
|
169
166
|
else # model
|
170
167
|
# models (e.g. Pet) or oneOf
|
171
168
|
klass = Conekta.const_get(type)
|
172
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
173
170
|
end
|
174
171
|
end
|
175
172
|
|
data/lib/conekta/models/error.rb
CHANGED
@@ -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
|
|
@@ -102,6 +102,7 @@ module Conekta
|
|
102
102
|
# Show invalid properties with the reasons. Usually used together with valid?
|
103
103
|
# @return Array for valid properties with the reasons
|
104
104
|
def list_invalid_properties
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
105
106
|
invalid_properties = Array.new
|
106
107
|
invalid_properties
|
107
108
|
end
|
@@ -109,6 +110,7 @@ module Conekta
|
|
109
110
|
# Check to see if the all the properties in the model are valid
|
110
111
|
# @return true if the model is valid
|
111
112
|
def valid?
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
112
114
|
true
|
113
115
|
end
|
114
116
|
|
@@ -139,37 +141,30 @@ module Conekta
|
|
139
141
|
# @param [Hash] attributes Model attributes in the form of hash
|
140
142
|
# @return [Object] Returns the model itself
|
141
143
|
def self.build_from_hash(attributes)
|
142
|
-
new.build_from_hash(attributes)
|
143
|
-
end
|
144
|
-
|
145
|
-
# Builds the object from hash
|
146
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
-
# @return [Object] Returns the model itself
|
148
|
-
def build_from_hash(attributes)
|
149
144
|
return nil unless attributes.is_a?(Hash)
|
150
145
|
attributes = attributes.transform_keys(&:to_sym)
|
151
|
-
|
152
|
-
|
153
|
-
|
146
|
+
transformed_hash = {}
|
147
|
+
openapi_types.each_pair do |key, type|
|
148
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
149
|
+
transformed_hash["#{key}"] = nil
|
154
150
|
elsif type =~ /\AArray<(.*)>/i
|
155
151
|
# check to ensure the input is an array given that the attribute
|
156
152
|
# is documented as an array but the input is not
|
157
|
-
if attributes[
|
158
|
-
|
153
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
154
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
159
155
|
end
|
160
|
-
elsif !attributes[
|
161
|
-
|
156
|
+
elsif !attributes[attribute_map[key]].nil?
|
157
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
162
158
|
end
|
163
159
|
end
|
164
|
-
|
165
|
-
self
|
160
|
+
new(transformed_hash)
|
166
161
|
end
|
167
162
|
|
168
163
|
# Deserializes the data based on type
|
169
164
|
# @param string type Data type
|
170
165
|
# @param string value Value to be deserialized
|
171
166
|
# @return [Object] Deserialized data
|
172
|
-
def _deserialize(type, value)
|
167
|
+
def self._deserialize(type, value)
|
173
168
|
case type.to_sym
|
174
169
|
when :Time
|
175
170
|
Time.parse(value)
|
@@ -204,7 +199,7 @@ module Conekta
|
|
204
199
|
else # model
|
205
200
|
# models (e.g. Pet) or oneOf
|
206
201
|
klass = Conekta.const_get(type)
|
207
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
202
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
208
203
|
end
|
209
204
|
end
|
210
205
|
|