ultracart_api 3.10.13 → 3.10.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +53 -96
- data/docs/ChannelPartnerApi.md +51 -0
- data/docs/{DelayAutoOrdersResponse.md → ChannelPartnerEstimateTaxResponse.md} +2 -2
- data/docs/ChargebackApi.md +1 -1
- data/docs/CustomerApi.md +1 -1
- data/docs/EmailDomain.md +1 -0
- data/docs/Mailgun.md +8 -0
- data/docs/OrderApi.md +1 -1
- data/docs/SsoApi.md +2 -2
- data/docs/StorefrontApi.md +101 -0
- data/docs/UserApi.md +2 -2
- data/docs/WebhookApi.md +1 -1
- data/lib/ultracart_api/api/channel_partner_api.rb +55 -0
- data/lib/ultracart_api/api/chargeback_api.rb +1 -1
- data/lib/ultracart_api/api/customer_api.rb +1 -1
- data/lib/ultracart_api/api/order_api.rb +1 -1
- data/lib/ultracart_api/api/sso_api.rb +2 -2
- data/lib/ultracart_api/api/storefront_api.rb +112 -0
- data/lib/ultracart_api/api/user_api.rb +2 -2
- data/lib/ultracart_api/api/webhook_api.rb +1 -1
- data/lib/ultracart_api/models/{stripe_connect_response.rb → channel_partner_estimate_tax_response.rb} +8 -8
- data/lib/ultracart_api/models/email_domain.rb +10 -1
- data/lib/ultracart_api/models/{payments_configuration_cash.rb → mailgun.rb} +8 -18
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +2 -39
- metadata +6 -80
- data/docs/ConfigurationApi.md +0 -756
- data/docs/PaymentsConfiguration.md +0 -24
- data/docs/PaymentsConfigurationAffirm.md +0 -15
- data/docs/PaymentsConfigurationAmazon.md +0 -15
- data/docs/PaymentsConfigurationCOD.md +0 -13
- data/docs/PaymentsConfigurationCash.md +0 -9
- data/docs/PaymentsConfigurationCheck.md +0 -19
- data/docs/PaymentsConfigurationCreditCard.md +0 -17
- data/docs/PaymentsConfigurationCreditCardType.md +0 -18
- data/docs/PaymentsConfigurationEcheck.md +0 -12
- data/docs/PaymentsConfigurationInsurance.md +0 -9
- data/docs/PaymentsConfigurationLoanHero.md +0 -12
- data/docs/PaymentsConfigurationMoneyOrder.md +0 -11
- data/docs/PaymentsConfigurationPayPal.md +0 -36
- data/docs/PaymentsConfigurationPurchaseOrder.md +0 -11
- data/docs/PaymentsConfigurationQuoteRequest.md +0 -10
- data/docs/PaymentsConfigurationResponse.md +0 -12
- data/docs/PaymentsConfigurationRestrictions.md +0 -21
- data/docs/PaymentsConfigurationRestrictionsTheme.md +0 -10
- data/docs/PaymentsConfigurationSezzle.md +0 -15
- data/docs/PaymentsConfigurationTestMethod.md +0 -18
- data/docs/PaymentsConfigurationWePay.md +0 -35
- data/docs/PaymentsConfigurationWireTransfer.md +0 -18
- data/docs/PaymentsThemeTransactionType.md +0 -10
- data/docs/PaymentsWepayEnroll.md +0 -22
- data/docs/RotatingTransactionGateway.md +0 -51
- data/docs/RotatingTransactionGatewayResponse.md +0 -12
- data/docs/RotatingTransactionGatewaysResponse.md +0 -12
- data/docs/RtgCurrency.md +0 -10
- data/docs/RtgDayOfMonthRestriction.md +0 -9
- data/docs/RtgDayOfWeekRestriction.md +0 -10
- data/docs/RtgSummaryGateway.md +0 -24
- data/docs/RtgSummaryResponse.md +0 -14
- data/docs/RtgThemeRestriction.md +0 -10
- data/docs/StripeConnectResponse.md +0 -12
- data/docs/TransactionGateway.md +0 -71
- data/docs/TransactionGatewaysRequest.md +0 -10
- data/docs/TransactionGatewaysResponse.md +0 -12
- data/lib/ultracart_api/api/configuration_api.rb +0 -843
- data/lib/ultracart_api/models/delay_auto_orders_response.rb +0 -221
- data/lib/ultracart_api/models/payments_configuration.rb +0 -329
- data/lib/ultracart_api/models/payments_configuration_affirm.rb +0 -288
- data/lib/ultracart_api/models/payments_configuration_amazon.rb +0 -288
- data/lib/ultracart_api/models/payments_configuration_check.rb +0 -294
- data/lib/ultracart_api/models/payments_configuration_cod.rb +0 -234
- data/lib/ultracart_api/models/payments_configuration_credit_card.rb +0 -279
- data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +0 -318
- data/lib/ultracart_api/models/payments_configuration_echeck.rb +0 -226
- data/lib/ultracart_api/models/payments_configuration_insurance.rb +0 -194
- data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +0 -224
- data/lib/ultracart_api/models/payments_configuration_money_order.rb +0 -214
- data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +0 -534
- data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +0 -214
- data/lib/ultracart_api/models/payments_configuration_quote_request.rb +0 -204
- data/lib/ultracart_api/models/payments_configuration_response.rb +0 -221
- data/lib/ultracart_api/models/payments_configuration_restrictions.rb +0 -447
- data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +0 -202
- data/lib/ultracart_api/models/payments_configuration_sezzle.rb +0 -288
- data/lib/ultracart_api/models/payments_configuration_test_method.rb +0 -319
- data/lib/ultracart_api/models/payments_configuration_we_pay.rb +0 -454
- data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +0 -284
- data/lib/ultracart_api/models/payments_theme_transaction_type.rb +0 -239
- data/lib/ultracart_api/models/payments_wepay_enroll.rb +0 -310
- data/lib/ultracart_api/models/rotating_transaction_gateway.rb +0 -675
- data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +0 -221
- data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +0 -223
- data/lib/ultracart_api/models/rtg_currency.rb +0 -205
- data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +0 -195
- data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +0 -205
- data/lib/ultracart_api/models/rtg_summary_gateway.rb +0 -329
- data/lib/ultracart_api/models/rtg_summary_response.rb +0 -240
- data/lib/ultracart_api/models/rtg_theme_restriction.rb +0 -239
- data/lib/ultracart_api/models/transaction_gateway.rb +0 -823
- data/lib/ultracart_api/models/transaction_gateways_request.rb +0 -242
- data/lib/ultracart_api/models/transaction_gateways_response.rb +0 -223
@@ -1,454 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#UltraCart Rest API V2
|
3
|
-
|
4
|
-
#UltraCart REST API Version 2
|
5
|
-
|
6
|
-
OpenAPI spec version: 2.0.0
|
7
|
-
Contact: support@ultracart.com
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.15-SNAPSHOT
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module UltracartClient
|
16
|
-
class PaymentsConfigurationWePay
|
17
|
-
# Master flag indicating this merchant accepts UltraCart Payments WePay
|
18
|
-
attr_accessor :accept_wepay
|
19
|
-
|
20
|
-
# URI for updating the WePay account
|
21
|
-
attr_accessor :account_update_uri
|
22
|
-
|
23
|
-
# Address line 1
|
24
|
-
attr_accessor :address1
|
25
|
-
|
26
|
-
# Address line 2
|
27
|
-
attr_accessor :address2
|
28
|
-
|
29
|
-
# For Canadian merchants, true if they wish to accept debit cards
|
30
|
-
attr_accessor :canada_accept_debit_cards
|
31
|
-
|
32
|
-
# City
|
33
|
-
attr_accessor :city
|
34
|
-
|
35
|
-
# Company
|
36
|
-
attr_accessor :company
|
37
|
-
|
38
|
-
# Company description
|
39
|
-
attr_accessor :company_description
|
40
|
-
|
41
|
-
# Console hostname
|
42
|
-
attr_accessor :console_hostname
|
43
|
-
|
44
|
-
# Country
|
45
|
-
attr_accessor :country
|
46
|
-
|
47
|
-
# WePay credit card rate
|
48
|
-
attr_accessor :credit_card_rate
|
49
|
-
|
50
|
-
# Base currency for transactions
|
51
|
-
attr_accessor :currency
|
52
|
-
|
53
|
-
# Expected Revenue
|
54
|
-
attr_accessor :expected_revenue
|
55
|
-
|
56
|
-
# Internal flag to aid UI
|
57
|
-
attr_accessor :hide_credit_card_non_ultracart_payments
|
58
|
-
|
59
|
-
# Internal flag to aid UI
|
60
|
-
attr_accessor :hide_surcharge_amount
|
61
|
-
|
62
|
-
# Industry
|
63
|
-
attr_accessor :industry
|
64
|
-
|
65
|
-
# Owner email
|
66
|
-
attr_accessor :owner_email
|
67
|
-
|
68
|
-
# Owner name
|
69
|
-
attr_accessor :owner_name
|
70
|
-
|
71
|
-
# Owner phone
|
72
|
-
attr_accessor :owner_phone
|
73
|
-
|
74
|
-
# Postal code
|
75
|
-
attr_accessor :postal_code
|
76
|
-
|
77
|
-
attr_accessor :restrictions
|
78
|
-
|
79
|
-
# Internal UI aid
|
80
|
-
attr_accessor :short_paypal_marketing_text
|
81
|
-
|
82
|
-
# Internal flag to aid UI
|
83
|
-
attr_accessor :show_ultracart_payments_disabled
|
84
|
-
|
85
|
-
# Internal flag to aid UI
|
86
|
-
attr_accessor :show_ultracart_payments_intro
|
87
|
-
|
88
|
-
# Internal flag to aid UI
|
89
|
-
attr_accessor :show_ultracart_payments_verification
|
90
|
-
|
91
|
-
# Internal flag to aid UI
|
92
|
-
attr_accessor :show_ultracart_payments_verified
|
93
|
-
|
94
|
-
# State
|
95
|
-
attr_accessor :state
|
96
|
-
|
97
|
-
# Website URL
|
98
|
-
attr_accessor :website_url
|
99
|
-
|
100
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
101
|
-
def self.attribute_map
|
102
|
-
{
|
103
|
-
:'accept_wepay' => :'accept_wepay',
|
104
|
-
:'account_update_uri' => :'account_update_uri',
|
105
|
-
:'address1' => :'address1',
|
106
|
-
:'address2' => :'address2',
|
107
|
-
:'canada_accept_debit_cards' => :'canada_accept_debit_cards',
|
108
|
-
:'city' => :'city',
|
109
|
-
:'company' => :'company',
|
110
|
-
:'company_description' => :'company_description',
|
111
|
-
:'console_hostname' => :'console_hostname',
|
112
|
-
:'country' => :'country',
|
113
|
-
:'credit_card_rate' => :'credit_card_rate',
|
114
|
-
:'currency' => :'currency',
|
115
|
-
:'expected_revenue' => :'expected_revenue',
|
116
|
-
:'hide_credit_card_non_ultracart_payments' => :'hide_credit_card_non_ultracart_payments',
|
117
|
-
:'hide_surcharge_amount' => :'hide_surcharge_amount',
|
118
|
-
:'industry' => :'industry',
|
119
|
-
:'owner_email' => :'owner_email',
|
120
|
-
:'owner_name' => :'owner_name',
|
121
|
-
:'owner_phone' => :'owner_phone',
|
122
|
-
:'postal_code' => :'postal_code',
|
123
|
-
:'restrictions' => :'restrictions',
|
124
|
-
:'short_paypal_marketing_text' => :'short_paypal_marketing_text',
|
125
|
-
:'show_ultracart_payments_disabled' => :'show_ultracart_payments_disabled',
|
126
|
-
:'show_ultracart_payments_intro' => :'show_ultracart_payments_intro',
|
127
|
-
:'show_ultracart_payments_verification' => :'show_ultracart_payments_verification',
|
128
|
-
:'show_ultracart_payments_verified' => :'show_ultracart_payments_verified',
|
129
|
-
:'state' => :'state',
|
130
|
-
:'website_url' => :'website_url'
|
131
|
-
}
|
132
|
-
end
|
133
|
-
|
134
|
-
# Attribute type mapping.
|
135
|
-
def self.swagger_types
|
136
|
-
{
|
137
|
-
:'accept_wepay' => :'BOOLEAN',
|
138
|
-
:'account_update_uri' => :'String',
|
139
|
-
:'address1' => :'String',
|
140
|
-
:'address2' => :'String',
|
141
|
-
:'canada_accept_debit_cards' => :'BOOLEAN',
|
142
|
-
:'city' => :'String',
|
143
|
-
:'company' => :'String',
|
144
|
-
:'company_description' => :'String',
|
145
|
-
:'console_hostname' => :'String',
|
146
|
-
:'country' => :'String',
|
147
|
-
:'credit_card_rate' => :'String',
|
148
|
-
:'currency' => :'String',
|
149
|
-
:'expected_revenue' => :'String',
|
150
|
-
:'hide_credit_card_non_ultracart_payments' => :'BOOLEAN',
|
151
|
-
:'hide_surcharge_amount' => :'BOOLEAN',
|
152
|
-
:'industry' => :'String',
|
153
|
-
:'owner_email' => :'String',
|
154
|
-
:'owner_name' => :'String',
|
155
|
-
:'owner_phone' => :'String',
|
156
|
-
:'postal_code' => :'String',
|
157
|
-
:'restrictions' => :'PaymentsConfigurationRestrictions',
|
158
|
-
:'short_paypal_marketing_text' => :'BOOLEAN',
|
159
|
-
:'show_ultracart_payments_disabled' => :'BOOLEAN',
|
160
|
-
:'show_ultracart_payments_intro' => :'BOOLEAN',
|
161
|
-
:'show_ultracart_payments_verification' => :'BOOLEAN',
|
162
|
-
:'show_ultracart_payments_verified' => :'BOOLEAN',
|
163
|
-
:'state' => :'String',
|
164
|
-
:'website_url' => :'String'
|
165
|
-
}
|
166
|
-
end
|
167
|
-
|
168
|
-
# Initializes the object
|
169
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
170
|
-
def initialize(attributes = {})
|
171
|
-
return unless attributes.is_a?(Hash)
|
172
|
-
|
173
|
-
# convert string to symbol for hash key
|
174
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
175
|
-
|
176
|
-
if attributes.has_key?(:'accept_wepay')
|
177
|
-
self.accept_wepay = attributes[:'accept_wepay']
|
178
|
-
end
|
179
|
-
|
180
|
-
if attributes.has_key?(:'account_update_uri')
|
181
|
-
self.account_update_uri = attributes[:'account_update_uri']
|
182
|
-
end
|
183
|
-
|
184
|
-
if attributes.has_key?(:'address1')
|
185
|
-
self.address1 = attributes[:'address1']
|
186
|
-
end
|
187
|
-
|
188
|
-
if attributes.has_key?(:'address2')
|
189
|
-
self.address2 = attributes[:'address2']
|
190
|
-
end
|
191
|
-
|
192
|
-
if attributes.has_key?(:'canada_accept_debit_cards')
|
193
|
-
self.canada_accept_debit_cards = attributes[:'canada_accept_debit_cards']
|
194
|
-
end
|
195
|
-
|
196
|
-
if attributes.has_key?(:'city')
|
197
|
-
self.city = attributes[:'city']
|
198
|
-
end
|
199
|
-
|
200
|
-
if attributes.has_key?(:'company')
|
201
|
-
self.company = attributes[:'company']
|
202
|
-
end
|
203
|
-
|
204
|
-
if attributes.has_key?(:'company_description')
|
205
|
-
self.company_description = attributes[:'company_description']
|
206
|
-
end
|
207
|
-
|
208
|
-
if attributes.has_key?(:'console_hostname')
|
209
|
-
self.console_hostname = attributes[:'console_hostname']
|
210
|
-
end
|
211
|
-
|
212
|
-
if attributes.has_key?(:'country')
|
213
|
-
self.country = attributes[:'country']
|
214
|
-
end
|
215
|
-
|
216
|
-
if attributes.has_key?(:'credit_card_rate')
|
217
|
-
self.credit_card_rate = attributes[:'credit_card_rate']
|
218
|
-
end
|
219
|
-
|
220
|
-
if attributes.has_key?(:'currency')
|
221
|
-
self.currency = attributes[:'currency']
|
222
|
-
end
|
223
|
-
|
224
|
-
if attributes.has_key?(:'expected_revenue')
|
225
|
-
self.expected_revenue = attributes[:'expected_revenue']
|
226
|
-
end
|
227
|
-
|
228
|
-
if attributes.has_key?(:'hide_credit_card_non_ultracart_payments')
|
229
|
-
self.hide_credit_card_non_ultracart_payments = attributes[:'hide_credit_card_non_ultracart_payments']
|
230
|
-
end
|
231
|
-
|
232
|
-
if attributes.has_key?(:'hide_surcharge_amount')
|
233
|
-
self.hide_surcharge_amount = attributes[:'hide_surcharge_amount']
|
234
|
-
end
|
235
|
-
|
236
|
-
if attributes.has_key?(:'industry')
|
237
|
-
self.industry = attributes[:'industry']
|
238
|
-
end
|
239
|
-
|
240
|
-
if attributes.has_key?(:'owner_email')
|
241
|
-
self.owner_email = attributes[:'owner_email']
|
242
|
-
end
|
243
|
-
|
244
|
-
if attributes.has_key?(:'owner_name')
|
245
|
-
self.owner_name = attributes[:'owner_name']
|
246
|
-
end
|
247
|
-
|
248
|
-
if attributes.has_key?(:'owner_phone')
|
249
|
-
self.owner_phone = attributes[:'owner_phone']
|
250
|
-
end
|
251
|
-
|
252
|
-
if attributes.has_key?(:'postal_code')
|
253
|
-
self.postal_code = attributes[:'postal_code']
|
254
|
-
end
|
255
|
-
|
256
|
-
if attributes.has_key?(:'restrictions')
|
257
|
-
self.restrictions = attributes[:'restrictions']
|
258
|
-
end
|
259
|
-
|
260
|
-
if attributes.has_key?(:'short_paypal_marketing_text')
|
261
|
-
self.short_paypal_marketing_text = attributes[:'short_paypal_marketing_text']
|
262
|
-
end
|
263
|
-
|
264
|
-
if attributes.has_key?(:'show_ultracart_payments_disabled')
|
265
|
-
self.show_ultracart_payments_disabled = attributes[:'show_ultracart_payments_disabled']
|
266
|
-
end
|
267
|
-
|
268
|
-
if attributes.has_key?(:'show_ultracart_payments_intro')
|
269
|
-
self.show_ultracart_payments_intro = attributes[:'show_ultracart_payments_intro']
|
270
|
-
end
|
271
|
-
|
272
|
-
if attributes.has_key?(:'show_ultracart_payments_verification')
|
273
|
-
self.show_ultracart_payments_verification = attributes[:'show_ultracart_payments_verification']
|
274
|
-
end
|
275
|
-
|
276
|
-
if attributes.has_key?(:'show_ultracart_payments_verified')
|
277
|
-
self.show_ultracart_payments_verified = attributes[:'show_ultracart_payments_verified']
|
278
|
-
end
|
279
|
-
|
280
|
-
if attributes.has_key?(:'state')
|
281
|
-
self.state = attributes[:'state']
|
282
|
-
end
|
283
|
-
|
284
|
-
if attributes.has_key?(:'website_url')
|
285
|
-
self.website_url = attributes[:'website_url']
|
286
|
-
end
|
287
|
-
end
|
288
|
-
|
289
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
290
|
-
# @return Array for valid properties with the reasons
|
291
|
-
def list_invalid_properties
|
292
|
-
invalid_properties = Array.new
|
293
|
-
invalid_properties
|
294
|
-
end
|
295
|
-
|
296
|
-
# Check to see if the all the properties in the model are valid
|
297
|
-
# @return true if the model is valid
|
298
|
-
def valid?
|
299
|
-
true
|
300
|
-
end
|
301
|
-
|
302
|
-
# Checks equality by comparing each attribute.
|
303
|
-
# @param [Object] Object to be compared
|
304
|
-
def ==(o)
|
305
|
-
return true if self.equal?(o)
|
306
|
-
self.class == o.class &&
|
307
|
-
accept_wepay == o.accept_wepay &&
|
308
|
-
account_update_uri == o.account_update_uri &&
|
309
|
-
address1 == o.address1 &&
|
310
|
-
address2 == o.address2 &&
|
311
|
-
canada_accept_debit_cards == o.canada_accept_debit_cards &&
|
312
|
-
city == o.city &&
|
313
|
-
company == o.company &&
|
314
|
-
company_description == o.company_description &&
|
315
|
-
console_hostname == o.console_hostname &&
|
316
|
-
country == o.country &&
|
317
|
-
credit_card_rate == o.credit_card_rate &&
|
318
|
-
currency == o.currency &&
|
319
|
-
expected_revenue == o.expected_revenue &&
|
320
|
-
hide_credit_card_non_ultracart_payments == o.hide_credit_card_non_ultracart_payments &&
|
321
|
-
hide_surcharge_amount == o.hide_surcharge_amount &&
|
322
|
-
industry == o.industry &&
|
323
|
-
owner_email == o.owner_email &&
|
324
|
-
owner_name == o.owner_name &&
|
325
|
-
owner_phone == o.owner_phone &&
|
326
|
-
postal_code == o.postal_code &&
|
327
|
-
restrictions == o.restrictions &&
|
328
|
-
short_paypal_marketing_text == o.short_paypal_marketing_text &&
|
329
|
-
show_ultracart_payments_disabled == o.show_ultracart_payments_disabled &&
|
330
|
-
show_ultracart_payments_intro == o.show_ultracart_payments_intro &&
|
331
|
-
show_ultracart_payments_verification == o.show_ultracart_payments_verification &&
|
332
|
-
show_ultracart_payments_verified == o.show_ultracart_payments_verified &&
|
333
|
-
state == o.state &&
|
334
|
-
website_url == o.website_url
|
335
|
-
end
|
336
|
-
|
337
|
-
# @see the `==` method
|
338
|
-
# @param [Object] Object to be compared
|
339
|
-
def eql?(o)
|
340
|
-
self == o
|
341
|
-
end
|
342
|
-
|
343
|
-
# Calculates hash code according to all attributes.
|
344
|
-
# @return [Fixnum] Hash code
|
345
|
-
def hash
|
346
|
-
[accept_wepay, account_update_uri, address1, address2, canada_accept_debit_cards, city, company, company_description, console_hostname, country, credit_card_rate, currency, expected_revenue, hide_credit_card_non_ultracart_payments, hide_surcharge_amount, industry, owner_email, owner_name, owner_phone, postal_code, restrictions, short_paypal_marketing_text, show_ultracart_payments_disabled, show_ultracart_payments_intro, show_ultracart_payments_verification, show_ultracart_payments_verified, state, website_url].hash
|
347
|
-
end
|
348
|
-
|
349
|
-
# Builds the object from hash
|
350
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
351
|
-
# @return [Object] Returns the model itself
|
352
|
-
def build_from_hash(attributes)
|
353
|
-
return nil unless attributes.is_a?(Hash)
|
354
|
-
self.class.swagger_types.each_pair do |key, type|
|
355
|
-
if type =~ /\AArray<(.*)>/i
|
356
|
-
# check to ensure the input is an array given that the attribute
|
357
|
-
# is documented as an array but the input is not
|
358
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
359
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
360
|
-
end
|
361
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
362
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
363
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
364
|
-
end
|
365
|
-
|
366
|
-
self
|
367
|
-
end
|
368
|
-
|
369
|
-
# Deserializes the data based on type
|
370
|
-
# @param string type Data type
|
371
|
-
# @param string value Value to be deserialized
|
372
|
-
# @return [Object] Deserialized data
|
373
|
-
def _deserialize(type, value)
|
374
|
-
case type.to_sym
|
375
|
-
when :DateTime
|
376
|
-
DateTime.parse(value)
|
377
|
-
when :Date
|
378
|
-
Date.parse(value)
|
379
|
-
when :String
|
380
|
-
value.to_s
|
381
|
-
when :Integer
|
382
|
-
value.to_i
|
383
|
-
when :Float
|
384
|
-
value.to_f
|
385
|
-
when :BOOLEAN
|
386
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
387
|
-
true
|
388
|
-
else
|
389
|
-
false
|
390
|
-
end
|
391
|
-
when :Object
|
392
|
-
# generic object (usually a Hash), return directly
|
393
|
-
value
|
394
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
395
|
-
inner_type = Regexp.last_match[:inner_type]
|
396
|
-
value.map { |v| _deserialize(inner_type, v) }
|
397
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
398
|
-
k_type = Regexp.last_match[:k_type]
|
399
|
-
v_type = Regexp.last_match[:v_type]
|
400
|
-
{}.tap do |hash|
|
401
|
-
value.each do |k, v|
|
402
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
403
|
-
end
|
404
|
-
end
|
405
|
-
else # model
|
406
|
-
temp_model = UltracartClient.const_get(type).new
|
407
|
-
temp_model.build_from_hash(value)
|
408
|
-
end
|
409
|
-
end
|
410
|
-
|
411
|
-
# Returns the string representation of the object
|
412
|
-
# @return [String] String presentation of the object
|
413
|
-
def to_s
|
414
|
-
to_hash.to_s
|
415
|
-
end
|
416
|
-
|
417
|
-
# to_body is an alias to to_hash (backward compatibility)
|
418
|
-
# @return [Hash] Returns the object in the form of hash
|
419
|
-
def to_body
|
420
|
-
to_hash
|
421
|
-
end
|
422
|
-
|
423
|
-
# Returns the object in the form of hash
|
424
|
-
# @return [Hash] Returns the object in the form of hash
|
425
|
-
def to_hash
|
426
|
-
hash = {}
|
427
|
-
self.class.attribute_map.each_pair do |attr, param|
|
428
|
-
value = self.send(attr)
|
429
|
-
next if value.nil?
|
430
|
-
hash[param] = _to_hash(value)
|
431
|
-
end
|
432
|
-
hash
|
433
|
-
end
|
434
|
-
|
435
|
-
# Outputs non-array value in the form of hash
|
436
|
-
# For object, use to_hash. Otherwise, just return the value
|
437
|
-
# @param [Object] value Any valid value
|
438
|
-
# @return [Hash] Returns the value in the form of hash
|
439
|
-
def _to_hash(value)
|
440
|
-
if value.is_a?(Array)
|
441
|
-
value.compact.map { |v| _to_hash(v) }
|
442
|
-
elsif value.is_a?(Hash)
|
443
|
-
{}.tap do |hash|
|
444
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
445
|
-
end
|
446
|
-
elsif value.respond_to? :to_hash
|
447
|
-
value.to_hash
|
448
|
-
else
|
449
|
-
value
|
450
|
-
end
|
451
|
-
end
|
452
|
-
|
453
|
-
end
|
454
|
-
end
|