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
|
@@ -15,31 +15,29 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
17
|
class ProductDataResponse
|
|
18
|
-
attr_accessor :antifraud_info
|
|
19
|
-
|
|
20
|
-
# The brand of the item.
|
|
21
|
-
attr_accessor :brand
|
|
22
|
-
|
|
23
|
-
# Short description of the item
|
|
24
|
-
attr_accessor :description
|
|
25
|
-
|
|
26
|
-
# It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters.
|
|
27
|
-
attr_accessor :metadata
|
|
28
|
-
|
|
29
18
|
# The name of the item. It will be displayed in the order.
|
|
30
19
|
attr_accessor :name
|
|
31
20
|
|
|
21
|
+
# The price of the item in cents.
|
|
22
|
+
attr_accessor :unit_price
|
|
23
|
+
|
|
32
24
|
# The quantity of the item in the order.
|
|
33
25
|
attr_accessor :quantity
|
|
34
26
|
|
|
35
27
|
# The stock keeping unit for the item. It is used to identify the item in the order.
|
|
36
28
|
attr_accessor :sku
|
|
37
29
|
|
|
30
|
+
# The brand of the item.
|
|
31
|
+
attr_accessor :brand
|
|
32
|
+
|
|
33
|
+
# Short description of the item
|
|
34
|
+
attr_accessor :description
|
|
35
|
+
|
|
38
36
|
# List of tags for the item. It is used to identify the item in the order.
|
|
39
37
|
attr_accessor :tags
|
|
40
38
|
|
|
41
|
-
#
|
|
42
|
-
attr_accessor :
|
|
39
|
+
# Arbitrary key-value data for your internal use. Keys should be strings; values can be any JSON value.
|
|
40
|
+
attr_accessor :metadata
|
|
43
41
|
|
|
44
42
|
attr_accessor :id
|
|
45
43
|
|
|
@@ -50,15 +48,14 @@ module DigitalFemsa
|
|
|
50
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
49
|
def self.attribute_map
|
|
52
50
|
{
|
|
53
|
-
:'antifraud_info' => :'antifraud_info',
|
|
54
|
-
:'brand' => :'brand',
|
|
55
|
-
:'description' => :'description',
|
|
56
|
-
:'metadata' => :'metadata',
|
|
57
51
|
:'name' => :'name',
|
|
52
|
+
:'unit_price' => :'unit_price',
|
|
58
53
|
:'quantity' => :'quantity',
|
|
59
54
|
:'sku' => :'sku',
|
|
55
|
+
:'brand' => :'brand',
|
|
56
|
+
:'description' => :'description',
|
|
60
57
|
:'tags' => :'tags',
|
|
61
|
-
:'
|
|
58
|
+
:'metadata' => :'metadata',
|
|
62
59
|
:'id' => :'id',
|
|
63
60
|
:'object' => :'object',
|
|
64
61
|
:'parent_id' => :'parent_id'
|
|
@@ -73,15 +70,14 @@ module DigitalFemsa
|
|
|
73
70
|
# Attribute type mapping.
|
|
74
71
|
def self.openapi_types
|
|
75
72
|
{
|
|
76
|
-
:'antifraud_info' => :'Hash<String, Object>',
|
|
77
|
-
:'brand' => :'String',
|
|
78
|
-
:'description' => :'String',
|
|
79
|
-
:'metadata' => :'Hash<String, String>',
|
|
80
73
|
:'name' => :'String',
|
|
74
|
+
:'unit_price' => :'Integer',
|
|
81
75
|
:'quantity' => :'Integer',
|
|
82
76
|
:'sku' => :'String',
|
|
77
|
+
:'brand' => :'String',
|
|
78
|
+
:'description' => :'String',
|
|
83
79
|
:'tags' => :'Array<String>',
|
|
84
|
-
:'
|
|
80
|
+
:'metadata' => :'Hash<String, Object>',
|
|
85
81
|
:'id' => :'String',
|
|
86
82
|
:'object' => :'String',
|
|
87
83
|
:'parent_id' => :'String'
|
|
@@ -116,32 +112,18 @@ module DigitalFemsa
|
|
|
116
112
|
h[k.to_sym] = v
|
|
117
113
|
}
|
|
118
114
|
|
|
119
|
-
if attributes.key?(:'antifraud_info')
|
|
120
|
-
if (value = attributes[:'antifraud_info']).is_a?(Hash)
|
|
121
|
-
self.antifraud_info = value
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
if attributes.key?(:'brand')
|
|
126
|
-
self.brand = attributes[:'brand']
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
if attributes.key?(:'description')
|
|
130
|
-
self.description = attributes[:'description']
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
if attributes.key?(:'metadata')
|
|
134
|
-
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
135
|
-
self.metadata = value
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
|
|
139
115
|
if attributes.key?(:'name')
|
|
140
116
|
self.name = attributes[:'name']
|
|
141
117
|
else
|
|
142
118
|
self.name = nil
|
|
143
119
|
end
|
|
144
120
|
|
|
121
|
+
if attributes.key?(:'unit_price')
|
|
122
|
+
self.unit_price = attributes[:'unit_price']
|
|
123
|
+
else
|
|
124
|
+
self.unit_price = nil
|
|
125
|
+
end
|
|
126
|
+
|
|
145
127
|
if attributes.key?(:'quantity')
|
|
146
128
|
self.quantity = attributes[:'quantity']
|
|
147
129
|
else
|
|
@@ -152,16 +134,24 @@ module DigitalFemsa
|
|
|
152
134
|
self.sku = attributes[:'sku']
|
|
153
135
|
end
|
|
154
136
|
|
|
137
|
+
if attributes.key?(:'brand')
|
|
138
|
+
self.brand = attributes[:'brand']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'description')
|
|
142
|
+
self.description = attributes[:'description']
|
|
143
|
+
end
|
|
144
|
+
|
|
155
145
|
if attributes.key?(:'tags')
|
|
156
146
|
if (value = attributes[:'tags']).is_a?(Array)
|
|
157
147
|
self.tags = value
|
|
158
148
|
end
|
|
159
149
|
end
|
|
160
150
|
|
|
161
|
-
if attributes.key?(:'
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
151
|
+
if attributes.key?(:'metadata')
|
|
152
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
153
|
+
self.metadata = value
|
|
154
|
+
end
|
|
165
155
|
end
|
|
166
156
|
|
|
167
157
|
if attributes.key?(:'id')
|
|
@@ -182,16 +172,16 @@ module DigitalFemsa
|
|
|
182
172
|
def list_invalid_properties
|
|
183
173
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
184
174
|
invalid_properties = Array.new
|
|
185
|
-
if
|
|
186
|
-
invalid_properties.push('invalid value for "
|
|
175
|
+
if @name.nil?
|
|
176
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
187
177
|
end
|
|
188
178
|
|
|
189
|
-
if
|
|
190
|
-
invalid_properties.push('invalid value for "
|
|
179
|
+
if @unit_price.nil?
|
|
180
|
+
invalid_properties.push('invalid value for "unit_price", unit_price cannot be nil.')
|
|
191
181
|
end
|
|
192
182
|
|
|
193
|
-
if @
|
|
194
|
-
invalid_properties.push('invalid value for "
|
|
183
|
+
if @unit_price < 0
|
|
184
|
+
invalid_properties.push('invalid value for "unit_price", must be greater than or equal to 0.')
|
|
195
185
|
end
|
|
196
186
|
|
|
197
187
|
if @quantity.nil?
|
|
@@ -202,12 +192,16 @@ module DigitalFemsa
|
|
|
202
192
|
invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
|
|
203
193
|
end
|
|
204
194
|
|
|
205
|
-
if
|
|
206
|
-
invalid_properties.push('invalid value for "
|
|
195
|
+
if !@description.nil? && @description.to_s.length > 250
|
|
196
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
|
|
207
197
|
end
|
|
208
198
|
|
|
209
|
-
if @
|
|
210
|
-
invalid_properties.push('invalid value for "
|
|
199
|
+
if !@tags.nil? && @tags.length < 1
|
|
200
|
+
invalid_properties.push('invalid value for "tags", number of items must be greater than or equal to 1.')
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if !@metadata.nil? && @metadata.length > 100
|
|
204
|
+
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
|
211
205
|
end
|
|
212
206
|
|
|
213
207
|
invalid_properties
|
|
@@ -217,42 +211,29 @@ module DigitalFemsa
|
|
|
217
211
|
# @return true if the model is valid
|
|
218
212
|
def valid?
|
|
219
213
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
220
|
-
return false if !@description.nil? && @description.to_s.length > 250
|
|
221
|
-
return false if !@metadata.nil? && @metadata.length > 100
|
|
222
214
|
return false if @name.nil?
|
|
223
|
-
return false if @quantity.nil?
|
|
224
|
-
return false if @quantity < 1
|
|
225
215
|
return false if @unit_price.nil?
|
|
226
216
|
return false if @unit_price < 0
|
|
217
|
+
return false if @quantity.nil?
|
|
218
|
+
return false if @quantity < 1
|
|
219
|
+
return false if !@description.nil? && @description.to_s.length > 250
|
|
220
|
+
return false if !@tags.nil? && @tags.length < 1
|
|
221
|
+
return false if !@metadata.nil? && @metadata.length > 100
|
|
227
222
|
true
|
|
228
223
|
end
|
|
229
224
|
|
|
230
225
|
# Custom attribute writer method with validation
|
|
231
|
-
# @param [Object]
|
|
232
|
-
def
|
|
233
|
-
if
|
|
234
|
-
fail ArgumentError, '
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
if description.to_s.length > 250
|
|
238
|
-
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
@description = description
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
# Custom attribute writer method with validation
|
|
245
|
-
# @param [Object] metadata Value to be assigned
|
|
246
|
-
def metadata=(metadata)
|
|
247
|
-
if metadata.nil?
|
|
248
|
-
fail ArgumentError, 'metadata cannot be nil'
|
|
226
|
+
# @param [Object] unit_price Value to be assigned
|
|
227
|
+
def unit_price=(unit_price)
|
|
228
|
+
if unit_price.nil?
|
|
229
|
+
fail ArgumentError, 'unit_price cannot be nil'
|
|
249
230
|
end
|
|
250
231
|
|
|
251
|
-
if
|
|
252
|
-
fail ArgumentError, 'invalid value for "
|
|
232
|
+
if unit_price < 0
|
|
233
|
+
fail ArgumentError, 'invalid value for "unit_price", must be greater than or equal to 0.'
|
|
253
234
|
end
|
|
254
235
|
|
|
255
|
-
@
|
|
236
|
+
@unit_price = unit_price
|
|
256
237
|
end
|
|
257
238
|
|
|
258
239
|
# Custom attribute writer method with validation
|
|
@@ -270,17 +251,45 @@ module DigitalFemsa
|
|
|
270
251
|
end
|
|
271
252
|
|
|
272
253
|
# Custom attribute writer method with validation
|
|
273
|
-
# @param [Object]
|
|
274
|
-
def
|
|
275
|
-
if
|
|
276
|
-
fail ArgumentError, '
|
|
254
|
+
# @param [Object] description Value to be assigned
|
|
255
|
+
def description=(description)
|
|
256
|
+
if description.nil?
|
|
257
|
+
fail ArgumentError, 'description cannot be nil'
|
|
277
258
|
end
|
|
278
259
|
|
|
279
|
-
if
|
|
280
|
-
fail ArgumentError, 'invalid value for "
|
|
260
|
+
if description.to_s.length > 250
|
|
261
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
|
281
262
|
end
|
|
282
263
|
|
|
283
|
-
@
|
|
264
|
+
@description = description
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Custom attribute writer method with validation
|
|
268
|
+
# @param [Object] tags Value to be assigned
|
|
269
|
+
def tags=(tags)
|
|
270
|
+
if tags.nil?
|
|
271
|
+
fail ArgumentError, 'tags cannot be nil'
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
if tags.length < 1
|
|
275
|
+
fail ArgumentError, 'invalid value for "tags", number of items must be greater than or equal to 1.'
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
@tags = tags
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Custom attribute writer method with validation
|
|
282
|
+
# @param [Object] metadata Value to be assigned
|
|
283
|
+
def metadata=(metadata)
|
|
284
|
+
if metadata.nil?
|
|
285
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
if metadata.length > 100
|
|
289
|
+
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
@metadata = metadata
|
|
284
293
|
end
|
|
285
294
|
|
|
286
295
|
# Checks equality by comparing each attribute.
|
|
@@ -288,15 +297,14 @@ module DigitalFemsa
|
|
|
288
297
|
def ==(o)
|
|
289
298
|
return true if self.equal?(o)
|
|
290
299
|
self.class == o.class &&
|
|
291
|
-
antifraud_info == o.antifraud_info &&
|
|
292
|
-
brand == o.brand &&
|
|
293
|
-
description == o.description &&
|
|
294
|
-
metadata == o.metadata &&
|
|
295
300
|
name == o.name &&
|
|
301
|
+
unit_price == o.unit_price &&
|
|
296
302
|
quantity == o.quantity &&
|
|
297
303
|
sku == o.sku &&
|
|
304
|
+
brand == o.brand &&
|
|
305
|
+
description == o.description &&
|
|
298
306
|
tags == o.tags &&
|
|
299
|
-
|
|
307
|
+
metadata == o.metadata &&
|
|
300
308
|
id == o.id &&
|
|
301
309
|
object == o.object &&
|
|
302
310
|
parent_id == o.parent_id
|
|
@@ -311,7 +319,7 @@ module DigitalFemsa
|
|
|
311
319
|
# Calculates hash code according to all attributes.
|
|
312
320
|
# @return [Integer] Hash code
|
|
313
321
|
def hash
|
|
314
|
-
[
|
|
322
|
+
[name, unit_price, quantity, sku, brand, description, tags, metadata, id, object, parent_id].hash
|
|
315
323
|
end
|
|
316
324
|
|
|
317
325
|
# Builds the object from hash
|
|
@@ -15,31 +15,29 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
17
|
class ProductOrderResponse
|
|
18
|
-
attr_accessor :antifraud_info
|
|
19
|
-
|
|
20
|
-
# The brand of the item.
|
|
21
|
-
attr_accessor :brand
|
|
22
|
-
|
|
23
|
-
# Short description of the item
|
|
24
|
-
attr_accessor :description
|
|
25
|
-
|
|
26
|
-
# It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters.
|
|
27
|
-
attr_accessor :metadata
|
|
28
|
-
|
|
29
18
|
# The name of the item. It will be displayed in the order.
|
|
30
19
|
attr_accessor :name
|
|
31
20
|
|
|
21
|
+
# The price of the item in cents.
|
|
22
|
+
attr_accessor :unit_price
|
|
23
|
+
|
|
32
24
|
# The quantity of the item in the order.
|
|
33
25
|
attr_accessor :quantity
|
|
34
26
|
|
|
35
27
|
# The stock keeping unit for the item. It is used to identify the item in the order.
|
|
36
28
|
attr_accessor :sku
|
|
37
29
|
|
|
30
|
+
# The brand of the item.
|
|
31
|
+
attr_accessor :brand
|
|
32
|
+
|
|
33
|
+
# Short description of the item
|
|
34
|
+
attr_accessor :description
|
|
35
|
+
|
|
38
36
|
# List of tags for the item. It is used to identify the item in the order.
|
|
39
37
|
attr_accessor :tags
|
|
40
38
|
|
|
41
|
-
#
|
|
42
|
-
attr_accessor :
|
|
39
|
+
# Arbitrary key-value data for your internal use. Keys should be strings; values can be any JSON value.
|
|
40
|
+
attr_accessor :metadata
|
|
43
41
|
|
|
44
42
|
attr_accessor :id
|
|
45
43
|
|
|
@@ -50,15 +48,14 @@ module DigitalFemsa
|
|
|
50
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
49
|
def self.attribute_map
|
|
52
50
|
{
|
|
53
|
-
:'antifraud_info' => :'antifraud_info',
|
|
54
|
-
:'brand' => :'brand',
|
|
55
|
-
:'description' => :'description',
|
|
56
|
-
:'metadata' => :'metadata',
|
|
57
51
|
:'name' => :'name',
|
|
52
|
+
:'unit_price' => :'unit_price',
|
|
58
53
|
:'quantity' => :'quantity',
|
|
59
54
|
:'sku' => :'sku',
|
|
55
|
+
:'brand' => :'brand',
|
|
56
|
+
:'description' => :'description',
|
|
60
57
|
:'tags' => :'tags',
|
|
61
|
-
:'
|
|
58
|
+
:'metadata' => :'metadata',
|
|
62
59
|
:'id' => :'id',
|
|
63
60
|
:'object' => :'object',
|
|
64
61
|
:'parent_id' => :'parent_id'
|
|
@@ -73,15 +70,14 @@ module DigitalFemsa
|
|
|
73
70
|
# Attribute type mapping.
|
|
74
71
|
def self.openapi_types
|
|
75
72
|
{
|
|
76
|
-
:'antifraud_info' => :'Hash<String, Object>',
|
|
77
|
-
:'brand' => :'String',
|
|
78
|
-
:'description' => :'String',
|
|
79
|
-
:'metadata' => :'Hash<String, String>',
|
|
80
73
|
:'name' => :'String',
|
|
74
|
+
:'unit_price' => :'Integer',
|
|
81
75
|
:'quantity' => :'Integer',
|
|
82
76
|
:'sku' => :'String',
|
|
77
|
+
:'brand' => :'String',
|
|
78
|
+
:'description' => :'String',
|
|
83
79
|
:'tags' => :'Array<String>',
|
|
84
|
-
:'
|
|
80
|
+
:'metadata' => :'Hash<String, Object>',
|
|
85
81
|
:'id' => :'String',
|
|
86
82
|
:'object' => :'String',
|
|
87
83
|
:'parent_id' => :'String'
|
|
@@ -116,32 +112,18 @@ module DigitalFemsa
|
|
|
116
112
|
h[k.to_sym] = v
|
|
117
113
|
}
|
|
118
114
|
|
|
119
|
-
if attributes.key?(:'antifraud_info')
|
|
120
|
-
if (value = attributes[:'antifraud_info']).is_a?(Hash)
|
|
121
|
-
self.antifraud_info = value
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
if attributes.key?(:'brand')
|
|
126
|
-
self.brand = attributes[:'brand']
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
if attributes.key?(:'description')
|
|
130
|
-
self.description = attributes[:'description']
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
if attributes.key?(:'metadata')
|
|
134
|
-
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
135
|
-
self.metadata = value
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
|
|
139
115
|
if attributes.key?(:'name')
|
|
140
116
|
self.name = attributes[:'name']
|
|
141
117
|
else
|
|
142
118
|
self.name = nil
|
|
143
119
|
end
|
|
144
120
|
|
|
121
|
+
if attributes.key?(:'unit_price')
|
|
122
|
+
self.unit_price = attributes[:'unit_price']
|
|
123
|
+
else
|
|
124
|
+
self.unit_price = nil
|
|
125
|
+
end
|
|
126
|
+
|
|
145
127
|
if attributes.key?(:'quantity')
|
|
146
128
|
self.quantity = attributes[:'quantity']
|
|
147
129
|
else
|
|
@@ -152,16 +134,24 @@ module DigitalFemsa
|
|
|
152
134
|
self.sku = attributes[:'sku']
|
|
153
135
|
end
|
|
154
136
|
|
|
137
|
+
if attributes.key?(:'brand')
|
|
138
|
+
self.brand = attributes[:'brand']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'description')
|
|
142
|
+
self.description = attributes[:'description']
|
|
143
|
+
end
|
|
144
|
+
|
|
155
145
|
if attributes.key?(:'tags')
|
|
156
146
|
if (value = attributes[:'tags']).is_a?(Array)
|
|
157
147
|
self.tags = value
|
|
158
148
|
end
|
|
159
149
|
end
|
|
160
150
|
|
|
161
|
-
if attributes.key?(:'
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
151
|
+
if attributes.key?(:'metadata')
|
|
152
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
153
|
+
self.metadata = value
|
|
154
|
+
end
|
|
165
155
|
end
|
|
166
156
|
|
|
167
157
|
if attributes.key?(:'id')
|
|
@@ -182,16 +172,16 @@ module DigitalFemsa
|
|
|
182
172
|
def list_invalid_properties
|
|
183
173
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
184
174
|
invalid_properties = Array.new
|
|
185
|
-
if
|
|
186
|
-
invalid_properties.push('invalid value for "
|
|
175
|
+
if @name.nil?
|
|
176
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
187
177
|
end
|
|
188
178
|
|
|
189
|
-
if
|
|
190
|
-
invalid_properties.push('invalid value for "
|
|
179
|
+
if @unit_price.nil?
|
|
180
|
+
invalid_properties.push('invalid value for "unit_price", unit_price cannot be nil.')
|
|
191
181
|
end
|
|
192
182
|
|
|
193
|
-
if @
|
|
194
|
-
invalid_properties.push('invalid value for "
|
|
183
|
+
if @unit_price < 0
|
|
184
|
+
invalid_properties.push('invalid value for "unit_price", must be greater than or equal to 0.')
|
|
195
185
|
end
|
|
196
186
|
|
|
197
187
|
if @quantity.nil?
|
|
@@ -202,12 +192,16 @@ module DigitalFemsa
|
|
|
202
192
|
invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
|
|
203
193
|
end
|
|
204
194
|
|
|
205
|
-
if
|
|
206
|
-
invalid_properties.push('invalid value for "
|
|
195
|
+
if !@description.nil? && @description.to_s.length > 250
|
|
196
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
|
|
207
197
|
end
|
|
208
198
|
|
|
209
|
-
if @
|
|
210
|
-
invalid_properties.push('invalid value for "
|
|
199
|
+
if !@tags.nil? && @tags.length < 1
|
|
200
|
+
invalid_properties.push('invalid value for "tags", number of items must be greater than or equal to 1.')
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if !@metadata.nil? && @metadata.length > 100
|
|
204
|
+
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
|
211
205
|
end
|
|
212
206
|
|
|
213
207
|
invalid_properties
|
|
@@ -217,42 +211,29 @@ module DigitalFemsa
|
|
|
217
211
|
# @return true if the model is valid
|
|
218
212
|
def valid?
|
|
219
213
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
220
|
-
return false if !@description.nil? && @description.to_s.length > 250
|
|
221
|
-
return false if !@metadata.nil? && @metadata.length > 100
|
|
222
214
|
return false if @name.nil?
|
|
223
|
-
return false if @quantity.nil?
|
|
224
|
-
return false if @quantity < 1
|
|
225
215
|
return false if @unit_price.nil?
|
|
226
216
|
return false if @unit_price < 0
|
|
217
|
+
return false if @quantity.nil?
|
|
218
|
+
return false if @quantity < 1
|
|
219
|
+
return false if !@description.nil? && @description.to_s.length > 250
|
|
220
|
+
return false if !@tags.nil? && @tags.length < 1
|
|
221
|
+
return false if !@metadata.nil? && @metadata.length > 100
|
|
227
222
|
true
|
|
228
223
|
end
|
|
229
224
|
|
|
230
225
|
# Custom attribute writer method with validation
|
|
231
|
-
# @param [Object]
|
|
232
|
-
def
|
|
233
|
-
if
|
|
234
|
-
fail ArgumentError, '
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
if description.to_s.length > 250
|
|
238
|
-
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
@description = description
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
# Custom attribute writer method with validation
|
|
245
|
-
# @param [Object] metadata Value to be assigned
|
|
246
|
-
def metadata=(metadata)
|
|
247
|
-
if metadata.nil?
|
|
248
|
-
fail ArgumentError, 'metadata cannot be nil'
|
|
226
|
+
# @param [Object] unit_price Value to be assigned
|
|
227
|
+
def unit_price=(unit_price)
|
|
228
|
+
if unit_price.nil?
|
|
229
|
+
fail ArgumentError, 'unit_price cannot be nil'
|
|
249
230
|
end
|
|
250
231
|
|
|
251
|
-
if
|
|
252
|
-
fail ArgumentError, 'invalid value for "
|
|
232
|
+
if unit_price < 0
|
|
233
|
+
fail ArgumentError, 'invalid value for "unit_price", must be greater than or equal to 0.'
|
|
253
234
|
end
|
|
254
235
|
|
|
255
|
-
@
|
|
236
|
+
@unit_price = unit_price
|
|
256
237
|
end
|
|
257
238
|
|
|
258
239
|
# Custom attribute writer method with validation
|
|
@@ -270,17 +251,45 @@ module DigitalFemsa
|
|
|
270
251
|
end
|
|
271
252
|
|
|
272
253
|
# Custom attribute writer method with validation
|
|
273
|
-
# @param [Object]
|
|
274
|
-
def
|
|
275
|
-
if
|
|
276
|
-
fail ArgumentError, '
|
|
254
|
+
# @param [Object] description Value to be assigned
|
|
255
|
+
def description=(description)
|
|
256
|
+
if description.nil?
|
|
257
|
+
fail ArgumentError, 'description cannot be nil'
|
|
277
258
|
end
|
|
278
259
|
|
|
279
|
-
if
|
|
280
|
-
fail ArgumentError, 'invalid value for "
|
|
260
|
+
if description.to_s.length > 250
|
|
261
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
|
281
262
|
end
|
|
282
263
|
|
|
283
|
-
@
|
|
264
|
+
@description = description
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Custom attribute writer method with validation
|
|
268
|
+
# @param [Object] tags Value to be assigned
|
|
269
|
+
def tags=(tags)
|
|
270
|
+
if tags.nil?
|
|
271
|
+
fail ArgumentError, 'tags cannot be nil'
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
if tags.length < 1
|
|
275
|
+
fail ArgumentError, 'invalid value for "tags", number of items must be greater than or equal to 1.'
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
@tags = tags
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Custom attribute writer method with validation
|
|
282
|
+
# @param [Object] metadata Value to be assigned
|
|
283
|
+
def metadata=(metadata)
|
|
284
|
+
if metadata.nil?
|
|
285
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
if metadata.length > 100
|
|
289
|
+
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
@metadata = metadata
|
|
284
293
|
end
|
|
285
294
|
|
|
286
295
|
# Checks equality by comparing each attribute.
|
|
@@ -288,15 +297,14 @@ module DigitalFemsa
|
|
|
288
297
|
def ==(o)
|
|
289
298
|
return true if self.equal?(o)
|
|
290
299
|
self.class == o.class &&
|
|
291
|
-
antifraud_info == o.antifraud_info &&
|
|
292
|
-
brand == o.brand &&
|
|
293
|
-
description == o.description &&
|
|
294
|
-
metadata == o.metadata &&
|
|
295
300
|
name == o.name &&
|
|
301
|
+
unit_price == o.unit_price &&
|
|
296
302
|
quantity == o.quantity &&
|
|
297
303
|
sku == o.sku &&
|
|
304
|
+
brand == o.brand &&
|
|
305
|
+
description == o.description &&
|
|
298
306
|
tags == o.tags &&
|
|
299
|
-
|
|
307
|
+
metadata == o.metadata &&
|
|
300
308
|
id == o.id &&
|
|
301
309
|
object == o.object &&
|
|
302
310
|
parent_id == o.parent_id
|
|
@@ -311,7 +319,7 @@ module DigitalFemsa
|
|
|
311
319
|
# Calculates hash code according to all attributes.
|
|
312
320
|
# @return [Integer] Hash code
|
|
313
321
|
def hash
|
|
314
|
-
[
|
|
322
|
+
[name, unit_price, quantity, sku, brand, description, tags, metadata, id, object, parent_id].hash
|
|
315
323
|
end
|
|
316
324
|
|
|
317
325
|
# Builds the object from hash
|