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
|
|
@@ -71,20 +71,27 @@ module Conekta
|
|
71
71
|
|
72
72
|
if attributes.key?(:'amount')
|
73
73
|
self.amount = attributes[:'amount']
|
74
|
+
else
|
75
|
+
self.amount = nil
|
74
76
|
end
|
75
77
|
|
76
78
|
if attributes.key?(:'code')
|
77
79
|
self.code = attributes[:'code']
|
80
|
+
else
|
81
|
+
self.code = nil
|
78
82
|
end
|
79
83
|
|
80
84
|
if attributes.key?(:'type')
|
81
85
|
self.type = attributes[:'type']
|
86
|
+
else
|
87
|
+
self.type = nil
|
82
88
|
end
|
83
89
|
end
|
84
90
|
|
85
91
|
# Show invalid properties with the reasons. Usually used together with valid?
|
86
92
|
# @return Array for valid properties with the reasons
|
87
93
|
def list_invalid_properties
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
88
95
|
invalid_properties = Array.new
|
89
96
|
if @amount.nil?
|
90
97
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
@@ -108,6 +115,7 @@ module Conekta
|
|
108
115
|
# Check to see if the all the properties in the model are valid
|
109
116
|
# @return true if the model is valid
|
110
117
|
def valid?
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
111
119
|
return false if @amount.nil?
|
112
120
|
return false if @amount < 0
|
113
121
|
return false if @code.nil?
|
@@ -155,37 +163,30 @@ module Conekta
|
|
155
163
|
# @param [Hash] attributes Model attributes in the form of hash
|
156
164
|
# @return [Object] Returns the model itself
|
157
165
|
def self.build_from_hash(attributes)
|
158
|
-
new.build_from_hash(attributes)
|
159
|
-
end
|
160
|
-
|
161
|
-
# Builds the object from hash
|
162
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
163
|
-
# @return [Object] Returns the model itself
|
164
|
-
def build_from_hash(attributes)
|
165
166
|
return nil unless attributes.is_a?(Hash)
|
166
167
|
attributes = attributes.transform_keys(&:to_sym)
|
167
|
-
|
168
|
-
|
169
|
-
|
168
|
+
transformed_hash = {}
|
169
|
+
openapi_types.each_pair do |key, type|
|
170
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
171
|
+
transformed_hash["#{key}"] = nil
|
170
172
|
elsif type =~ /\AArray<(.*)>/i
|
171
173
|
# check to ensure the input is an array given that the attribute
|
172
174
|
# is documented as an array but the input is not
|
173
|
-
if attributes[
|
174
|
-
|
175
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
176
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
175
177
|
end
|
176
|
-
elsif !attributes[
|
177
|
-
|
178
|
+
elsif !attributes[attribute_map[key]].nil?
|
179
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
178
180
|
end
|
179
181
|
end
|
180
|
-
|
181
|
-
self
|
182
|
+
new(transformed_hash)
|
182
183
|
end
|
183
184
|
|
184
185
|
# Deserializes the data based on type
|
185
186
|
# @param string type Data type
|
186
187
|
# @param string value Value to be deserialized
|
187
188
|
# @return [Object] Deserialized data
|
188
|
-
def _deserialize(type, value)
|
189
|
+
def self._deserialize(type, value)
|
189
190
|
case type.to_sym
|
190
191
|
when :Time
|
191
192
|
Time.parse(value)
|
@@ -220,7 +221,7 @@ module Conekta
|
|
220
221
|
else # model
|
221
222
|
# models (e.g. Pet) or oneOf
|
222
223
|
klass = Conekta.const_get(type)
|
223
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
224
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
224
225
|
end
|
225
226
|
end
|
226
227
|
|
@@ -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
|
|
@@ -14,22 +14,27 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Conekta
|
17
|
-
|
17
|
+
# Address of the fiscal entity
|
18
|
+
class OrderFiscalEntityAddressResponse
|
19
|
+
# Street name and number
|
18
20
|
attr_accessor :street1
|
19
21
|
|
22
|
+
# Street name and number
|
20
23
|
attr_accessor :street2
|
21
24
|
|
25
|
+
# Postal code
|
22
26
|
attr_accessor :postal_code
|
23
27
|
|
28
|
+
# City
|
24
29
|
attr_accessor :city
|
25
30
|
|
31
|
+
# State
|
26
32
|
attr_accessor :state
|
27
33
|
|
28
34
|
# this field follows the [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
|
29
35
|
attr_accessor :country
|
30
36
|
|
31
|
-
|
32
|
-
|
37
|
+
# External number
|
33
38
|
attr_accessor :external_number
|
34
39
|
|
35
40
|
attr_accessor :object
|
@@ -43,7 +48,6 @@ module Conekta
|
|
43
48
|
:'city' => :'city',
|
44
49
|
:'state' => :'state',
|
45
50
|
:'country' => :'country',
|
46
|
-
:'residential' => :'residential',
|
47
51
|
:'external_number' => :'external_number',
|
48
52
|
:'object' => :'object'
|
49
53
|
}
|
@@ -63,7 +67,6 @@ module Conekta
|
|
63
67
|
:'city' => :'String',
|
64
68
|
:'state' => :'String',
|
65
69
|
:'country' => :'String',
|
66
|
-
:'residential' => :'Boolean',
|
67
70
|
:'external_number' => :'String',
|
68
71
|
:'object' => :'String'
|
69
72
|
}
|
@@ -72,14 +75,15 @@ module Conekta
|
|
72
75
|
# List of attributes with nullable: true
|
73
76
|
def self.openapi_nullable
|
74
77
|
Set.new([
|
78
|
+
:'street2',
|
75
79
|
])
|
76
80
|
end
|
77
81
|
|
78
82
|
# List of class defined in allOf (OpenAPI v3)
|
79
83
|
def self.openapi_all_of
|
80
84
|
[
|
81
|
-
:'
|
82
|
-
:'
|
85
|
+
:'FiscalEntityAddress',
|
86
|
+
:'OrderFiscalEntityAddressResponseAllOf'
|
83
87
|
]
|
84
88
|
end
|
85
89
|
|
@@ -87,19 +91,21 @@ module Conekta
|
|
87
91
|
# @param [Hash] attributes Model attributes in the form of hash
|
88
92
|
def initialize(attributes = {})
|
89
93
|
if (!attributes.is_a?(Hash))
|
90
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::OrderFiscalEntityAddressResponse` initialize method"
|
91
95
|
end
|
92
96
|
|
93
97
|
# check to see if the attribute exists and convert string to symbol for hash key
|
94
98
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
95
99
|
if (!self.class.attribute_map.key?(k.to_sym))
|
96
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::OrderFiscalEntityAddressResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
97
101
|
end
|
98
102
|
h[k.to_sym] = v
|
99
103
|
}
|
100
104
|
|
101
105
|
if attributes.key?(:'street1')
|
102
106
|
self.street1 = attributes[:'street1']
|
107
|
+
else
|
108
|
+
self.street1 = nil
|
103
109
|
end
|
104
110
|
|
105
111
|
if attributes.key?(:'street2')
|
@@ -108,10 +114,14 @@ module Conekta
|
|
108
114
|
|
109
115
|
if attributes.key?(:'postal_code')
|
110
116
|
self.postal_code = attributes[:'postal_code']
|
117
|
+
else
|
118
|
+
self.postal_code = nil
|
111
119
|
end
|
112
120
|
|
113
121
|
if attributes.key?(:'city')
|
114
122
|
self.city = attributes[:'city']
|
123
|
+
else
|
124
|
+
self.city = nil
|
115
125
|
end
|
116
126
|
|
117
127
|
if attributes.key?(:'state')
|
@@ -120,14 +130,14 @@ module Conekta
|
|
120
130
|
|
121
131
|
if attributes.key?(:'country')
|
122
132
|
self.country = attributes[:'country']
|
123
|
-
|
124
|
-
|
125
|
-
if attributes.key?(:'residential')
|
126
|
-
self.residential = attributes[:'residential']
|
133
|
+
else
|
134
|
+
self.country = nil
|
127
135
|
end
|
128
136
|
|
129
137
|
if attributes.key?(:'external_number')
|
130
138
|
self.external_number = attributes[:'external_number']
|
139
|
+
else
|
140
|
+
self.external_number = nil
|
131
141
|
end
|
132
142
|
|
133
143
|
if attributes.key?(:'object')
|
@@ -138,6 +148,7 @@ module Conekta
|
|
138
148
|
# Show invalid properties with the reasons. Usually used together with valid?
|
139
149
|
# @return Array for valid properties with the reasons
|
140
150
|
def list_invalid_properties
|
151
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
141
152
|
invalid_properties = Array.new
|
142
153
|
if @street1.nil?
|
143
154
|
invalid_properties.push('invalid value for "street1", street1 cannot be nil.')
|
@@ -151,15 +162,26 @@ module Conekta
|
|
151
162
|
invalid_properties.push('invalid value for "city", city cannot be nil.')
|
152
163
|
end
|
153
164
|
|
165
|
+
if @country.nil?
|
166
|
+
invalid_properties.push('invalid value for "country", country cannot be nil.')
|
167
|
+
end
|
168
|
+
|
169
|
+
if @external_number.nil?
|
170
|
+
invalid_properties.push('invalid value for "external_number", external_number cannot be nil.')
|
171
|
+
end
|
172
|
+
|
154
173
|
invalid_properties
|
155
174
|
end
|
156
175
|
|
157
176
|
# Check to see if the all the properties in the model are valid
|
158
177
|
# @return true if the model is valid
|
159
178
|
def valid?
|
179
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
160
180
|
return false if @street1.nil?
|
161
181
|
return false if @postal_code.nil?
|
162
182
|
return false if @city.nil?
|
183
|
+
return false if @country.nil?
|
184
|
+
return false if @external_number.nil?
|
163
185
|
true
|
164
186
|
end
|
165
187
|
|
@@ -174,7 +196,6 @@ module Conekta
|
|
174
196
|
city == o.city &&
|
175
197
|
state == o.state &&
|
176
198
|
country == o.country &&
|
177
|
-
residential == o.residential &&
|
178
199
|
external_number == o.external_number &&
|
179
200
|
object == o.object
|
180
201
|
end
|
@@ -188,44 +209,37 @@ module Conekta
|
|
188
209
|
# Calculates hash code according to all attributes.
|
189
210
|
# @return [Integer] Hash code
|
190
211
|
def hash
|
191
|
-
[street1, street2, postal_code, city, state, country,
|
212
|
+
[street1, street2, postal_code, city, state, country, external_number, object].hash
|
192
213
|
end
|
193
214
|
|
194
215
|
# Builds the object from hash
|
195
216
|
# @param [Hash] attributes Model attributes in the form of hash
|
196
217
|
# @return [Object] Returns the model itself
|
197
218
|
def self.build_from_hash(attributes)
|
198
|
-
new.build_from_hash(attributes)
|
199
|
-
end
|
200
|
-
|
201
|
-
# Builds the object from hash
|
202
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
203
|
-
# @return [Object] Returns the model itself
|
204
|
-
def build_from_hash(attributes)
|
205
219
|
return nil unless attributes.is_a?(Hash)
|
206
220
|
attributes = attributes.transform_keys(&:to_sym)
|
207
|
-
|
208
|
-
|
209
|
-
|
221
|
+
transformed_hash = {}
|
222
|
+
openapi_types.each_pair do |key, type|
|
223
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
224
|
+
transformed_hash["#{key}"] = nil
|
210
225
|
elsif type =~ /\AArray<(.*)>/i
|
211
226
|
# check to ensure the input is an array given that the attribute
|
212
227
|
# is documented as an array but the input is not
|
213
|
-
if attributes[
|
214
|
-
|
228
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
229
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
215
230
|
end
|
216
|
-
elsif !attributes[
|
217
|
-
|
231
|
+
elsif !attributes[attribute_map[key]].nil?
|
232
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
218
233
|
end
|
219
234
|
end
|
220
|
-
|
221
|
-
self
|
235
|
+
new(transformed_hash)
|
222
236
|
end
|
223
237
|
|
224
238
|
# Deserializes the data based on type
|
225
239
|
# @param string type Data type
|
226
240
|
# @param string value Value to be deserialized
|
227
241
|
# @return [Object] Deserialized data
|
228
|
-
def _deserialize(type, value)
|
242
|
+
def self._deserialize(type, value)
|
229
243
|
case type.to_sym
|
230
244
|
when :Time
|
231
245
|
Time.parse(value)
|
@@ -260,7 +274,7 @@ module Conekta
|
|
260
274
|
else # model
|
261
275
|
# models (e.g. Pet) or oneOf
|
262
276
|
klass = Conekta.const_get(type)
|
263
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
277
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
264
278
|
end
|
265
279
|
end
|
266
280
|
|
@@ -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
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Conekta
|
17
|
-
class
|
17
|
+
class OrderFiscalEntityAddressResponseAllOf
|
18
18
|
attr_accessor :object
|
19
19
|
|
20
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -46,13 +46,13 @@ module Conekta
|
|
46
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
47
47
|
def initialize(attributes = {})
|
48
48
|
if (!attributes.is_a?(Hash))
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::OrderFiscalEntityAddressResponseAllOf` initialize method"
|
50
50
|
end
|
51
51
|
|
52
52
|
# check to see if the attribute exists and convert string to symbol for hash key
|
53
53
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
54
|
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::OrderFiscalEntityAddressResponseAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
56
|
end
|
57
57
|
h[k.to_sym] = v
|
58
58
|
}
|
@@ -65,6 +65,7 @@ module Conekta
|
|
65
65
|
# Show invalid properties with the reasons. Usually used together with valid?
|
66
66
|
# @return Array for valid properties with the reasons
|
67
67
|
def list_invalid_properties
|
68
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
68
69
|
invalid_properties = Array.new
|
69
70
|
invalid_properties
|
70
71
|
end
|
@@ -72,6 +73,7 @@ module Conekta
|
|
72
73
|
# Check to see if the all the properties in the model are valid
|
73
74
|
# @return true if the model is valid
|
74
75
|
def valid?
|
76
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
75
77
|
true
|
76
78
|
end
|
77
79
|
|
@@ -99,37 +101,30 @@ module Conekta
|
|
99
101
|
# @param [Hash] attributes Model attributes in the form of hash
|
100
102
|
# @return [Object] Returns the model itself
|
101
103
|
def self.build_from_hash(attributes)
|
102
|
-
new.build_from_hash(attributes)
|
103
|
-
end
|
104
|
-
|
105
|
-
# Builds the object from hash
|
106
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
-
# @return [Object] Returns the model itself
|
108
|
-
def build_from_hash(attributes)
|
109
104
|
return nil unless attributes.is_a?(Hash)
|
110
105
|
attributes = attributes.transform_keys(&:to_sym)
|
111
|
-
|
112
|
-
|
113
|
-
|
106
|
+
transformed_hash = {}
|
107
|
+
openapi_types.each_pair do |key, type|
|
108
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
109
|
+
transformed_hash["#{key}"] = nil
|
114
110
|
elsif type =~ /\AArray<(.*)>/i
|
115
111
|
# check to ensure the input is an array given that the attribute
|
116
112
|
# is documented as an array but the input is not
|
117
|
-
if attributes[
|
118
|
-
|
113
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
114
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
119
115
|
end
|
120
|
-
elsif !attributes[
|
121
|
-
|
116
|
+
elsif !attributes[attribute_map[key]].nil?
|
117
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
122
118
|
end
|
123
119
|
end
|
124
|
-
|
125
|
-
self
|
120
|
+
new(transformed_hash)
|
126
121
|
end
|
127
122
|
|
128
123
|
# Deserializes the data based on type
|
129
124
|
# @param string type Data type
|
130
125
|
# @param string value Value to be deserialized
|
131
126
|
# @return [Object] Deserialized data
|
132
|
-
def _deserialize(type, value)
|
127
|
+
def self._deserialize(type, value)
|
133
128
|
case type.to_sym
|
134
129
|
when :Time
|
135
130
|
Time.parse(value)
|
@@ -164,7 +159,7 @@ module Conekta
|
|
164
159
|
else # model
|
165
160
|
# models (e.g. Pet) or oneOf
|
166
161
|
klass = Conekta.const_get(type)
|
167
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
162
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
163
|
end
|
169
164
|
end
|
170
165
|
|