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
|
|
@@ -90,10 +90,14 @@ module Conekta
|
|
90
90
|
|
91
91
|
if attributes.key?(:'has_more')
|
92
92
|
self.has_more = attributes[:'has_more']
|
93
|
+
else
|
94
|
+
self.has_more = nil
|
93
95
|
end
|
94
96
|
|
95
97
|
if attributes.key?(:'object')
|
96
98
|
self.object = attributes[:'object']
|
99
|
+
else
|
100
|
+
self.object = nil
|
97
101
|
end
|
98
102
|
|
99
103
|
if attributes.key?(:'next_page_url')
|
@@ -114,6 +118,7 @@ module Conekta
|
|
114
118
|
# Show invalid properties with the reasons. Usually used together with valid?
|
115
119
|
# @return Array for valid properties with the reasons
|
116
120
|
def list_invalid_properties
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
117
122
|
invalid_properties = Array.new
|
118
123
|
if @has_more.nil?
|
119
124
|
invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
|
@@ -129,6 +134,7 @@ module Conekta
|
|
129
134
|
# Check to see if the all the properties in the model are valid
|
130
135
|
# @return true if the model is valid
|
131
136
|
def valid?
|
137
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
132
138
|
return false if @has_more.nil?
|
133
139
|
return false if @object.nil?
|
134
140
|
true
|
@@ -162,37 +168,30 @@ module Conekta
|
|
162
168
|
# @param [Hash] attributes Model attributes in the form of hash
|
163
169
|
# @return [Object] Returns the model itself
|
164
170
|
def self.build_from_hash(attributes)
|
165
|
-
new.build_from_hash(attributes)
|
166
|
-
end
|
167
|
-
|
168
|
-
# Builds the object from hash
|
169
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
170
|
-
# @return [Object] Returns the model itself
|
171
|
-
def build_from_hash(attributes)
|
172
171
|
return nil unless attributes.is_a?(Hash)
|
173
172
|
attributes = attributes.transform_keys(&:to_sym)
|
174
|
-
|
175
|
-
|
176
|
-
|
173
|
+
transformed_hash = {}
|
174
|
+
openapi_types.each_pair do |key, type|
|
175
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
176
|
+
transformed_hash["#{key}"] = nil
|
177
177
|
elsif type =~ /\AArray<(.*)>/i
|
178
178
|
# check to ensure the input is an array given that the attribute
|
179
179
|
# is documented as an array but the input is not
|
180
|
-
if attributes[
|
181
|
-
|
180
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
181
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
182
182
|
end
|
183
|
-
elsif !attributes[
|
184
|
-
|
183
|
+
elsif !attributes[attribute_map[key]].nil?
|
184
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
185
185
|
end
|
186
186
|
end
|
187
|
-
|
188
|
-
self
|
187
|
+
new(transformed_hash)
|
189
188
|
end
|
190
189
|
|
191
190
|
# Deserializes the data based on type
|
192
191
|
# @param string type Data type
|
193
192
|
# @param string value Value to be deserialized
|
194
193
|
# @return [Object] Deserialized data
|
195
|
-
def _deserialize(type, value)
|
194
|
+
def self._deserialize(type, value)
|
196
195
|
case type.to_sym
|
197
196
|
when :Time
|
198
197
|
Time.parse(value)
|
@@ -227,7 +226,7 @@ module Conekta
|
|
227
226
|
else # model
|
228
227
|
# models (e.g. Pet) or oneOf
|
229
228
|
klass = Conekta.const_get(type)
|
230
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
229
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
231
230
|
end
|
232
231
|
end
|
233
232
|
|
@@ -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
|
|
@@ -18,10 +18,13 @@ module Conekta
|
|
18
18
|
class CustomerResponse
|
19
19
|
attr_accessor :antifraud_info
|
20
20
|
|
21
|
+
# true if the customer is a company
|
21
22
|
attr_accessor :corporate
|
22
23
|
|
24
|
+
# Creation date of the object
|
23
25
|
attr_accessor :created_at
|
24
26
|
|
27
|
+
# Custom reference
|
25
28
|
attr_accessor :custom_reference
|
26
29
|
|
27
30
|
attr_accessor :default_fiscal_entity_id
|
@@ -34,16 +37,22 @@ module Conekta
|
|
34
37
|
|
35
38
|
attr_accessor :fiscal_entities
|
36
39
|
|
40
|
+
# Customer's ID
|
37
41
|
attr_accessor :id
|
38
42
|
|
43
|
+
# true if the object exists in live mode or the value false if the object exists in test mode
|
39
44
|
attr_accessor :livemode
|
40
45
|
|
46
|
+
# Customer's name
|
41
47
|
attr_accessor :name
|
42
48
|
|
49
|
+
attr_accessor :metadata
|
50
|
+
|
43
51
|
attr_accessor :object
|
44
52
|
|
45
53
|
attr_accessor :payment_sources
|
46
54
|
|
55
|
+
# Customer's phone number
|
47
56
|
attr_accessor :phone
|
48
57
|
|
49
58
|
attr_accessor :shipping_contacts
|
@@ -65,6 +74,7 @@ module Conekta
|
|
65
74
|
:'id' => :'id',
|
66
75
|
:'livemode' => :'livemode',
|
67
76
|
:'name' => :'name',
|
77
|
+
:'metadata' => :'metadata',
|
68
78
|
:'object' => :'object',
|
69
79
|
:'payment_sources' => :'payment_sources',
|
70
80
|
:'phone' => :'phone',
|
@@ -93,6 +103,7 @@ module Conekta
|
|
93
103
|
:'id' => :'String',
|
94
104
|
:'livemode' => :'Boolean',
|
95
105
|
:'name' => :'String',
|
106
|
+
:'metadata' => :'Hash<String, Object>',
|
96
107
|
:'object' => :'String',
|
97
108
|
:'payment_sources' => :'CustomerPaymentMethodsResponse',
|
98
109
|
:'phone' => :'String',
|
@@ -135,6 +146,8 @@ module Conekta
|
|
135
146
|
|
136
147
|
if attributes.key?(:'created_at')
|
137
148
|
self.created_at = attributes[:'created_at']
|
149
|
+
else
|
150
|
+
self.created_at = nil
|
138
151
|
end
|
139
152
|
|
140
153
|
if attributes.key?(:'custom_reference')
|
@@ -163,18 +176,32 @@ module Conekta
|
|
163
176
|
|
164
177
|
if attributes.key?(:'id')
|
165
178
|
self.id = attributes[:'id']
|
179
|
+
else
|
180
|
+
self.id = nil
|
166
181
|
end
|
167
182
|
|
168
183
|
if attributes.key?(:'livemode')
|
169
184
|
self.livemode = attributes[:'livemode']
|
185
|
+
else
|
186
|
+
self.livemode = nil
|
170
187
|
end
|
171
188
|
|
172
189
|
if attributes.key?(:'name')
|
173
190
|
self.name = attributes[:'name']
|
191
|
+
else
|
192
|
+
self.name = nil
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'metadata')
|
196
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
197
|
+
self.metadata = value
|
198
|
+
end
|
174
199
|
end
|
175
200
|
|
176
201
|
if attributes.key?(:'object')
|
177
202
|
self.object = attributes[:'object']
|
203
|
+
else
|
204
|
+
self.object = nil
|
178
205
|
end
|
179
206
|
|
180
207
|
if attributes.key?(:'payment_sources')
|
@@ -197,6 +224,7 @@ module Conekta
|
|
197
224
|
# Show invalid properties with the reasons. Usually used together with valid?
|
198
225
|
# @return Array for valid properties with the reasons
|
199
226
|
def list_invalid_properties
|
227
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
200
228
|
invalid_properties = Array.new
|
201
229
|
if @created_at.nil?
|
202
230
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
@@ -210,6 +238,14 @@ module Conekta
|
|
210
238
|
invalid_properties.push('invalid value for "livemode", livemode cannot be nil.')
|
211
239
|
end
|
212
240
|
|
241
|
+
if @name.nil?
|
242
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
243
|
+
end
|
244
|
+
|
245
|
+
if !@metadata.nil? && @metadata.length > 100
|
246
|
+
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
247
|
+
end
|
248
|
+
|
213
249
|
if @object.nil?
|
214
250
|
invalid_properties.push('invalid value for "object", object cannot be nil.')
|
215
251
|
end
|
@@ -220,13 +256,30 @@ module Conekta
|
|
220
256
|
# Check to see if the all the properties in the model are valid
|
221
257
|
# @return true if the model is valid
|
222
258
|
def valid?
|
259
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
223
260
|
return false if @created_at.nil?
|
224
261
|
return false if @id.nil?
|
225
262
|
return false if @livemode.nil?
|
263
|
+
return false if @name.nil?
|
264
|
+
return false if !@metadata.nil? && @metadata.length > 100
|
226
265
|
return false if @object.nil?
|
227
266
|
true
|
228
267
|
end
|
229
268
|
|
269
|
+
# Custom attribute writer method with validation
|
270
|
+
# @param [Object] metadata Value to be assigned
|
271
|
+
def metadata=(metadata)
|
272
|
+
if metadata.nil?
|
273
|
+
fail ArgumentError, 'metadata cannot be nil'
|
274
|
+
end
|
275
|
+
|
276
|
+
if metadata.length > 100
|
277
|
+
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
278
|
+
end
|
279
|
+
|
280
|
+
@metadata = metadata
|
281
|
+
end
|
282
|
+
|
230
283
|
# Checks equality by comparing each attribute.
|
231
284
|
# @param [Object] Object to be compared
|
232
285
|
def ==(o)
|
@@ -244,6 +297,7 @@ module Conekta
|
|
244
297
|
id == o.id &&
|
245
298
|
livemode == o.livemode &&
|
246
299
|
name == o.name &&
|
300
|
+
metadata == o.metadata &&
|
247
301
|
object == o.object &&
|
248
302
|
payment_sources == o.payment_sources &&
|
249
303
|
phone == o.phone &&
|
@@ -260,44 +314,37 @@ module Conekta
|
|
260
314
|
# Calculates hash code according to all attributes.
|
261
315
|
# @return [Integer] Hash code
|
262
316
|
def hash
|
263
|
-
[antifraud_info, corporate, created_at, custom_reference, default_fiscal_entity_id, default_shipping_contact_id, default_payment_source_id, email, fiscal_entities, id, livemode, name, object, payment_sources, phone, shipping_contacts, subscription].hash
|
317
|
+
[antifraud_info, corporate, created_at, custom_reference, default_fiscal_entity_id, default_shipping_contact_id, default_payment_source_id, email, fiscal_entities, id, livemode, name, metadata, object, payment_sources, phone, shipping_contacts, subscription].hash
|
264
318
|
end
|
265
319
|
|
266
320
|
# Builds the object from hash
|
267
321
|
# @param [Hash] attributes Model attributes in the form of hash
|
268
322
|
# @return [Object] Returns the model itself
|
269
323
|
def self.build_from_hash(attributes)
|
270
|
-
new.build_from_hash(attributes)
|
271
|
-
end
|
272
|
-
|
273
|
-
# Builds the object from hash
|
274
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
275
|
-
# @return [Object] Returns the model itself
|
276
|
-
def build_from_hash(attributes)
|
277
324
|
return nil unless attributes.is_a?(Hash)
|
278
325
|
attributes = attributes.transform_keys(&:to_sym)
|
279
|
-
|
280
|
-
|
281
|
-
|
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
|
282
330
|
elsif type =~ /\AArray<(.*)>/i
|
283
331
|
# check to ensure the input is an array given that the attribute
|
284
332
|
# is documented as an array but the input is not
|
285
|
-
if attributes[
|
286
|
-
|
333
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
334
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
287
335
|
end
|
288
|
-
elsif !attributes[
|
289
|
-
|
336
|
+
elsif !attributes[attribute_map[key]].nil?
|
337
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
290
338
|
end
|
291
339
|
end
|
292
|
-
|
293
|
-
self
|
340
|
+
new(transformed_hash)
|
294
341
|
end
|
295
342
|
|
296
343
|
# Deserializes the data based on type
|
297
344
|
# @param string type Data type
|
298
345
|
# @param string value Value to be deserialized
|
299
346
|
# @return [Object] Deserialized data
|
300
|
-
def _deserialize(type, value)
|
347
|
+
def self._deserialize(type, value)
|
301
348
|
case type.to_sym
|
302
349
|
when :Time
|
303
350
|
Time.parse(value)
|
@@ -332,7 +379,7 @@ module Conekta
|
|
332
379
|
else # model
|
333
380
|
# models (e.g. Pet) or oneOf
|
334
381
|
klass = Conekta.const_get(type)
|
335
|
-
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)
|
336
383
|
end
|
337
384
|
end
|
338
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
|
|
@@ -77,10 +77,14 @@ module Conekta
|
|
77
77
|
|
78
78
|
if attributes.key?(:'has_more')
|
79
79
|
self.has_more = attributes[:'has_more']
|
80
|
+
else
|
81
|
+
self.has_more = nil
|
80
82
|
end
|
81
83
|
|
82
84
|
if attributes.key?(:'object')
|
83
85
|
self.object = attributes[:'object']
|
86
|
+
else
|
87
|
+
self.object = nil
|
84
88
|
end
|
85
89
|
|
86
90
|
if attributes.key?(:'data')
|
@@ -93,6 +97,7 @@ module Conekta
|
|
93
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
94
98
|
# @return Array for valid properties with the reasons
|
95
99
|
def list_invalid_properties
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
96
101
|
invalid_properties = Array.new
|
97
102
|
if @has_more.nil?
|
98
103
|
invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
|
@@ -108,6 +113,7 @@ module Conekta
|
|
108
113
|
# Check to see if the all the properties in the model are valid
|
109
114
|
# @return true if the model is valid
|
110
115
|
def valid?
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
111
117
|
return false if @has_more.nil?
|
112
118
|
return false if @object.nil?
|
113
119
|
true
|
@@ -139,37 +145,30 @@ module Conekta
|
|
139
145
|
# @param [Hash] attributes Model attributes in the form of hash
|
140
146
|
# @return [Object] Returns the model itself
|
141
147
|
def self.build_from_hash(attributes)
|
142
|
-
new.build_from_hash(attributes)
|
143
|
-
end
|
144
|
-
|
145
|
-
# Builds the object from hash
|
146
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
-
# @return [Object] Returns the model itself
|
148
|
-
def build_from_hash(attributes)
|
149
148
|
return nil unless attributes.is_a?(Hash)
|
150
149
|
attributes = attributes.transform_keys(&:to_sym)
|
151
|
-
|
152
|
-
|
153
|
-
|
150
|
+
transformed_hash = {}
|
151
|
+
openapi_types.each_pair do |key, type|
|
152
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
153
|
+
transformed_hash["#{key}"] = nil
|
154
154
|
elsif type =~ /\AArray<(.*)>/i
|
155
155
|
# check to ensure the input is an array given that the attribute
|
156
156
|
# is documented as an array but the input is not
|
157
|
-
if attributes[
|
158
|
-
|
157
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
158
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
159
159
|
end
|
160
|
-
elsif !attributes[
|
161
|
-
|
160
|
+
elsif !attributes[attribute_map[key]].nil?
|
161
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
162
162
|
end
|
163
163
|
end
|
164
|
-
|
165
|
-
self
|
164
|
+
new(transformed_hash)
|
166
165
|
end
|
167
166
|
|
168
167
|
# Deserializes the data based on type
|
169
168
|
# @param string type Data type
|
170
169
|
# @param string value Value to be deserialized
|
171
170
|
# @return [Object] Deserialized data
|
172
|
-
def _deserialize(type, value)
|
171
|
+
def self._deserialize(type, value)
|
173
172
|
case type.to_sym
|
174
173
|
when :Time
|
175
174
|
Time.parse(value)
|
@@ -204,7 +203,7 @@ module Conekta
|
|
204
203
|
else # model
|
205
204
|
# models (e.g. Pet) or oneOf
|
206
205
|
klass = Conekta.const_get(type)
|
207
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
208
207
|
end
|
209
208
|
end
|
210
209
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.1.0
|
7
7
|
Contact: engineering@conekta.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -67,6 +67,7 @@ module Conekta
|
|
67
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
68
68
|
# @return Array for valid properties with the reasons
|
69
69
|
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
71
|
invalid_properties = Array.new
|
71
72
|
invalid_properties
|
72
73
|
end
|
@@ -74,6 +75,7 @@ module Conekta
|
|
74
75
|
# Check to see if the all the properties in the model are valid
|
75
76
|
# @return true if the model is valid
|
76
77
|
def valid?
|
78
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
77
79
|
true
|
78
80
|
end
|
79
81
|
|
@@ -101,37 +103,30 @@ module Conekta
|
|
101
103
|
# @param [Hash] attributes Model attributes in the form of hash
|
102
104
|
# @return [Object] Returns the model itself
|
103
105
|
def self.build_from_hash(attributes)
|
104
|
-
new.build_from_hash(attributes)
|
105
|
-
end
|
106
|
-
|
107
|
-
# Builds the object from hash
|
108
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
-
# @return [Object] Returns the model itself
|
110
|
-
def build_from_hash(attributes)
|
111
106
|
return nil unless attributes.is_a?(Hash)
|
112
107
|
attributes = attributes.transform_keys(&:to_sym)
|
113
|
-
|
114
|
-
|
115
|
-
|
108
|
+
transformed_hash = {}
|
109
|
+
openapi_types.each_pair do |key, type|
|
110
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
111
|
+
transformed_hash["#{key}"] = nil
|
116
112
|
elsif type =~ /\AArray<(.*)>/i
|
117
113
|
# check to ensure the input is an array given that the attribute
|
118
114
|
# is documented as an array but the input is not
|
119
|
-
if attributes[
|
120
|
-
|
115
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
116
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
121
117
|
end
|
122
|
-
elsif !attributes[
|
123
|
-
|
118
|
+
elsif !attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
124
120
|
end
|
125
121
|
end
|
126
|
-
|
127
|
-
self
|
122
|
+
new(transformed_hash)
|
128
123
|
end
|
129
124
|
|
130
125
|
# Deserializes the data based on type
|
131
126
|
# @param string type Data type
|
132
127
|
# @param string value Value to be deserialized
|
133
128
|
# @return [Object] Deserialized data
|
134
|
-
def _deserialize(type, value)
|
129
|
+
def self._deserialize(type, value)
|
135
130
|
case type.to_sym
|
136
131
|
when :Time
|
137
132
|
Time.parse(value)
|
@@ -166,7 +161,7 @@ module Conekta
|
|
166
161
|
else # model
|
167
162
|
# models (e.g. Pet) or oneOf
|
168
163
|
klass = Conekta.const_get(type)
|
169
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
165
|
end
|
171
166
|
end
|
172
167
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.1.0
|
7
7
|
Contact: engineering@conekta.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -33,6 +33,9 @@ module Conekta
|
|
33
33
|
|
34
34
|
attr_accessor :deleted
|
35
35
|
|
36
|
+
# Metadata associated with the shipping contact
|
37
|
+
attr_accessor :metadata
|
38
|
+
|
36
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
37
40
|
def self.attribute_map
|
38
41
|
{
|
@@ -42,7 +45,8 @@ module Conekta
|
|
42
45
|
:'address' => :'address',
|
43
46
|
:'parent_id' => :'parent_id',
|
44
47
|
:'default' => :'default',
|
45
|
-
:'deleted' => :'deleted'
|
48
|
+
:'deleted' => :'deleted',
|
49
|
+
:'metadata' => :'metadata'
|
46
50
|
}
|
47
51
|
end
|
48
52
|
|
@@ -60,7 +64,8 @@ module Conekta
|
|
60
64
|
:'address' => :'CustomerShippingContactsAddress',
|
61
65
|
:'parent_id' => :'String',
|
62
66
|
:'default' => :'Boolean',
|
63
|
-
:'deleted' => :'Boolean'
|
67
|
+
:'deleted' => :'Boolean',
|
68
|
+
:'metadata' => :'Hash<String, Object>'
|
64
69
|
}
|
65
70
|
end
|
66
71
|
|
@@ -68,7 +73,7 @@ module Conekta
|
|
68
73
|
def self.openapi_nullable
|
69
74
|
Set.new([
|
70
75
|
:'default',
|
71
|
-
:'deleted'
|
76
|
+
:'deleted',
|
72
77
|
])
|
73
78
|
end
|
74
79
|
|
@@ -101,6 +106,8 @@ module Conekta
|
|
101
106
|
|
102
107
|
if attributes.key?(:'address')
|
103
108
|
self.address = attributes[:'address']
|
109
|
+
else
|
110
|
+
self.address = nil
|
104
111
|
end
|
105
112
|
|
106
113
|
if attributes.key?(:'parent_id')
|
@@ -114,26 +121,53 @@ module Conekta
|
|
114
121
|
if attributes.key?(:'deleted')
|
115
122
|
self.deleted = attributes[:'deleted']
|
116
123
|
end
|
124
|
+
|
125
|
+
if attributes.key?(:'metadata')
|
126
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
127
|
+
self.metadata = value
|
128
|
+
end
|
129
|
+
end
|
117
130
|
end
|
118
131
|
|
119
132
|
# Show invalid properties with the reasons. Usually used together with valid?
|
120
133
|
# @return Array for valid properties with the reasons
|
121
134
|
def list_invalid_properties
|
135
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
122
136
|
invalid_properties = Array.new
|
123
137
|
if @address.nil?
|
124
138
|
invalid_properties.push('invalid value for "address", address cannot be nil.')
|
125
139
|
end
|
126
140
|
|
141
|
+
if !@metadata.nil? && @metadata.length > 100
|
142
|
+
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
143
|
+
end
|
144
|
+
|
127
145
|
invalid_properties
|
128
146
|
end
|
129
147
|
|
130
148
|
# Check to see if the all the properties in the model are valid
|
131
149
|
# @return true if the model is valid
|
132
150
|
def valid?
|
151
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
133
152
|
return false if @address.nil?
|
153
|
+
return false if !@metadata.nil? && @metadata.length > 100
|
134
154
|
true
|
135
155
|
end
|
136
156
|
|
157
|
+
# Custom attribute writer method with validation
|
158
|
+
# @param [Object] metadata Value to be assigned
|
159
|
+
def metadata=(metadata)
|
160
|
+
if metadata.nil?
|
161
|
+
fail ArgumentError, 'metadata cannot be nil'
|
162
|
+
end
|
163
|
+
|
164
|
+
if metadata.length > 100
|
165
|
+
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
166
|
+
end
|
167
|
+
|
168
|
+
@metadata = metadata
|
169
|
+
end
|
170
|
+
|
137
171
|
# Checks equality by comparing each attribute.
|
138
172
|
# @param [Object] Object to be compared
|
139
173
|
def ==(o)
|
@@ -145,7 +179,8 @@ module Conekta
|
|
145
179
|
address == o.address &&
|
146
180
|
parent_id == o.parent_id &&
|
147
181
|
default == o.default &&
|
148
|
-
deleted == o.deleted
|
182
|
+
deleted == o.deleted &&
|
183
|
+
metadata == o.metadata
|
149
184
|
end
|
150
185
|
|
151
186
|
# @see the `==` method
|
@@ -157,44 +192,37 @@ module Conekta
|
|
157
192
|
# Calculates hash code according to all attributes.
|
158
193
|
# @return [Integer] Hash code
|
159
194
|
def hash
|
160
|
-
[phone, receiver, between_streets, address, parent_id, default, deleted].hash
|
195
|
+
[phone, receiver, between_streets, address, parent_id, default, deleted, metadata].hash
|
161
196
|
end
|
162
197
|
|
163
198
|
# Builds the object from hash
|
164
199
|
# @param [Hash] attributes Model attributes in the form of hash
|
165
200
|
# @return [Object] Returns the model itself
|
166
201
|
def self.build_from_hash(attributes)
|
167
|
-
new.build_from_hash(attributes)
|
168
|
-
end
|
169
|
-
|
170
|
-
# Builds the object from hash
|
171
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
172
|
-
# @return [Object] Returns the model itself
|
173
|
-
def build_from_hash(attributes)
|
174
202
|
return nil unless attributes.is_a?(Hash)
|
175
203
|
attributes = attributes.transform_keys(&:to_sym)
|
176
|
-
|
177
|
-
|
178
|
-
|
204
|
+
transformed_hash = {}
|
205
|
+
openapi_types.each_pair do |key, type|
|
206
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
207
|
+
transformed_hash["#{key}"] = nil
|
179
208
|
elsif type =~ /\AArray<(.*)>/i
|
180
209
|
# check to ensure the input is an array given that the attribute
|
181
210
|
# is documented as an array but the input is not
|
182
|
-
if attributes[
|
183
|
-
|
211
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
212
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
184
213
|
end
|
185
|
-
elsif !attributes[
|
186
|
-
|
214
|
+
elsif !attributes[attribute_map[key]].nil?
|
215
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
187
216
|
end
|
188
217
|
end
|
189
|
-
|
190
|
-
self
|
218
|
+
new(transformed_hash)
|
191
219
|
end
|
192
220
|
|
193
221
|
# Deserializes the data based on type
|
194
222
|
# @param string type Data type
|
195
223
|
# @param string value Value to be deserialized
|
196
224
|
# @return [Object] Deserialized data
|
197
|
-
def _deserialize(type, value)
|
225
|
+
def self._deserialize(type, value)
|
198
226
|
case type.to_sym
|
199
227
|
when :Time
|
200
228
|
Time.parse(value)
|
@@ -229,7 +257,7 @@ module Conekta
|
|
229
257
|
else # model
|
230
258
|
# models (e.g. Pet) or oneOf
|
231
259
|
klass = Conekta.const_get(type)
|
232
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
260
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
233
261
|
end
|
234
262
|
end
|
235
263
|
|