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
|
|
@@ -263,6 +263,7 @@ module Conekta
|
|
263
263
|
# Show invalid properties with the reasons. Usually used together with valid?
|
264
264
|
# @return Array for valid properties with the reasons
|
265
265
|
def list_invalid_properties
|
266
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
266
267
|
invalid_properties = Array.new
|
267
268
|
invalid_properties
|
268
269
|
end
|
@@ -270,6 +271,7 @@ module Conekta
|
|
270
271
|
# Check to see if the all the properties in the model are valid
|
271
272
|
# @return true if the model is valid
|
272
273
|
def valid?
|
274
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
273
275
|
true
|
274
276
|
end
|
275
277
|
|
@@ -319,37 +321,30 @@ module Conekta
|
|
319
321
|
# @param [Hash] attributes Model attributes in the form of hash
|
320
322
|
# @return [Object] Returns the model itself
|
321
323
|
def self.build_from_hash(attributes)
|
322
|
-
new.build_from_hash(attributes)
|
323
|
-
end
|
324
|
-
|
325
|
-
# Builds the object from hash
|
326
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
327
|
-
# @return [Object] Returns the model itself
|
328
|
-
def build_from_hash(attributes)
|
329
324
|
return nil unless attributes.is_a?(Hash)
|
330
325
|
attributes = attributes.transform_keys(&:to_sym)
|
331
|
-
|
332
|
-
|
333
|
-
|
326
|
+
transformed_hash = {}
|
327
|
+
openapi_types.each_pair do |key, type|
|
328
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
329
|
+
transformed_hash["#{key}"] = nil
|
334
330
|
elsif type =~ /\AArray<(.*)>/i
|
335
331
|
# check to ensure the input is an array given that the attribute
|
336
332
|
# is documented as an array but the input is not
|
337
|
-
if attributes[
|
338
|
-
|
333
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
334
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
339
335
|
end
|
340
|
-
elsif !attributes[
|
341
|
-
|
336
|
+
elsif !attributes[attribute_map[key]].nil?
|
337
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
342
338
|
end
|
343
339
|
end
|
344
|
-
|
345
|
-
self
|
340
|
+
new(transformed_hash)
|
346
341
|
end
|
347
342
|
|
348
343
|
# Deserializes the data based on type
|
349
344
|
# @param string type Data type
|
350
345
|
# @param string value Value to be deserialized
|
351
346
|
# @return [Object] Deserialized data
|
352
|
-
def _deserialize(type, value)
|
347
|
+
def self._deserialize(type, value)
|
353
348
|
case type.to_sym
|
354
349
|
when :Time
|
355
350
|
Time.parse(value)
|
@@ -384,7 +379,7 @@ module Conekta
|
|
384
379
|
else # model
|
385
380
|
# models (e.g. Pet) or oneOf
|
386
381
|
klass = Conekta.const_get(type)
|
387
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
382
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
388
383
|
end
|
389
384
|
end
|
390
385
|
|
@@ -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
|
|
@@ -111,52 +111,75 @@ module Conekta
|
|
111
111
|
|
112
112
|
if attributes.key?(:'amount')
|
113
113
|
self.amount = attributes[:'amount']
|
114
|
+
else
|
115
|
+
self.amount = nil
|
114
116
|
end
|
115
117
|
|
116
118
|
if attributes.key?(:'charge')
|
117
119
|
self.charge = attributes[:'charge']
|
120
|
+
else
|
121
|
+
self.charge = nil
|
118
122
|
end
|
119
123
|
|
120
124
|
if attributes.key?(:'created_at')
|
121
125
|
self.created_at = attributes[:'created_at']
|
126
|
+
else
|
127
|
+
self.created_at = nil
|
122
128
|
end
|
123
129
|
|
124
130
|
if attributes.key?(:'currency')
|
125
131
|
self.currency = attributes[:'currency']
|
132
|
+
else
|
133
|
+
self.currency = nil
|
126
134
|
end
|
127
135
|
|
128
136
|
if attributes.key?(:'fee')
|
129
137
|
self.fee = attributes[:'fee']
|
138
|
+
else
|
139
|
+
self.fee = nil
|
130
140
|
end
|
131
141
|
|
132
142
|
if attributes.key?(:'id')
|
133
143
|
self.id = attributes[:'id']
|
144
|
+
else
|
145
|
+
self.id = nil
|
134
146
|
end
|
135
147
|
|
136
148
|
if attributes.key?(:'livemode')
|
137
149
|
self.livemode = attributes[:'livemode']
|
150
|
+
else
|
151
|
+
self.livemode = nil
|
138
152
|
end
|
139
153
|
|
140
154
|
if attributes.key?(:'net')
|
141
155
|
self.net = attributes[:'net']
|
156
|
+
else
|
157
|
+
self.net = nil
|
142
158
|
end
|
143
159
|
|
144
160
|
if attributes.key?(:'object')
|
145
161
|
self.object = attributes[:'object']
|
162
|
+
else
|
163
|
+
self.object = nil
|
146
164
|
end
|
147
165
|
|
148
166
|
if attributes.key?(:'status')
|
149
167
|
self.status = attributes[:'status']
|
168
|
+
else
|
169
|
+
self.status = nil
|
150
170
|
end
|
151
171
|
|
152
172
|
if attributes.key?(:'type')
|
153
173
|
self.type = attributes[:'type']
|
174
|
+
else
|
175
|
+
self.type = nil
|
154
176
|
end
|
155
177
|
end
|
156
178
|
|
157
179
|
# Show invalid properties with the reasons. Usually used together with valid?
|
158
180
|
# @return Array for valid properties with the reasons
|
159
181
|
def list_invalid_properties
|
182
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
160
183
|
invalid_properties = Array.new
|
161
184
|
if @amount.nil?
|
162
185
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
@@ -212,6 +235,7 @@ module Conekta
|
|
212
235
|
# Check to see if the all the properties in the model are valid
|
213
236
|
# @return true if the model is valid
|
214
237
|
def valid?
|
238
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
215
239
|
return false if @amount.nil?
|
216
240
|
return false if @charge.nil?
|
217
241
|
return false if @created_at.nil?
|
@@ -275,37 +299,30 @@ module Conekta
|
|
275
299
|
# @param [Hash] attributes Model attributes in the form of hash
|
276
300
|
# @return [Object] Returns the model itself
|
277
301
|
def self.build_from_hash(attributes)
|
278
|
-
new.build_from_hash(attributes)
|
279
|
-
end
|
280
|
-
|
281
|
-
# Builds the object from hash
|
282
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
283
|
-
# @return [Object] Returns the model itself
|
284
|
-
def build_from_hash(attributes)
|
285
302
|
return nil unless attributes.is_a?(Hash)
|
286
303
|
attributes = attributes.transform_keys(&:to_sym)
|
287
|
-
|
288
|
-
|
289
|
-
|
304
|
+
transformed_hash = {}
|
305
|
+
openapi_types.each_pair do |key, type|
|
306
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
307
|
+
transformed_hash["#{key}"] = nil
|
290
308
|
elsif type =~ /\AArray<(.*)>/i
|
291
309
|
# check to ensure the input is an array given that the attribute
|
292
310
|
# is documented as an array but the input is not
|
293
|
-
if attributes[
|
294
|
-
|
311
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
312
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
295
313
|
end
|
296
|
-
elsif !attributes[
|
297
|
-
|
314
|
+
elsif !attributes[attribute_map[key]].nil?
|
315
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
298
316
|
end
|
299
317
|
end
|
300
|
-
|
301
|
-
self
|
318
|
+
new(transformed_hash)
|
302
319
|
end
|
303
320
|
|
304
321
|
# Deserializes the data based on type
|
305
322
|
# @param string type Data type
|
306
323
|
# @param string value Value to be deserialized
|
307
324
|
# @return [Object] Deserialized data
|
308
|
-
def _deserialize(type, value)
|
325
|
+
def self._deserialize(type, value)
|
309
326
|
case type.to_sym
|
310
327
|
when :Time
|
311
328
|
Time.parse(value)
|
@@ -340,7 +357,7 @@ module Conekta
|
|
340
357
|
else # model
|
341
358
|
# models (e.g. Pet) or oneOf
|
342
359
|
klass = Conekta.const_get(type)
|
343
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
360
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
344
361
|
end
|
345
362
|
end
|
346
363
|
|
@@ -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
|
|
@@ -130,6 +130,7 @@ module Conekta
|
|
130
130
|
# Show invalid properties with the reasons. Usually used together with valid?
|
131
131
|
# @return Array for valid properties with the reasons
|
132
132
|
def list_invalid_properties
|
133
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
133
134
|
invalid_properties = Array.new
|
134
135
|
invalid_properties
|
135
136
|
end
|
@@ -137,6 +138,7 @@ module Conekta
|
|
137
138
|
# Check to see if the all the properties in the model are valid
|
138
139
|
# @return true if the model is valid
|
139
140
|
def valid?
|
141
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
140
142
|
true
|
141
143
|
end
|
142
144
|
|
@@ -171,37 +173,30 @@ module Conekta
|
|
171
173
|
# @param [Hash] attributes Model attributes in the form of hash
|
172
174
|
# @return [Object] Returns the model itself
|
173
175
|
def self.build_from_hash(attributes)
|
174
|
-
new.build_from_hash(attributes)
|
175
|
-
end
|
176
|
-
|
177
|
-
# Builds the object from hash
|
178
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
179
|
-
# @return [Object] Returns the model itself
|
180
|
-
def build_from_hash(attributes)
|
181
176
|
return nil unless attributes.is_a?(Hash)
|
182
177
|
attributes = attributes.transform_keys(&:to_sym)
|
183
|
-
|
184
|
-
|
185
|
-
|
178
|
+
transformed_hash = {}
|
179
|
+
openapi_types.each_pair do |key, type|
|
180
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
181
|
+
transformed_hash["#{key}"] = nil
|
186
182
|
elsif type =~ /\AArray<(.*)>/i
|
187
183
|
# check to ensure the input is an array given that the attribute
|
188
184
|
# is documented as an array but the input is not
|
189
|
-
if attributes[
|
190
|
-
|
185
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
186
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
191
187
|
end
|
192
|
-
elsif !attributes[
|
193
|
-
|
188
|
+
elsif !attributes[attribute_map[key]].nil?
|
189
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
194
190
|
end
|
195
191
|
end
|
196
|
-
|
197
|
-
self
|
192
|
+
new(transformed_hash)
|
198
193
|
end
|
199
194
|
|
200
195
|
# Deserializes the data based on type
|
201
196
|
# @param string type Data type
|
202
197
|
# @param string value Value to be deserialized
|
203
198
|
# @return [Object] Deserialized data
|
204
|
-
def _deserialize(type, value)
|
199
|
+
def self._deserialize(type, value)
|
205
200
|
case type.to_sym
|
206
201
|
when :Time
|
207
202
|
Time.parse(value)
|
@@ -236,7 +231,7 @@ module Conekta
|
|
236
231
|
else # model
|
237
232
|
# models (e.g. Pet) or oneOf
|
238
233
|
klass = Conekta.const_get(type)
|
239
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
234
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
240
235
|
end
|
241
236
|
end
|
242
237
|
|
@@ -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
|
|
@@ -130,6 +130,7 @@ module Conekta
|
|
130
130
|
# Show invalid properties with the reasons. Usually used together with valid?
|
131
131
|
# @return Array for valid properties with the reasons
|
132
132
|
def list_invalid_properties
|
133
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
133
134
|
invalid_properties = Array.new
|
134
135
|
invalid_properties
|
135
136
|
end
|
@@ -137,6 +138,7 @@ module Conekta
|
|
137
138
|
# Check to see if the all the properties in the model are valid
|
138
139
|
# @return true if the model is valid
|
139
140
|
def valid?
|
141
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
140
142
|
true
|
141
143
|
end
|
142
144
|
|
@@ -171,37 +173,30 @@ module Conekta
|
|
171
173
|
# @param [Hash] attributes Model attributes in the form of hash
|
172
174
|
# @return [Object] Returns the model itself
|
173
175
|
def self.build_from_hash(attributes)
|
174
|
-
new.build_from_hash(attributes)
|
175
|
-
end
|
176
|
-
|
177
|
-
# Builds the object from hash
|
178
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
179
|
-
# @return [Object] Returns the model itself
|
180
|
-
def build_from_hash(attributes)
|
181
176
|
return nil unless attributes.is_a?(Hash)
|
182
177
|
attributes = attributes.transform_keys(&:to_sym)
|
183
|
-
|
184
|
-
|
185
|
-
|
178
|
+
transformed_hash = {}
|
179
|
+
openapi_types.each_pair do |key, type|
|
180
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
181
|
+
transformed_hash["#{key}"] = nil
|
186
182
|
elsif type =~ /\AArray<(.*)>/i
|
187
183
|
# check to ensure the input is an array given that the attribute
|
188
184
|
# is documented as an array but the input is not
|
189
|
-
if attributes[
|
190
|
-
|
185
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
186
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
191
187
|
end
|
192
|
-
elsif !attributes[
|
193
|
-
|
188
|
+
elsif !attributes[attribute_map[key]].nil?
|
189
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
194
190
|
end
|
195
191
|
end
|
196
|
-
|
197
|
-
self
|
192
|
+
new(transformed_hash)
|
198
193
|
end
|
199
194
|
|
200
195
|
# Deserializes the data based on type
|
201
196
|
# @param string type Data type
|
202
197
|
# @param string value Value to be deserialized
|
203
198
|
# @return [Object] Deserialized data
|
204
|
-
def _deserialize(type, value)
|
199
|
+
def self._deserialize(type, value)
|
205
200
|
case type.to_sym
|
206
201
|
when :Time
|
207
202
|
Time.parse(value)
|
@@ -236,7 +231,7 @@ module Conekta
|
|
236
231
|
else # model
|
237
232
|
# models (e.g. Pet) or oneOf
|
238
233
|
klass = Conekta.const_get(type)
|
239
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
234
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
240
235
|
end
|
241
236
|
end
|
242
237
|
|
@@ -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
|
|
@@ -147,6 +147,7 @@ module Conekta
|
|
147
147
|
# Show invalid properties with the reasons. Usually used together with valid?
|
148
148
|
# @return Array for valid properties with the reasons
|
149
149
|
def list_invalid_properties
|
150
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
150
151
|
invalid_properties = Array.new
|
151
152
|
if !@currency.nil? && @currency.to_s.length > 3
|
152
153
|
invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
|
@@ -158,6 +159,7 @@ module Conekta
|
|
158
159
|
# Check to see if the all the properties in the model are valid
|
159
160
|
# @return true if the model is valid
|
160
161
|
def valid?
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
161
163
|
return false if !@currency.nil? && @currency.to_s.length > 3
|
162
164
|
true
|
163
165
|
end
|
@@ -165,7 +167,11 @@ module Conekta
|
|
165
167
|
# Custom attribute writer method with validation
|
166
168
|
# @param [Object] currency Value to be assigned
|
167
169
|
def currency=(currency)
|
168
|
-
if
|
170
|
+
if currency.nil?
|
171
|
+
fail ArgumentError, 'currency cannot be nil'
|
172
|
+
end
|
173
|
+
|
174
|
+
if currency.to_s.length > 3
|
169
175
|
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
170
176
|
end
|
171
177
|
|
@@ -205,37 +211,30 @@ module Conekta
|
|
205
211
|
# @param [Hash] attributes Model attributes in the form of hash
|
206
212
|
# @return [Object] Returns the model itself
|
207
213
|
def self.build_from_hash(attributes)
|
208
|
-
new.build_from_hash(attributes)
|
209
|
-
end
|
210
|
-
|
211
|
-
# Builds the object from hash
|
212
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
213
|
-
# @return [Object] Returns the model itself
|
214
|
-
def build_from_hash(attributes)
|
215
214
|
return nil unless attributes.is_a?(Hash)
|
216
215
|
attributes = attributes.transform_keys(&:to_sym)
|
217
|
-
|
218
|
-
|
219
|
-
|
216
|
+
transformed_hash = {}
|
217
|
+
openapi_types.each_pair do |key, type|
|
218
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
219
|
+
transformed_hash["#{key}"] = nil
|
220
220
|
elsif type =~ /\AArray<(.*)>/i
|
221
221
|
# check to ensure the input is an array given that the attribute
|
222
222
|
# is documented as an array but the input is not
|
223
|
-
if attributes[
|
224
|
-
|
223
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
224
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
225
225
|
end
|
226
|
-
elsif !attributes[
|
227
|
-
|
226
|
+
elsif !attributes[attribute_map[key]].nil?
|
227
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
228
228
|
end
|
229
229
|
end
|
230
|
-
|
231
|
-
self
|
230
|
+
new(transformed_hash)
|
232
231
|
end
|
233
232
|
|
234
233
|
# Deserializes the data based on type
|
235
234
|
# @param string type Data type
|
236
235
|
# @param string value Value to be deserialized
|
237
236
|
# @return [Object] Deserialized data
|
238
|
-
def _deserialize(type, value)
|
237
|
+
def self._deserialize(type, value)
|
239
238
|
case type.to_sym
|
240
239
|
when :Time
|
241
240
|
Time.parse(value)
|
@@ -270,7 +269,7 @@ module Conekta
|
|
270
269
|
else # model
|
271
270
|
# models (e.g. Pet) or oneOf
|
272
271
|
klass = Conekta.const_get(type)
|
273
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
272
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
274
273
|
end
|
275
274
|
end
|
276
275
|
|
@@ -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
|
|
@@ -147,6 +147,7 @@ module Conekta
|
|
147
147
|
# Show invalid properties with the reasons. Usually used together with valid?
|
148
148
|
# @return Array for valid properties with the reasons
|
149
149
|
def list_invalid_properties
|
150
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
150
151
|
invalid_properties = Array.new
|
151
152
|
if !@currency.nil? && @currency.to_s.length > 3
|
152
153
|
invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
|
@@ -158,6 +159,7 @@ module Conekta
|
|
158
159
|
# Check to see if the all the properties in the model are valid
|
159
160
|
# @return true if the model is valid
|
160
161
|
def valid?
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
161
163
|
return false if !@currency.nil? && @currency.to_s.length > 3
|
162
164
|
true
|
163
165
|
end
|
@@ -165,7 +167,11 @@ module Conekta
|
|
165
167
|
# Custom attribute writer method with validation
|
166
168
|
# @param [Object] currency Value to be assigned
|
167
169
|
def currency=(currency)
|
168
|
-
if
|
170
|
+
if currency.nil?
|
171
|
+
fail ArgumentError, 'currency cannot be nil'
|
172
|
+
end
|
173
|
+
|
174
|
+
if currency.to_s.length > 3
|
169
175
|
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
170
176
|
end
|
171
177
|
|
@@ -205,37 +211,30 @@ module Conekta
|
|
205
211
|
# @param [Hash] attributes Model attributes in the form of hash
|
206
212
|
# @return [Object] Returns the model itself
|
207
213
|
def self.build_from_hash(attributes)
|
208
|
-
new.build_from_hash(attributes)
|
209
|
-
end
|
210
|
-
|
211
|
-
# Builds the object from hash
|
212
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
213
|
-
# @return [Object] Returns the model itself
|
214
|
-
def build_from_hash(attributes)
|
215
214
|
return nil unless attributes.is_a?(Hash)
|
216
215
|
attributes = attributes.transform_keys(&:to_sym)
|
217
|
-
|
218
|
-
|
219
|
-
|
216
|
+
transformed_hash = {}
|
217
|
+
openapi_types.each_pair do |key, type|
|
218
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
219
|
+
transformed_hash["#{key}"] = nil
|
220
220
|
elsif type =~ /\AArray<(.*)>/i
|
221
221
|
# check to ensure the input is an array given that the attribute
|
222
222
|
# is documented as an array but the input is not
|
223
|
-
if attributes[
|
224
|
-
|
223
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
224
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
225
225
|
end
|
226
|
-
elsif !attributes[
|
227
|
-
|
226
|
+
elsif !attributes[attribute_map[key]].nil?
|
227
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
228
228
|
end
|
229
229
|
end
|
230
|
-
|
231
|
-
self
|
230
|
+
new(transformed_hash)
|
232
231
|
end
|
233
232
|
|
234
233
|
# Deserializes the data based on type
|
235
234
|
# @param string type Data type
|
236
235
|
# @param string value Value to be deserialized
|
237
236
|
# @return [Object] Deserialized data
|
238
|
-
def _deserialize(type, value)
|
237
|
+
def self._deserialize(type, value)
|
239
238
|
case type.to_sym
|
240
239
|
when :Time
|
241
240
|
Time.parse(value)
|
@@ -270,7 +269,7 @@ module Conekta
|
|
270
269
|
else # model
|
271
270
|
# models (e.g. Pet) or oneOf
|
272
271
|
klass = Conekta.const_get(type)
|
273
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
272
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
274
273
|
end
|
275
274
|
end
|
276
275
|
|
@@ -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
|
|
@@ -191,6 +191,7 @@ module Conekta
|
|
191
191
|
# Show invalid properties with the reasons. Usually used together with valid?
|
192
192
|
# @return Array for valid properties with the reasons
|
193
193
|
def list_invalid_properties
|
194
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
194
195
|
invalid_properties = Array.new
|
195
196
|
if !@metadata.nil? && @metadata.length > 100
|
196
197
|
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
@@ -202,6 +203,7 @@ module Conekta
|
|
202
203
|
# Check to see if the all the properties in the model are valid
|
203
204
|
# @return true if the model is valid
|
204
205
|
def valid?
|
206
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
205
207
|
return false if !@metadata.nil? && @metadata.length > 100
|
206
208
|
true
|
207
209
|
end
|
@@ -209,7 +211,11 @@ module Conekta
|
|
209
211
|
# Custom attribute writer method with validation
|
210
212
|
# @param [Object] metadata Value to be assigned
|
211
213
|
def metadata=(metadata)
|
212
|
-
if
|
214
|
+
if metadata.nil?
|
215
|
+
fail ArgumentError, 'metadata cannot be nil'
|
216
|
+
end
|
217
|
+
|
218
|
+
if metadata.length > 100
|
213
219
|
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
214
220
|
end
|
215
221
|
|
@@ -253,37 +259,30 @@ module Conekta
|
|
253
259
|
# @param [Hash] attributes Model attributes in the form of hash
|
254
260
|
# @return [Object] Returns the model itself
|
255
261
|
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
262
|
return nil unless attributes.is_a?(Hash)
|
264
263
|
attributes = attributes.transform_keys(&:to_sym)
|
265
|
-
|
266
|
-
|
267
|
-
|
264
|
+
transformed_hash = {}
|
265
|
+
openapi_types.each_pair do |key, type|
|
266
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
267
|
+
transformed_hash["#{key}"] = nil
|
268
268
|
elsif type =~ /\AArray<(.*)>/i
|
269
269
|
# check to ensure the input is an array given that the attribute
|
270
270
|
# is documented as an array but the input is not
|
271
|
-
if attributes[
|
272
|
-
|
271
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
272
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
273
273
|
end
|
274
|
-
elsif !attributes[
|
275
|
-
|
274
|
+
elsif !attributes[attribute_map[key]].nil?
|
275
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
276
276
|
end
|
277
277
|
end
|
278
|
-
|
279
|
-
self
|
278
|
+
new(transformed_hash)
|
280
279
|
end
|
281
280
|
|
282
281
|
# Deserializes the data based on type
|
283
282
|
# @param string type Data type
|
284
283
|
# @param string value Value to be deserialized
|
285
284
|
# @return [Object] Deserialized data
|
286
|
-
def _deserialize(type, value)
|
285
|
+
def self._deserialize(type, value)
|
287
286
|
case type.to_sym
|
288
287
|
when :Time
|
289
288
|
Time.parse(value)
|
@@ -318,7 +317,7 @@ module Conekta
|
|
318
317
|
else # model
|
319
318
|
# models (e.g. Pet) or oneOf
|
320
319
|
klass = Conekta.const_get(type)
|
321
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
320
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
322
321
|
end
|
323
322
|
end
|
324
323
|
|