digital_femsa 1.0.0 → 1.1.0
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 +14 -0
- data/README.md +28 -33
- data/VERSION +1 -1
- data/config-ruby.json +1 -1
- data/docs/ApiKeyCreateResponse.md +1 -1
- data/docs/ApiKeyRequest.md +2 -2
- data/docs/ApiKeyResponseOnDelete.md +2 -2
- data/docs/ApiKeysApi.md +10 -10
- data/docs/BalanceResponse.md +8 -8
- data/docs/BalancesApi.md +1 -1
- data/docs/ChargeOrderResponse.md +1 -1
- data/docs/ChargeOrderResponseChannel.md +24 -0
- data/docs/ChargeRequest.md +1 -1
- data/docs/ChargeRequestPaymentMethod.md +3 -3
- data/docs/ChargeResponse.md +9 -7
- data/docs/ChargeResponseChannel.md +3 -3
- data/docs/ChargeResponseRefundsData.md +5 -1
- data/docs/ChargesApi.md +16 -12
- data/docs/ChargesDataResponse.md +9 -7
- data/docs/Checkout.md +17 -15
- data/docs/CheckoutOrderTemplate.md +3 -3
- data/docs/CheckoutResponse.md +1 -1
- data/docs/CreateCustomerFiscalEntitiesResponse.md +2 -2
- data/docs/Customer.md +13 -19
- data/docs/CustomerAddress.md +2 -2
- data/docs/CustomerFiscalEntitiesDataResponse.md +2 -2
- data/docs/CustomerFiscalEntitiesRequest.md +3 -3
- data/docs/CustomerInfo.md +4 -4
- data/docs/CustomerPaymentMethodRequest.md +1 -1
- data/docs/CustomerResponse.md +17 -21
- data/docs/CustomerShippingContactsResponse.md +5 -5
- data/docs/CustomersApi.md +15 -15
- data/docs/CustomersResponse.md +1 -1
- data/docs/DeleteApiKeysResponse.md +1 -1
- data/docs/DiscountsApi.md +9 -9
- data/docs/EventsApi.md +2 -2
- data/docs/EventsResendResponse.md +1 -1
- data/docs/GetChargesResponse.md +4 -4
- data/docs/GetTransactionsResponse.md +1 -1
- data/docs/LogsApi.md +1 -1
- data/docs/OrderFiscalEntityRequest.md +4 -4
- data/docs/OrderRefundRequest.md +7 -5
- data/docs/OrderRequest.md +17 -19
- data/docs/OrderResponse.md +37 -35
- data/docs/OrderResponseChannel.md +24 -0
- data/docs/OrderResponseShippingContact.md +4 -4
- data/docs/OrderUpdateFiscalEntityRequest.md +1 -1
- data/docs/OrderUpdateRequest.md +19 -15
- data/docs/OrdersApi.md +16 -16
- data/docs/PaymentLinkApi.md +12 -82
- data/docs/PaymentMethodCash.md +4 -4
- data/docs/PaymentMethodCashRequest.md +2 -2
- data/docs/PaymentMethodsApi.md +5 -5
- data/docs/Product.md +10 -12
- data/docs/ProductDataResponse.md +9 -11
- data/docs/ProductOrderResponse.md +9 -11
- data/docs/ProductsApi.md +7 -7
- data/docs/ShippingContactsApi.md +9 -9
- data/docs/ShippingOrderResponse.md +5 -3
- data/docs/ShippingRequest.md +2 -0
- data/docs/ShippingsApi.md +7 -7
- data/docs/TaxesApi.md +7 -7
- data/docs/TransactionResponse.md +20 -14
- data/docs/TransactionsApi.md +6 -6
- data/docs/TransfersApi.md +10 -10
- data/docs/UpdateCustomer.md +17 -21
- data/docs/UpdateCustomerFiscalEntitiesResponse.md +2 -2
- data/docs/UpdateOrderTaxRequest.md +2 -2
- data/docs/UpdateProduct.md +7 -9
- data/docs/WebhookKeysApi.md +18 -14
- data/docs/WebhooksApi.md +28 -22
- data/lib/digital_femsa/api/api_keys_api.rb +8 -8
- data/lib/digital_femsa/api/balances_api.rb +2 -2
- data/lib/digital_femsa/api/charges_api.rb +13 -9
- data/lib/digital_femsa/api/customers_api.rb +12 -12
- data/lib/digital_femsa/api/discounts_api.rb +12 -12
- data/lib/digital_femsa/api/events_api.rb +4 -4
- data/lib/digital_femsa/api/logs_api.rb +2 -2
- data/lib/digital_femsa/api/orders_api.rb +20 -20
- data/lib/digital_femsa/api/payment_link_api.rb +10 -86
- data/lib/digital_femsa/api/payment_methods_api.rb +8 -8
- data/lib/digital_femsa/api/products_api.rb +10 -10
- data/lib/digital_femsa/api/shipping_contacts_api.rb +8 -8
- data/lib/digital_femsa/api/shippings_api.rb +10 -10
- data/lib/digital_femsa/api/taxes_api.rb +10 -10
- data/lib/digital_femsa/api/transactions_api.rb +6 -6
- data/lib/digital_femsa/api/transfers_api.rb +8 -8
- data/lib/digital_femsa/api/webhook_keys_api.rb +14 -10
- data/lib/digital_femsa/api/webhooks_api.rb +23 -16
- data/lib/digital_femsa/api_client.rb +9 -5
- data/lib/digital_femsa/models/api_key_create_response.rb +1 -1
- data/lib/digital_femsa/models/api_key_request.rb +36 -1
- data/lib/digital_femsa/models/balance_response.rb +9 -9
- data/lib/digital_femsa/models/charge_order_response.rb +1 -1
- data/lib/digital_femsa/models/{order_next_action_response.rb → charge_order_response_channel.rb} +34 -18
- data/lib/digital_femsa/models/charge_request_payment_method.rb +3 -2
- data/lib/digital_femsa/models/charge_response.rb +15 -4
- data/lib/digital_femsa/models/charge_response_refunds_data.rb +23 -4
- data/lib/digital_femsa/models/charge_update_request.rb +1 -1
- data/lib/digital_femsa/models/charges_data_response.rb +15 -4
- data/lib/digital_femsa/models/checkout.rb +97 -81
- data/lib/digital_femsa/models/checkout_order_template.rb +4 -4
- data/lib/digital_femsa/models/checkout_order_template_customer_info.rb +1 -1
- data/lib/digital_femsa/models/checkout_request.rb +1 -1
- data/lib/digital_femsa/models/checkout_response.rb +1 -1
- data/lib/digital_femsa/models/create_customer_fiscal_entities_response.rb +10 -10
- data/lib/digital_femsa/models/customer.rb +57 -95
- data/lib/digital_femsa/models/customer_address.rb +7 -0
- data/lib/digital_femsa/models/customer_fiscal_entities_data_response.rb +10 -10
- data/lib/digital_femsa/models/customer_fiscal_entities_request.rb +13 -13
- data/lib/digital_femsa/models/customer_info.rb +13 -20
- data/lib/digital_femsa/models/customer_payment_method_request.rb +2 -2
- data/lib/digital_femsa/models/customer_payment_sources_inner.rb +104 -0
- data/lib/digital_femsa/models/customer_response.rb +122 -113
- data/lib/digital_femsa/models/customer_shipping_contacts_response.rb +2 -0
- data/lib/digital_femsa/models/customers_response.rb +1 -0
- data/lib/digital_femsa/models/events_resend_response.rb +1 -1
- data/lib/digital_femsa/models/get_charges_response.rb +21 -21
- data/lib/digital_femsa/models/get_transactions_response.rb +1 -1
- data/lib/digital_femsa/models/log_response.rb +1 -1
- data/lib/digital_femsa/models/logs_response.rb +1 -1
- data/lib/digital_femsa/models/order_fiscal_entity_response.rb +1 -1
- data/lib/digital_femsa/models/order_refund_request.rb +59 -11
- data/lib/digital_femsa/models/order_request.rb +69 -79
- data/lib/digital_femsa/models/order_response.rb +187 -119
- data/lib/digital_femsa/models/{order_next_action_response_redirect_to_url.rb → order_response_channel.rb} +35 -19
- data/lib/digital_femsa/models/order_response_charges.rb +1 -1
- data/lib/digital_femsa/models/order_response_checkout.rb +1 -0
- data/lib/digital_femsa/models/order_response_customer_info.rb +1 -0
- data/lib/digital_femsa/models/order_response_shipping_contact.rb +3 -0
- data/lib/digital_femsa/models/order_update_fiscal_entity_request.rb +1 -1
- data/lib/digital_femsa/models/order_update_request.rb +106 -65
- data/lib/digital_femsa/models/payment_method_cash.rb +1 -1
- data/lib/digital_femsa/models/payment_method_cash_request.rb +2 -1
- data/lib/digital_femsa/models/product.rb +103 -95
- data/lib/digital_femsa/models/product_data_response.rb +103 -95
- data/lib/digital_femsa/models/product_order_response.rb +103 -95
- data/lib/digital_femsa/models/shipping_order_response.rb +11 -1
- data/lib/digital_femsa/models/shipping_request.rb +12 -1
- data/lib/digital_femsa/models/transaction_response.rb +172 -99
- data/lib/digital_femsa/models/transfers_response.rb +1 -1
- data/lib/digital_femsa/models/transfers_response_destination.rb +312 -0
- data/lib/digital_femsa/models/update_customer.rb +42 -85
- data/lib/digital_femsa/models/update_customer_fiscal_entities_response.rb +10 -10
- data/lib/digital_femsa/models/update_order_discount_lines_request.rb +34 -0
- data/lib/digital_femsa/models/update_order_tax_request.rb +2 -2
- data/lib/digital_femsa/models/update_payment_methods_amount.rb +105 -0
- data/lib/digital_femsa/models/update_payment_methods_expires_at.rb +105 -0
- data/lib/digital_femsa/models/update_product.rb +85 -58
- data/lib/digital_femsa/models/webhook_key_delete_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_key_request.rb +1 -0
- data/lib/digital_femsa/models/webhook_key_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_request.rb +1 -1
- data/lib/digital_femsa/models/webhook_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_update_request.rb +1 -1
- data/lib/digital_femsa/version.rb +1 -1
- data/lib/digital_femsa.rb +2 -6
- data/templates/ruby/api_client.mustache +8 -4
- metadata +26 -26
- data/docs/CustomerAntifraudInfo.md +0 -20
- data/docs/CustomerAntifraudInfoResponse.md +0 -20
- data/docs/OrderNextActionResponse.md +0 -20
- data/docs/OrderNextActionResponseRedirectToUrl.md +0 -20
- data/docs/SmsCheckoutRequest.md +0 -18
- data/docs/UpdateCustomerAntifraudInfo.md +0 -20
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Femsa API
|
|
3
|
+
|
|
4
|
+
#Femsa sdk
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.1.0
|
|
7
|
+
Contact: engineering@femsa.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.5.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DigitalFemsa
|
|
17
|
+
# Destination payout method used to make the transfer.
|
|
18
|
+
class TransfersResponseDestination
|
|
19
|
+
# Unique identifier of the payee.
|
|
20
|
+
attr_accessor :payee_id
|
|
21
|
+
|
|
22
|
+
# Unique identifier of the payout method.
|
|
23
|
+
attr_accessor :id
|
|
24
|
+
|
|
25
|
+
# Date and time of creation of the payout method in Unix format.
|
|
26
|
+
attr_accessor :created_at
|
|
27
|
+
|
|
28
|
+
# Object name, present for bank transfer destination.
|
|
29
|
+
attr_accessor :object
|
|
30
|
+
|
|
31
|
+
# Destination type.
|
|
32
|
+
attr_accessor :type
|
|
33
|
+
|
|
34
|
+
# Last 4 digits of the destination account number.
|
|
35
|
+
attr_accessor :last4
|
|
36
|
+
|
|
37
|
+
# Name of the account holder.
|
|
38
|
+
attr_accessor :account_holder_name
|
|
39
|
+
|
|
40
|
+
# Name of the bank.
|
|
41
|
+
attr_accessor :bank
|
|
42
|
+
|
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
|
+
def self.attribute_map
|
|
45
|
+
{
|
|
46
|
+
:'payee_id' => :'payee_id',
|
|
47
|
+
:'id' => :'id',
|
|
48
|
+
:'created_at' => :'created_at',
|
|
49
|
+
:'object' => :'object',
|
|
50
|
+
:'type' => :'type',
|
|
51
|
+
:'last4' => :'last4',
|
|
52
|
+
:'account_holder_name' => :'account_holder_name',
|
|
53
|
+
:'bank' => :'bank'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'payee_id' => :'String',
|
|
66
|
+
:'id' => :'String',
|
|
67
|
+
:'created_at' => :'Integer',
|
|
68
|
+
:'object' => :'String',
|
|
69
|
+
:'type' => :'String',
|
|
70
|
+
:'last4' => :'String',
|
|
71
|
+
:'account_holder_name' => :'String',
|
|
72
|
+
:'bank' => :'String'
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# List of attributes with nullable: true
|
|
77
|
+
def self.openapi_nullable
|
|
78
|
+
Set.new([
|
|
79
|
+
:'object',
|
|
80
|
+
:'type',
|
|
81
|
+
:'last4',
|
|
82
|
+
:'account_holder_name',
|
|
83
|
+
:'bank'
|
|
84
|
+
])
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Initializes the object
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
def initialize(attributes = {})
|
|
90
|
+
if (!attributes.is_a?(Hash))
|
|
91
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DigitalFemsa::TransfersResponseDestination` initialize method"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DigitalFemsa::TransfersResponseDestination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
98
|
+
end
|
|
99
|
+
h[k.to_sym] = v
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'payee_id')
|
|
103
|
+
self.payee_id = attributes[:'payee_id']
|
|
104
|
+
else
|
|
105
|
+
self.payee_id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'id')
|
|
109
|
+
self.id = attributes[:'id']
|
|
110
|
+
else
|
|
111
|
+
self.id = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'created_at')
|
|
115
|
+
self.created_at = attributes[:'created_at']
|
|
116
|
+
else
|
|
117
|
+
self.created_at = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'object')
|
|
121
|
+
self.object = attributes[:'object']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'type')
|
|
125
|
+
self.type = attributes[:'type']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'last4')
|
|
129
|
+
self.last4 = attributes[:'last4']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'account_holder_name')
|
|
133
|
+
self.account_holder_name = attributes[:'account_holder_name']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'bank')
|
|
137
|
+
self.bank = attributes[:'bank']
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
142
|
+
# @return Array for valid properties with the reasons
|
|
143
|
+
def list_invalid_properties
|
|
144
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
145
|
+
invalid_properties = Array.new
|
|
146
|
+
if @payee_id.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "payee_id", payee_id cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if @id.nil?
|
|
151
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if @created_at.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
invalid_properties
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Check to see if the all the properties in the model are valid
|
|
162
|
+
# @return true if the model is valid
|
|
163
|
+
def valid?
|
|
164
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
165
|
+
return false if @payee_id.nil?
|
|
166
|
+
return false if @id.nil?
|
|
167
|
+
return false if @created_at.nil?
|
|
168
|
+
true
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Checks equality by comparing each attribute.
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def ==(o)
|
|
174
|
+
return true if self.equal?(o)
|
|
175
|
+
self.class == o.class &&
|
|
176
|
+
payee_id == o.payee_id &&
|
|
177
|
+
id == o.id &&
|
|
178
|
+
created_at == o.created_at &&
|
|
179
|
+
object == o.object &&
|
|
180
|
+
type == o.type &&
|
|
181
|
+
last4 == o.last4 &&
|
|
182
|
+
account_holder_name == o.account_holder_name &&
|
|
183
|
+
bank == o.bank
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# @see the `==` method
|
|
187
|
+
# @param [Object] Object to be compared
|
|
188
|
+
def eql?(o)
|
|
189
|
+
self == o
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Calculates hash code according to all attributes.
|
|
193
|
+
# @return [Integer] Hash code
|
|
194
|
+
def hash
|
|
195
|
+
[payee_id, id, created_at, object, type, last4, account_holder_name, bank].hash
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Builds the object from hash
|
|
199
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
200
|
+
# @return [Object] Returns the model itself
|
|
201
|
+
def self.build_from_hash(attributes)
|
|
202
|
+
return nil unless attributes.is_a?(Hash)
|
|
203
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
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
|
|
208
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
209
|
+
# check to ensure the input is an array given that the attribute
|
|
210
|
+
# is documented as an array but the input is not
|
|
211
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
212
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
213
|
+
end
|
|
214
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
215
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
new(transformed_hash)
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Deserializes the data based on type
|
|
222
|
+
# @param string type Data type
|
|
223
|
+
# @param string value Value to be deserialized
|
|
224
|
+
# @return [Object] Deserialized data
|
|
225
|
+
def self._deserialize(type, value)
|
|
226
|
+
case type.to_sym
|
|
227
|
+
when :Time
|
|
228
|
+
Time.parse(value)
|
|
229
|
+
when :Date
|
|
230
|
+
Date.parse(value)
|
|
231
|
+
when :String
|
|
232
|
+
value.to_s
|
|
233
|
+
when :Integer
|
|
234
|
+
value.to_i
|
|
235
|
+
when :Float
|
|
236
|
+
value.to_f
|
|
237
|
+
when :Boolean
|
|
238
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
239
|
+
true
|
|
240
|
+
else
|
|
241
|
+
false
|
|
242
|
+
end
|
|
243
|
+
when :Object
|
|
244
|
+
# generic object (usually a Hash), return directly
|
|
245
|
+
value
|
|
246
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
247
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
248
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
249
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
250
|
+
k_type = Regexp.last_match[:k_type]
|
|
251
|
+
v_type = Regexp.last_match[:v_type]
|
|
252
|
+
{}.tap do |hash|
|
|
253
|
+
value.each do |k, v|
|
|
254
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
else # model
|
|
258
|
+
# models (e.g. Pet) or oneOf
|
|
259
|
+
klass = DigitalFemsa.const_get(type)
|
|
260
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Returns the string representation of the object
|
|
265
|
+
# @return [String] String presentation of the object
|
|
266
|
+
def to_s
|
|
267
|
+
to_hash.to_s
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
271
|
+
# @return [Hash] Returns the object in the form of hash
|
|
272
|
+
def to_body
|
|
273
|
+
to_hash
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Returns the object in the form of hash
|
|
277
|
+
# @return [Hash] Returns the object in the form of hash
|
|
278
|
+
def to_hash
|
|
279
|
+
hash = {}
|
|
280
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
281
|
+
value = self.send(attr)
|
|
282
|
+
if value.nil?
|
|
283
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
284
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
hash[param] = _to_hash(value)
|
|
288
|
+
end
|
|
289
|
+
hash
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Outputs non-array value in the form of hash
|
|
293
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
294
|
+
# @param [Object] value Any valid value
|
|
295
|
+
# @return [Hash] Returns the value in the form of hash
|
|
296
|
+
def _to_hash(value)
|
|
297
|
+
if value.is_a?(Array)
|
|
298
|
+
value.compact.map { |v| _to_hash(v) }
|
|
299
|
+
elsif value.is_a?(Hash)
|
|
300
|
+
{}.tap do |hash|
|
|
301
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
302
|
+
end
|
|
303
|
+
elsif value.respond_to? :to_hash
|
|
304
|
+
value.to_hash
|
|
305
|
+
else
|
|
306
|
+
value
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
end
|
|
@@ -14,56 +14,51 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
# update customer
|
|
17
|
+
# Request body to update a customer.
|
|
18
18
|
class UpdateCustomer
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# It is a parameter that allows to identify in the response, the Femsa ID of a payment method (payment_id)
|
|
22
|
-
attr_accessor :default_payment_source_id
|
|
19
|
+
# Customer's name.
|
|
20
|
+
attr_accessor :name
|
|
23
21
|
|
|
24
|
-
#
|
|
22
|
+
# Customer email address.
|
|
25
23
|
attr_accessor :email
|
|
26
24
|
|
|
27
|
-
#
|
|
28
|
-
attr_accessor :name
|
|
29
|
-
|
|
30
|
-
# Is the customer's phone number
|
|
25
|
+
# Customer phone number.
|
|
31
26
|
attr_accessor :phone
|
|
32
27
|
|
|
33
|
-
#
|
|
34
|
-
attr_accessor :default_shipping_contact_id
|
|
35
|
-
|
|
36
|
-
# It is a value that allows identifying if the email is corporate or not.
|
|
28
|
+
# True if the customer represents a company.
|
|
37
29
|
attr_accessor :corporate
|
|
38
30
|
|
|
39
|
-
#
|
|
31
|
+
# Merchant-defined reference used to identify the customer in your system.
|
|
40
32
|
attr_accessor :custom_reference
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
# Arbitrary metadata associated with the customer.
|
|
44
35
|
attr_accessor :metadata
|
|
45
36
|
|
|
46
|
-
#
|
|
37
|
+
# Customer payment sources to create/attach (offline recurrent references).
|
|
47
38
|
attr_accessor :payment_sources
|
|
48
39
|
|
|
49
|
-
#
|
|
50
|
-
attr_accessor :
|
|
40
|
+
# Sets the default payment source for the customer (must be an existing payment source on the customer).
|
|
41
|
+
attr_accessor :default_payment_source_id
|
|
42
|
+
|
|
43
|
+
# Sets the default fiscal entity for the customer (must be an existing fiscal entity on the customer).
|
|
44
|
+
attr_accessor :default_fiscal_entity_id
|
|
45
|
+
|
|
46
|
+
# Sets the default shipping contact for the customer (must be an existing shipping contact on the customer).
|
|
47
|
+
attr_accessor :default_shipping_contact_id
|
|
51
48
|
|
|
52
49
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
50
|
def self.attribute_map
|
|
54
51
|
{
|
|
55
|
-
:'antifraud_info' => :'antifraud_info',
|
|
56
|
-
:'default_payment_source_id' => :'default_payment_source_id',
|
|
57
|
-
:'email' => :'email',
|
|
58
52
|
:'name' => :'name',
|
|
53
|
+
:'email' => :'email',
|
|
59
54
|
:'phone' => :'phone',
|
|
60
|
-
:'default_shipping_contact_id' => :'default_shipping_contact_id',
|
|
61
55
|
:'corporate' => :'corporate',
|
|
62
56
|
:'custom_reference' => :'custom_reference',
|
|
63
|
-
:'fiscal_entities' => :'fiscal_entities',
|
|
64
57
|
:'metadata' => :'metadata',
|
|
65
58
|
:'payment_sources' => :'payment_sources',
|
|
66
|
-
:'
|
|
59
|
+
:'default_payment_source_id' => :'default_payment_source_id',
|
|
60
|
+
:'default_fiscal_entity_id' => :'default_fiscal_entity_id',
|
|
61
|
+
:'default_shipping_contact_id' => :'default_shipping_contact_id'
|
|
67
62
|
}
|
|
68
63
|
end
|
|
69
64
|
|
|
@@ -75,25 +70,22 @@ module DigitalFemsa
|
|
|
75
70
|
# Attribute type mapping.
|
|
76
71
|
def self.openapi_types
|
|
77
72
|
{
|
|
78
|
-
:'antifraud_info' => :'UpdateCustomerAntifraudInfo',
|
|
79
|
-
:'default_payment_source_id' => :'String',
|
|
80
|
-
:'email' => :'String',
|
|
81
73
|
:'name' => :'String',
|
|
74
|
+
:'email' => :'String',
|
|
82
75
|
:'phone' => :'String',
|
|
83
|
-
:'default_shipping_contact_id' => :'String',
|
|
84
76
|
:'corporate' => :'Boolean',
|
|
85
77
|
:'custom_reference' => :'String',
|
|
86
|
-
:'fiscal_entities' => :'Array<CustomerFiscalEntitiesRequest>',
|
|
87
78
|
:'metadata' => :'Hash<String, Object>',
|
|
88
79
|
:'payment_sources' => :'Array<CustomerPaymentMethodsRequest>',
|
|
89
|
-
:'
|
|
80
|
+
:'default_payment_source_id' => :'String',
|
|
81
|
+
:'default_fiscal_entity_id' => :'String',
|
|
82
|
+
:'default_shipping_contact_id' => :'String'
|
|
90
83
|
}
|
|
91
84
|
end
|
|
92
85
|
|
|
93
86
|
# List of attributes with nullable: true
|
|
94
87
|
def self.openapi_nullable
|
|
95
88
|
Set.new([
|
|
96
|
-
:'antifraud_info',
|
|
97
89
|
])
|
|
98
90
|
end
|
|
99
91
|
|
|
@@ -112,46 +104,26 @@ module DigitalFemsa
|
|
|
112
104
|
h[k.to_sym] = v
|
|
113
105
|
}
|
|
114
106
|
|
|
115
|
-
if attributes.key?(:'
|
|
116
|
-
self.
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
if attributes.key?(:'default_payment_source_id')
|
|
120
|
-
self.default_payment_source_id = attributes[:'default_payment_source_id']
|
|
107
|
+
if attributes.key?(:'name')
|
|
108
|
+
self.name = attributes[:'name']
|
|
121
109
|
end
|
|
122
110
|
|
|
123
111
|
if attributes.key?(:'email')
|
|
124
112
|
self.email = attributes[:'email']
|
|
125
113
|
end
|
|
126
114
|
|
|
127
|
-
if attributes.key?(:'name')
|
|
128
|
-
self.name = attributes[:'name']
|
|
129
|
-
end
|
|
130
|
-
|
|
131
115
|
if attributes.key?(:'phone')
|
|
132
116
|
self.phone = attributes[:'phone']
|
|
133
117
|
end
|
|
134
118
|
|
|
135
|
-
if attributes.key?(:'default_shipping_contact_id')
|
|
136
|
-
self.default_shipping_contact_id = attributes[:'default_shipping_contact_id']
|
|
137
|
-
end
|
|
138
|
-
|
|
139
119
|
if attributes.key?(:'corporate')
|
|
140
120
|
self.corporate = attributes[:'corporate']
|
|
141
|
-
else
|
|
142
|
-
self.corporate = false
|
|
143
121
|
end
|
|
144
122
|
|
|
145
123
|
if attributes.key?(:'custom_reference')
|
|
146
124
|
self.custom_reference = attributes[:'custom_reference']
|
|
147
125
|
end
|
|
148
126
|
|
|
149
|
-
if attributes.key?(:'fiscal_entities')
|
|
150
|
-
if (value = attributes[:'fiscal_entities']).is_a?(Array)
|
|
151
|
-
self.fiscal_entities = value
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
|
|
155
127
|
if attributes.key?(:'metadata')
|
|
156
128
|
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
157
129
|
self.metadata = value
|
|
@@ -164,10 +136,16 @@ module DigitalFemsa
|
|
|
164
136
|
end
|
|
165
137
|
end
|
|
166
138
|
|
|
167
|
-
if attributes.key?(:'
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
139
|
+
if attributes.key?(:'default_payment_source_id')
|
|
140
|
+
self.default_payment_source_id = attributes[:'default_payment_source_id']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'default_fiscal_entity_id')
|
|
144
|
+
self.default_fiscal_entity_id = attributes[:'default_fiscal_entity_id']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'default_shipping_contact_id')
|
|
148
|
+
self.default_shipping_contact_id = attributes[:'default_shipping_contact_id']
|
|
171
149
|
end
|
|
172
150
|
end
|
|
173
151
|
|
|
@@ -176,10 +154,6 @@ module DigitalFemsa
|
|
|
176
154
|
def list_invalid_properties
|
|
177
155
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
178
156
|
invalid_properties = Array.new
|
|
179
|
-
if !@metadata.nil? && @metadata.length > 100
|
|
180
|
-
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
|
181
|
-
end
|
|
182
|
-
|
|
183
157
|
invalid_properties
|
|
184
158
|
end
|
|
185
159
|
|
|
@@ -187,41 +161,24 @@ module DigitalFemsa
|
|
|
187
161
|
# @return true if the model is valid
|
|
188
162
|
def valid?
|
|
189
163
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
190
|
-
return false if !@metadata.nil? && @metadata.length > 100
|
|
191
164
|
true
|
|
192
165
|
end
|
|
193
166
|
|
|
194
|
-
# Custom attribute writer method with validation
|
|
195
|
-
# @param [Object] metadata Value to be assigned
|
|
196
|
-
def metadata=(metadata)
|
|
197
|
-
if metadata.nil?
|
|
198
|
-
fail ArgumentError, 'metadata cannot be nil'
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
if metadata.length > 100
|
|
202
|
-
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
|
203
|
-
end
|
|
204
|
-
|
|
205
|
-
@metadata = metadata
|
|
206
|
-
end
|
|
207
|
-
|
|
208
167
|
# Checks equality by comparing each attribute.
|
|
209
168
|
# @param [Object] Object to be compared
|
|
210
169
|
def ==(o)
|
|
211
170
|
return true if self.equal?(o)
|
|
212
171
|
self.class == o.class &&
|
|
213
|
-
antifraud_info == o.antifraud_info &&
|
|
214
|
-
default_payment_source_id == o.default_payment_source_id &&
|
|
215
|
-
email == o.email &&
|
|
216
172
|
name == o.name &&
|
|
173
|
+
email == o.email &&
|
|
217
174
|
phone == o.phone &&
|
|
218
|
-
default_shipping_contact_id == o.default_shipping_contact_id &&
|
|
219
175
|
corporate == o.corporate &&
|
|
220
176
|
custom_reference == o.custom_reference &&
|
|
221
|
-
fiscal_entities == o.fiscal_entities &&
|
|
222
177
|
metadata == o.metadata &&
|
|
223
178
|
payment_sources == o.payment_sources &&
|
|
224
|
-
|
|
179
|
+
default_payment_source_id == o.default_payment_source_id &&
|
|
180
|
+
default_fiscal_entity_id == o.default_fiscal_entity_id &&
|
|
181
|
+
default_shipping_contact_id == o.default_shipping_contact_id
|
|
225
182
|
end
|
|
226
183
|
|
|
227
184
|
# @see the `==` method
|
|
@@ -233,7 +190,7 @@ module DigitalFemsa
|
|
|
233
190
|
# Calculates hash code according to all attributes.
|
|
234
191
|
# @return [Integer] Hash code
|
|
235
192
|
def hash
|
|
236
|
-
[
|
|
193
|
+
[name, email, phone, corporate, custom_reference, metadata, payment_sources, default_payment_source_id, default_fiscal_entity_id, default_shipping_contact_id].hash
|
|
237
194
|
end
|
|
238
195
|
|
|
239
196
|
# Builds the object from hash
|
|
@@ -19,14 +19,14 @@ module DigitalFemsa
|
|
|
19
19
|
|
|
20
20
|
attr_accessor :tax_id
|
|
21
21
|
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
22
24
|
attr_accessor :email
|
|
23
25
|
|
|
24
26
|
attr_accessor :phone
|
|
25
27
|
|
|
26
28
|
attr_accessor :metadata
|
|
27
29
|
|
|
28
|
-
attr_accessor :company_name
|
|
29
|
-
|
|
30
30
|
attr_accessor :id
|
|
31
31
|
|
|
32
32
|
attr_accessor :object
|
|
@@ -42,10 +42,10 @@ module DigitalFemsa
|
|
|
42
42
|
{
|
|
43
43
|
:'address' => :'address',
|
|
44
44
|
:'tax_id' => :'tax_id',
|
|
45
|
+
:'name' => :'name',
|
|
45
46
|
:'email' => :'email',
|
|
46
47
|
:'phone' => :'phone',
|
|
47
48
|
:'metadata' => :'metadata',
|
|
48
|
-
:'company_name' => :'company_name',
|
|
49
49
|
:'id' => :'id',
|
|
50
50
|
:'object' => :'object',
|
|
51
51
|
:'created_at' => :'created_at',
|
|
@@ -64,10 +64,10 @@ module DigitalFemsa
|
|
|
64
64
|
{
|
|
65
65
|
:'address' => :'CustomerAddress',
|
|
66
66
|
:'tax_id' => :'String',
|
|
67
|
+
:'name' => :'String',
|
|
67
68
|
:'email' => :'String',
|
|
68
69
|
:'phone' => :'String',
|
|
69
70
|
:'metadata' => :'Hash<String, Object>',
|
|
70
|
-
:'company_name' => :'String',
|
|
71
71
|
:'id' => :'String',
|
|
72
72
|
:'object' => :'String',
|
|
73
73
|
:'created_at' => :'Integer',
|
|
@@ -114,6 +114,10 @@ module DigitalFemsa
|
|
|
114
114
|
self.tax_id = attributes[:'tax_id']
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
+
if attributes.key?(:'name')
|
|
118
|
+
self.name = attributes[:'name']
|
|
119
|
+
end
|
|
120
|
+
|
|
117
121
|
if attributes.key?(:'email')
|
|
118
122
|
self.email = attributes[:'email']
|
|
119
123
|
end
|
|
@@ -128,10 +132,6 @@ module DigitalFemsa
|
|
|
128
132
|
end
|
|
129
133
|
end
|
|
130
134
|
|
|
131
|
-
if attributes.key?(:'company_name')
|
|
132
|
-
self.company_name = attributes[:'company_name']
|
|
133
|
-
end
|
|
134
|
-
|
|
135
135
|
if attributes.key?(:'id')
|
|
136
136
|
self.id = attributes[:'id']
|
|
137
137
|
else
|
|
@@ -201,10 +201,10 @@ module DigitalFemsa
|
|
|
201
201
|
self.class == o.class &&
|
|
202
202
|
address == o.address &&
|
|
203
203
|
tax_id == o.tax_id &&
|
|
204
|
+
name == o.name &&
|
|
204
205
|
email == o.email &&
|
|
205
206
|
phone == o.phone &&
|
|
206
207
|
metadata == o.metadata &&
|
|
207
|
-
company_name == o.company_name &&
|
|
208
208
|
id == o.id &&
|
|
209
209
|
object == o.object &&
|
|
210
210
|
created_at == o.created_at &&
|
|
@@ -221,7 +221,7 @@ module DigitalFemsa
|
|
|
221
221
|
# Calculates hash code according to all attributes.
|
|
222
222
|
# @return [Integer] Hash code
|
|
223
223
|
def hash
|
|
224
|
-
[address, tax_id, email, phone, metadata,
|
|
224
|
+
[address, tax_id, name, email, phone, metadata, id, object, created_at, parent_id, default].hash
|
|
225
225
|
end
|
|
226
226
|
|
|
227
227
|
# Builds the object from hash
|
|
@@ -23,6 +23,28 @@ module DigitalFemsa
|
|
|
23
23
|
|
|
24
24
|
attr_accessor :type
|
|
25
25
|
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
26
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
49
|
def self.attribute_map
|
|
28
50
|
{
|
|
@@ -97,6 +119,8 @@ module DigitalFemsa
|
|
|
97
119
|
def valid?
|
|
98
120
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
99
121
|
return false if !@amount.nil? && @amount < 0
|
|
122
|
+
type_validator = EnumAttributeValidator.new('String', ["loyalty", "campaign", "coupon", "sign"])
|
|
123
|
+
return false unless type_validator.valid?(@type)
|
|
100
124
|
true
|
|
101
125
|
end
|
|
102
126
|
|
|
@@ -114,6 +138,16 @@ module DigitalFemsa
|
|
|
114
138
|
@amount = amount
|
|
115
139
|
end
|
|
116
140
|
|
|
141
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
142
|
+
# @param [Object] type Object to be assigned
|
|
143
|
+
def type=(type)
|
|
144
|
+
validator = EnumAttributeValidator.new('String', ["loyalty", "campaign", "coupon", "sign"])
|
|
145
|
+
unless validator.valid?(type)
|
|
146
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
147
|
+
end
|
|
148
|
+
@type = type
|
|
149
|
+
end
|
|
150
|
+
|
|
117
151
|
# Checks equality by comparing each attribute.
|
|
118
152
|
# @param [Object] Object to be compared
|
|
119
153
|
def ==(o)
|