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
@@ -0,0 +1,295 @@
|
|
1
|
+
=begin
|
2
|
+
#Conekta API
|
3
|
+
|
4
|
+
#Conekta sdk
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.1.0
|
7
|
+
Contact: engineering@conekta.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Conekta
|
17
|
+
# Fiscal entity of the order, Currently it is a purely informative field
|
18
|
+
class OrderUpdateFiscalEntityRequest
|
19
|
+
attr_accessor :address
|
20
|
+
|
21
|
+
# Email of the fiscal entity
|
22
|
+
attr_accessor :email
|
23
|
+
|
24
|
+
# Name of the fiscal entity
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
# Metadata associated with the fiscal entity
|
28
|
+
attr_accessor :metadata
|
29
|
+
|
30
|
+
# Phone of the fiscal entity
|
31
|
+
attr_accessor :phone
|
32
|
+
|
33
|
+
# Tax ID of the fiscal entity
|
34
|
+
attr_accessor :tax_id
|
35
|
+
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
37
|
+
def self.attribute_map
|
38
|
+
{
|
39
|
+
:'address' => :'address',
|
40
|
+
:'email' => :'email',
|
41
|
+
:'name' => :'name',
|
42
|
+
:'metadata' => :'metadata',
|
43
|
+
:'phone' => :'phone',
|
44
|
+
:'tax_id' => :'tax_id'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.openapi_types
|
55
|
+
{
|
56
|
+
:'address' => :'FiscalEntityAddress',
|
57
|
+
:'email' => :'String',
|
58
|
+
:'name' => :'String',
|
59
|
+
:'metadata' => :'Hash<String, Object>',
|
60
|
+
:'phone' => :'String',
|
61
|
+
:'tax_id' => :'String'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# List of attributes with nullable: true
|
66
|
+
def self.openapi_nullable
|
67
|
+
Set.new([
|
68
|
+
:'name',
|
69
|
+
:'tax_id'
|
70
|
+
])
|
71
|
+
end
|
72
|
+
|
73
|
+
# Initializes the object
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
def initialize(attributes = {})
|
76
|
+
if (!attributes.is_a?(Hash))
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::OrderUpdateFiscalEntityRequest` initialize method"
|
78
|
+
end
|
79
|
+
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::OrderUpdateFiscalEntityRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
84
|
+
end
|
85
|
+
h[k.to_sym] = v
|
86
|
+
}
|
87
|
+
|
88
|
+
if attributes.key?(:'address')
|
89
|
+
self.address = attributes[:'address']
|
90
|
+
else
|
91
|
+
self.address = nil
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'email')
|
95
|
+
self.email = attributes[:'email']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'name')
|
99
|
+
self.name = attributes[:'name']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'metadata')
|
103
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
104
|
+
self.metadata = value
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'phone')
|
109
|
+
self.phone = attributes[:'phone']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'tax_id')
|
113
|
+
self.tax_id = attributes[:'tax_id']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
118
|
+
# @return Array for valid properties with the reasons
|
119
|
+
def list_invalid_properties
|
120
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
121
|
+
invalid_properties = Array.new
|
122
|
+
if @address.nil?
|
123
|
+
invalid_properties.push('invalid value for "address", address cannot be nil.')
|
124
|
+
end
|
125
|
+
|
126
|
+
if !@metadata.nil? && @metadata.length > 100
|
127
|
+
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
128
|
+
end
|
129
|
+
|
130
|
+
invalid_properties
|
131
|
+
end
|
132
|
+
|
133
|
+
# Check to see if the all the properties in the model are valid
|
134
|
+
# @return true if the model is valid
|
135
|
+
def valid?
|
136
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
137
|
+
return false if @address.nil?
|
138
|
+
return false if !@metadata.nil? && @metadata.length > 100
|
139
|
+
true
|
140
|
+
end
|
141
|
+
|
142
|
+
# Custom attribute writer method with validation
|
143
|
+
# @param [Object] metadata Value to be assigned
|
144
|
+
def metadata=(metadata)
|
145
|
+
if metadata.nil?
|
146
|
+
fail ArgumentError, 'metadata cannot be nil'
|
147
|
+
end
|
148
|
+
|
149
|
+
if metadata.length > 100
|
150
|
+
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
151
|
+
end
|
152
|
+
|
153
|
+
@metadata = metadata
|
154
|
+
end
|
155
|
+
|
156
|
+
# Checks equality by comparing each attribute.
|
157
|
+
# @param [Object] Object to be compared
|
158
|
+
def ==(o)
|
159
|
+
return true if self.equal?(o)
|
160
|
+
self.class == o.class &&
|
161
|
+
address == o.address &&
|
162
|
+
email == o.email &&
|
163
|
+
name == o.name &&
|
164
|
+
metadata == o.metadata &&
|
165
|
+
phone == o.phone &&
|
166
|
+
tax_id == o.tax_id
|
167
|
+
end
|
168
|
+
|
169
|
+
# @see the `==` method
|
170
|
+
# @param [Object] Object to be compared
|
171
|
+
def eql?(o)
|
172
|
+
self == o
|
173
|
+
end
|
174
|
+
|
175
|
+
# Calculates hash code according to all attributes.
|
176
|
+
# @return [Integer] Hash code
|
177
|
+
def hash
|
178
|
+
[address, email, name, metadata, phone, tax_id].hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Builds the object from hash
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
183
|
+
# @return [Object] Returns the model itself
|
184
|
+
def self.build_from_hash(attributes)
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
186
|
+
attributes = attributes.transform_keys(&:to_sym)
|
187
|
+
transformed_hash = {}
|
188
|
+
openapi_types.each_pair do |key, type|
|
189
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
190
|
+
transformed_hash["#{key}"] = nil
|
191
|
+
elsif type =~ /\AArray<(.*)>/i
|
192
|
+
# check to ensure the input is an array given that the attribute
|
193
|
+
# is documented as an array but the input is not
|
194
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
195
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
196
|
+
end
|
197
|
+
elsif !attributes[attribute_map[key]].nil?
|
198
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
199
|
+
end
|
200
|
+
end
|
201
|
+
new(transformed_hash)
|
202
|
+
end
|
203
|
+
|
204
|
+
# Deserializes the data based on type
|
205
|
+
# @param string type Data type
|
206
|
+
# @param string value Value to be deserialized
|
207
|
+
# @return [Object] Deserialized data
|
208
|
+
def self._deserialize(type, value)
|
209
|
+
case type.to_sym
|
210
|
+
when :Time
|
211
|
+
Time.parse(value)
|
212
|
+
when :Date
|
213
|
+
Date.parse(value)
|
214
|
+
when :String
|
215
|
+
value.to_s
|
216
|
+
when :Integer
|
217
|
+
value.to_i
|
218
|
+
when :Float
|
219
|
+
value.to_f
|
220
|
+
when :Boolean
|
221
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
222
|
+
true
|
223
|
+
else
|
224
|
+
false
|
225
|
+
end
|
226
|
+
when :Object
|
227
|
+
# generic object (usually a Hash), return directly
|
228
|
+
value
|
229
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
230
|
+
inner_type = Regexp.last_match[:inner_type]
|
231
|
+
value.map { |v| _deserialize(inner_type, v) }
|
232
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
233
|
+
k_type = Regexp.last_match[:k_type]
|
234
|
+
v_type = Regexp.last_match[:v_type]
|
235
|
+
{}.tap do |hash|
|
236
|
+
value.each do |k, v|
|
237
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
238
|
+
end
|
239
|
+
end
|
240
|
+
else # model
|
241
|
+
# models (e.g. Pet) or oneOf
|
242
|
+
klass = Conekta.const_get(type)
|
243
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
# Returns the string representation of the object
|
248
|
+
# @return [String] String presentation of the object
|
249
|
+
def to_s
|
250
|
+
to_hash.to_s
|
251
|
+
end
|
252
|
+
|
253
|
+
# to_body is an alias to to_hash (backward compatibility)
|
254
|
+
# @return [Hash] Returns the object in the form of hash
|
255
|
+
def to_body
|
256
|
+
to_hash
|
257
|
+
end
|
258
|
+
|
259
|
+
# Returns the object in the form of hash
|
260
|
+
# @return [Hash] Returns the object in the form of hash
|
261
|
+
def to_hash
|
262
|
+
hash = {}
|
263
|
+
self.class.attribute_map.each_pair do |attr, param|
|
264
|
+
value = self.send(attr)
|
265
|
+
if value.nil?
|
266
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
267
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
268
|
+
end
|
269
|
+
|
270
|
+
hash[param] = _to_hash(value)
|
271
|
+
end
|
272
|
+
hash
|
273
|
+
end
|
274
|
+
|
275
|
+
# Outputs non-array value in the form of hash
|
276
|
+
# For object, use to_hash. Otherwise, just return the value
|
277
|
+
# @param [Object] value Any valid value
|
278
|
+
# @return [Hash] Returns the value in the form of hash
|
279
|
+
def _to_hash(value)
|
280
|
+
if value.is_a?(Array)
|
281
|
+
value.compact.map { |v| _to_hash(v) }
|
282
|
+
elsif value.is_a?(Hash)
|
283
|
+
{}.tap do |hash|
|
284
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
285
|
+
end
|
286
|
+
elsif value.respond_to? :to_hash
|
287
|
+
value.to_hash
|
288
|
+
else
|
289
|
+
value
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
294
|
+
|
295
|
+
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.1.0
|
7
7
|
Contact: engineering@conekta.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -28,6 +28,8 @@ module Conekta
|
|
28
28
|
# List of [discounts](https://developers.conekta.com/v2.1.0/reference/orderscreatediscountline) that are applied to the order. You must have at least one discount.
|
29
29
|
attr_accessor :discount_lines
|
30
30
|
|
31
|
+
attr_accessor :fiscal_entity
|
32
|
+
|
31
33
|
# List of [products](https://developers.conekta.com/v2.1.0/reference/orderscreateproduct) that are sold in the order. You must have at least one product.
|
32
34
|
attr_accessor :line_items
|
33
35
|
|
@@ -51,6 +53,7 @@ module Conekta
|
|
51
53
|
:'currency' => :'currency',
|
52
54
|
:'customer_info' => :'customer_info',
|
53
55
|
:'discount_lines' => :'discount_lines',
|
56
|
+
:'fiscal_entity' => :'fiscal_entity',
|
54
57
|
:'line_items' => :'line_items',
|
55
58
|
:'metadata' => :'metadata',
|
56
59
|
:'pre_authorize' => :'pre_authorize',
|
@@ -73,6 +76,7 @@ module Conekta
|
|
73
76
|
:'currency' => :'String',
|
74
77
|
:'customer_info' => :'OrderUpdateRequestCustomerInfo',
|
75
78
|
:'discount_lines' => :'Array<OrderDiscountLinesRequest>',
|
79
|
+
:'fiscal_entity' => :'OrderUpdateFiscalEntityRequest',
|
76
80
|
:'line_items' => :'Array<Product>',
|
77
81
|
:'metadata' => :'Hash<String, String>',
|
78
82
|
:'pre_authorize' => :'Boolean',
|
@@ -127,6 +131,10 @@ module Conekta
|
|
127
131
|
end
|
128
132
|
end
|
129
133
|
|
134
|
+
if attributes.key?(:'fiscal_entity')
|
135
|
+
self.fiscal_entity = attributes[:'fiscal_entity']
|
136
|
+
end
|
137
|
+
|
130
138
|
if attributes.key?(:'line_items')
|
131
139
|
if (value = attributes[:'line_items']).is_a?(Array)
|
132
140
|
self.line_items = value
|
@@ -165,6 +173,7 @@ module Conekta
|
|
165
173
|
# Show invalid properties with the reasons. Usually used together with valid?
|
166
174
|
# @return Array for valid properties with the reasons
|
167
175
|
def list_invalid_properties
|
176
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
168
177
|
invalid_properties = Array.new
|
169
178
|
if !@currency.nil? && @currency.to_s.length > 3
|
170
179
|
invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
|
@@ -176,6 +185,7 @@ module Conekta
|
|
176
185
|
# Check to see if the all the properties in the model are valid
|
177
186
|
# @return true if the model is valid
|
178
187
|
def valid?
|
188
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
179
189
|
return false if !@currency.nil? && @currency.to_s.length > 3
|
180
190
|
true
|
181
191
|
end
|
@@ -183,7 +193,11 @@ module Conekta
|
|
183
193
|
# Custom attribute writer method with validation
|
184
194
|
# @param [Object] currency Value to be assigned
|
185
195
|
def currency=(currency)
|
186
|
-
if
|
196
|
+
if currency.nil?
|
197
|
+
fail ArgumentError, 'currency cannot be nil'
|
198
|
+
end
|
199
|
+
|
200
|
+
if currency.to_s.length > 3
|
187
201
|
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
188
202
|
end
|
189
203
|
|
@@ -200,6 +214,7 @@ module Conekta
|
|
200
214
|
currency == o.currency &&
|
201
215
|
customer_info == o.customer_info &&
|
202
216
|
discount_lines == o.discount_lines &&
|
217
|
+
fiscal_entity == o.fiscal_entity &&
|
203
218
|
line_items == o.line_items &&
|
204
219
|
metadata == o.metadata &&
|
205
220
|
pre_authorize == o.pre_authorize &&
|
@@ -217,44 +232,37 @@ module Conekta
|
|
217
232
|
# Calculates hash code according to all attributes.
|
218
233
|
# @return [Integer] Hash code
|
219
234
|
def hash
|
220
|
-
[charges, checkout, currency, customer_info, discount_lines, line_items, metadata, pre_authorize, shipping_contact, shipping_lines, tax_lines].hash
|
235
|
+
[charges, checkout, currency, customer_info, discount_lines, fiscal_entity, line_items, metadata, pre_authorize, shipping_contact, shipping_lines, tax_lines].hash
|
221
236
|
end
|
222
237
|
|
223
238
|
# Builds the object from hash
|
224
239
|
# @param [Hash] attributes Model attributes in the form of hash
|
225
240
|
# @return [Object] Returns the model itself
|
226
241
|
def self.build_from_hash(attributes)
|
227
|
-
new.build_from_hash(attributes)
|
228
|
-
end
|
229
|
-
|
230
|
-
# Builds the object from hash
|
231
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
232
|
-
# @return [Object] Returns the model itself
|
233
|
-
def build_from_hash(attributes)
|
234
242
|
return nil unless attributes.is_a?(Hash)
|
235
243
|
attributes = attributes.transform_keys(&:to_sym)
|
236
|
-
|
237
|
-
|
238
|
-
|
244
|
+
transformed_hash = {}
|
245
|
+
openapi_types.each_pair do |key, type|
|
246
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
247
|
+
transformed_hash["#{key}"] = nil
|
239
248
|
elsif type =~ /\AArray<(.*)>/i
|
240
249
|
# check to ensure the input is an array given that the attribute
|
241
250
|
# is documented as an array but the input is not
|
242
|
-
if attributes[
|
243
|
-
|
251
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
252
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
244
253
|
end
|
245
|
-
elsif !attributes[
|
246
|
-
|
254
|
+
elsif !attributes[attribute_map[key]].nil?
|
255
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
247
256
|
end
|
248
257
|
end
|
249
|
-
|
250
|
-
self
|
258
|
+
new(transformed_hash)
|
251
259
|
end
|
252
260
|
|
253
261
|
# Deserializes the data based on type
|
254
262
|
# @param string type Data type
|
255
263
|
# @param string value Value to be deserialized
|
256
264
|
# @return [Object] Deserialized data
|
257
|
-
def _deserialize(type, value)
|
265
|
+
def self._deserialize(type, value)
|
258
266
|
case type.to_sym
|
259
267
|
when :Time
|
260
268
|
Time.parse(value)
|
@@ -289,7 +297,7 @@ module Conekta
|
|
289
297
|
else # model
|
290
298
|
# models (e.g. Pet) or oneOf
|
291
299
|
klass = Conekta.const_get(type)
|
292
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
300
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
293
301
|
end
|
294
302
|
end
|
295
303
|
|
@@ -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,7 +90,7 @@ module Conekta
|
|
90
90
|
# raise if data contains keys that are not known to the model
|
91
91
|
raise unless (data.keys - const.acceptable_attributes).empty?
|
92
92
|
model = const.build_from_hash(data)
|
93
|
-
return model if model
|
93
|
+
return model if model
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.1.0
|
7
7
|
Contact: engineering@conekta.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -61,12 +61,15 @@ module Conekta
|
|
61
61
|
if (value = attributes[:'data']).is_a?(Array)
|
62
62
|
self.data = value
|
63
63
|
end
|
64
|
+
else
|
65
|
+
self.data = nil
|
64
66
|
end
|
65
67
|
end
|
66
68
|
|
67
69
|
# Show invalid properties with the reasons. Usually used together with valid?
|
68
70
|
# @return Array for valid properties with the reasons
|
69
71
|
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
73
|
invalid_properties = Array.new
|
71
74
|
if @data.nil?
|
72
75
|
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
@@ -78,6 +81,7 @@ module Conekta
|
|
78
81
|
# Check to see if the all the properties in the model are valid
|
79
82
|
# @return true if the model is valid
|
80
83
|
def valid?
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
81
85
|
return false if @data.nil?
|
82
86
|
true
|
83
87
|
end
|
@@ -106,37 +110,30 @@ module Conekta
|
|
106
110
|
# @param [Hash] attributes Model attributes in the form of hash
|
107
111
|
# @return [Object] Returns the model itself
|
108
112
|
def self.build_from_hash(attributes)
|
109
|
-
new.build_from_hash(attributes)
|
110
|
-
end
|
111
|
-
|
112
|
-
# Builds the object from hash
|
113
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
-
# @return [Object] Returns the model itself
|
115
|
-
def build_from_hash(attributes)
|
116
113
|
return nil unless attributes.is_a?(Hash)
|
117
114
|
attributes = attributes.transform_keys(&:to_sym)
|
118
|
-
|
119
|
-
|
120
|
-
|
115
|
+
transformed_hash = {}
|
116
|
+
openapi_types.each_pair do |key, type|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = nil
|
121
119
|
elsif type =~ /\AArray<(.*)>/i
|
122
120
|
# check to ensure the input is an array given that the attribute
|
123
121
|
# is documented as an array but the input is not
|
124
|
-
if attributes[
|
125
|
-
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
126
124
|
end
|
127
|
-
elsif !attributes[
|
128
|
-
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
129
127
|
end
|
130
128
|
end
|
131
|
-
|
132
|
-
self
|
129
|
+
new(transformed_hash)
|
133
130
|
end
|
134
131
|
|
135
132
|
# Deserializes the data based on type
|
136
133
|
# @param string type Data type
|
137
134
|
# @param string value Value to be deserialized
|
138
135
|
# @return [Object] Deserialized data
|
139
|
-
def _deserialize(type, value)
|
136
|
+
def self._deserialize(type, value)
|
140
137
|
case type.to_sym
|
141
138
|
when :Time
|
142
139
|
Time.parse(value)
|
@@ -171,7 +168,7 @@ module Conekta
|
|
171
168
|
else # model
|
172
169
|
# models (e.g. Pet) or oneOf
|
173
170
|
klass = Conekta.const_get(type)
|
174
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
175
172
|
end
|
176
173
|
end
|
177
174
|
|
data/lib/conekta/models/page.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
|
|
@@ -78,6 +78,7 @@ module Conekta
|
|
78
78
|
# Show invalid properties with the reasons. Usually used together with valid?
|
79
79
|
# @return Array for valid properties with the reasons
|
80
80
|
def list_invalid_properties
|
81
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
81
82
|
invalid_properties = Array.new
|
82
83
|
invalid_properties
|
83
84
|
end
|
@@ -85,6 +86,7 @@ module Conekta
|
|
85
86
|
# Check to see if the all the properties in the model are valid
|
86
87
|
# @return true if the model is valid
|
87
88
|
def valid?
|
89
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
88
90
|
true
|
89
91
|
end
|
90
92
|
|
@@ -113,37 +115,30 @@ module Conekta
|
|
113
115
|
# @param [Hash] attributes Model attributes in the form of hash
|
114
116
|
# @return [Object] Returns the model itself
|
115
117
|
def self.build_from_hash(attributes)
|
116
|
-
new.build_from_hash(attributes)
|
117
|
-
end
|
118
|
-
|
119
|
-
# Builds the object from hash
|
120
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
-
# @return [Object] Returns the model itself
|
122
|
-
def build_from_hash(attributes)
|
123
118
|
return nil unless attributes.is_a?(Hash)
|
124
119
|
attributes = attributes.transform_keys(&:to_sym)
|
125
|
-
|
126
|
-
|
127
|
-
|
120
|
+
transformed_hash = {}
|
121
|
+
openapi_types.each_pair do |key, type|
|
122
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
123
|
+
transformed_hash["#{key}"] = nil
|
128
124
|
elsif type =~ /\AArray<(.*)>/i
|
129
125
|
# check to ensure the input is an array given that the attribute
|
130
126
|
# is documented as an array but the input is not
|
131
|
-
if attributes[
|
132
|
-
|
127
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
128
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
133
129
|
end
|
134
|
-
elsif !attributes[
|
135
|
-
|
130
|
+
elsif !attributes[attribute_map[key]].nil?
|
131
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
136
132
|
end
|
137
133
|
end
|
138
|
-
|
139
|
-
self
|
134
|
+
new(transformed_hash)
|
140
135
|
end
|
141
136
|
|
142
137
|
# Deserializes the data based on type
|
143
138
|
# @param string type Data type
|
144
139
|
# @param string value Value to be deserialized
|
145
140
|
# @return [Object] Deserialized data
|
146
|
-
def _deserialize(type, value)
|
141
|
+
def self._deserialize(type, value)
|
147
142
|
case type.to_sym
|
148
143
|
when :Time
|
149
144
|
Time.parse(value)
|
@@ -178,7 +173,7 @@ module Conekta
|
|
178
173
|
else # model
|
179
174
|
# models (e.g. Pet) or oneOf
|
180
175
|
klass = Conekta.const_get(type)
|
181
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
176
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
182
177
|
end
|
183
178
|
end
|
184
179
|
|