ultracart_api 3.10.14 → 3.10.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -97
  3. data/docs/ChannelPartnerApi.md +51 -0
  4. data/docs/{DelayAutoOrdersResponse.md → ChannelPartnerEstimateTaxResponse.md} +2 -2
  5. data/lib/ultracart_api/api/channel_partner_api.rb +55 -0
  6. data/lib/ultracart_api/models/{stripe_connect_response.rb → channel_partner_estimate_tax_response.rb} +8 -8
  7. data/lib/ultracart_api/version.rb +1 -1
  8. data/lib/ultracart_api.rb +1 -39
  9. metadata +4 -80
  10. data/docs/ConfigurationApi.md +0 -756
  11. data/docs/PaymentsConfiguration.md +0 -24
  12. data/docs/PaymentsConfigurationAffirm.md +0 -15
  13. data/docs/PaymentsConfigurationAmazon.md +0 -15
  14. data/docs/PaymentsConfigurationCOD.md +0 -13
  15. data/docs/PaymentsConfigurationCash.md +0 -9
  16. data/docs/PaymentsConfigurationCheck.md +0 -19
  17. data/docs/PaymentsConfigurationCreditCard.md +0 -17
  18. data/docs/PaymentsConfigurationCreditCardType.md +0 -18
  19. data/docs/PaymentsConfigurationEcheck.md +0 -12
  20. data/docs/PaymentsConfigurationInsurance.md +0 -9
  21. data/docs/PaymentsConfigurationLoanHero.md +0 -12
  22. data/docs/PaymentsConfigurationMoneyOrder.md +0 -11
  23. data/docs/PaymentsConfigurationPayPal.md +0 -36
  24. data/docs/PaymentsConfigurationPurchaseOrder.md +0 -11
  25. data/docs/PaymentsConfigurationQuoteRequest.md +0 -10
  26. data/docs/PaymentsConfigurationResponse.md +0 -12
  27. data/docs/PaymentsConfigurationRestrictions.md +0 -21
  28. data/docs/PaymentsConfigurationRestrictionsTheme.md +0 -10
  29. data/docs/PaymentsConfigurationSezzle.md +0 -15
  30. data/docs/PaymentsConfigurationTestMethod.md +0 -18
  31. data/docs/PaymentsConfigurationWePay.md +0 -35
  32. data/docs/PaymentsConfigurationWireTransfer.md +0 -18
  33. data/docs/PaymentsThemeTransactionType.md +0 -10
  34. data/docs/PaymentsWepayEnroll.md +0 -22
  35. data/docs/RotatingTransactionGateway.md +0 -51
  36. data/docs/RotatingTransactionGatewayResponse.md +0 -12
  37. data/docs/RotatingTransactionGatewaysResponse.md +0 -12
  38. data/docs/RtgCurrency.md +0 -10
  39. data/docs/RtgDayOfMonthRestriction.md +0 -9
  40. data/docs/RtgDayOfWeekRestriction.md +0 -10
  41. data/docs/RtgSummaryGateway.md +0 -24
  42. data/docs/RtgSummaryResponse.md +0 -14
  43. data/docs/RtgThemeRestriction.md +0 -10
  44. data/docs/StripeConnectResponse.md +0 -12
  45. data/docs/TransactionGateway.md +0 -71
  46. data/docs/TransactionGatewaysRequest.md +0 -10
  47. data/docs/TransactionGatewaysResponse.md +0 -12
  48. data/lib/ultracart_api/api/configuration_api.rb +0 -843
  49. data/lib/ultracart_api/models/delay_auto_orders_response.rb +0 -221
  50. data/lib/ultracart_api/models/payments_configuration.rb +0 -329
  51. data/lib/ultracart_api/models/payments_configuration_affirm.rb +0 -288
  52. data/lib/ultracart_api/models/payments_configuration_amazon.rb +0 -288
  53. data/lib/ultracart_api/models/payments_configuration_cash.rb +0 -194
  54. data/lib/ultracart_api/models/payments_configuration_check.rb +0 -294
  55. data/lib/ultracart_api/models/payments_configuration_cod.rb +0 -234
  56. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +0 -279
  57. data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +0 -318
  58. data/lib/ultracart_api/models/payments_configuration_echeck.rb +0 -226
  59. data/lib/ultracart_api/models/payments_configuration_insurance.rb +0 -194
  60. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +0 -224
  61. data/lib/ultracart_api/models/payments_configuration_money_order.rb +0 -214
  62. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +0 -534
  63. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +0 -214
  64. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +0 -204
  65. data/lib/ultracart_api/models/payments_configuration_response.rb +0 -221
  66. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +0 -447
  67. data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +0 -202
  68. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +0 -288
  69. data/lib/ultracart_api/models/payments_configuration_test_method.rb +0 -319
  70. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +0 -454
  71. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +0 -284
  72. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +0 -239
  73. data/lib/ultracart_api/models/payments_wepay_enroll.rb +0 -310
  74. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +0 -675
  75. data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +0 -221
  76. data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +0 -223
  77. data/lib/ultracart_api/models/rtg_currency.rb +0 -205
  78. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +0 -195
  79. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +0 -205
  80. data/lib/ultracart_api/models/rtg_summary_gateway.rb +0 -329
  81. data/lib/ultracart_api/models/rtg_summary_response.rb +0 -240
  82. data/lib/ultracart_api/models/rtg_theme_restriction.rb +0 -239
  83. data/lib/ultracart_api/models/transaction_gateway.rb +0 -823
  84. data/lib/ultracart_api/models/transaction_gateways_request.rb +0 -242
  85. data/lib/ultracart_api/models/transaction_gateways_response.rb +0 -223
@@ -1,447 +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 PaymentsConfigurationRestrictions
17
- attr_accessor :descriptions
18
-
19
- # Maximum subtotal
20
- attr_accessor :maximum_subtotal
21
-
22
- # Minimum subtotal
23
- attr_accessor :minimum_subtotal
24
-
25
- # Payment method
26
- attr_accessor :payment_method
27
-
28
- # Alaska and Hawaii restriction
29
- attr_accessor :restriction_alaska_hawaii
30
-
31
- # APO/FPO restriction
32
- attr_accessor :restriction_apo_fpo
33
-
34
- # Canada restriction
35
- attr_accessor :restriction_canada
36
-
37
- # Continental US restriction
38
- attr_accessor :restriction_continental_us
39
-
40
- # Domestic only restriction
41
- attr_accessor :restriction_domestic_only
42
-
43
- # International only restriction
44
- attr_accessor :restriction_international_only
45
-
46
- # PO Box restriction
47
- attr_accessor :restriction_po_box
48
-
49
- # Puerto Rico restriction
50
- attr_accessor :restriction_puerto_rico
51
-
52
- # US Territories restriction
53
- attr_accessor :restriction_us_territories
54
-
55
- attr_accessor :themes
56
-
57
- class EnumAttributeValidator
58
- attr_reader :datatype
59
- attr_reader :allowable_values
60
-
61
- def initialize(datatype, allowable_values)
62
- @allowable_values = allowable_values.map do |value|
63
- case datatype.to_s
64
- when /Integer/i
65
- value.to_i
66
- when /Float/i
67
- value.to_f
68
- else
69
- value
70
- end
71
- end
72
- end
73
-
74
- def valid?(value)
75
- !value || allowable_values.include?(value)
76
- end
77
- end
78
-
79
- # Attribute mapping from ruby-style variable name to JSON key.
80
- def self.attribute_map
81
- {
82
- :'descriptions' => :'descriptions',
83
- :'maximum_subtotal' => :'maximum_subtotal',
84
- :'minimum_subtotal' => :'minimum_subtotal',
85
- :'payment_method' => :'payment_method',
86
- :'restriction_alaska_hawaii' => :'restriction_alaska_hawaii',
87
- :'restriction_apo_fpo' => :'restriction_apo_fpo',
88
- :'restriction_canada' => :'restriction_canada',
89
- :'restriction_continental_us' => :'restriction_continental_us',
90
- :'restriction_domestic_only' => :'restriction_domestic_only',
91
- :'restriction_international_only' => :'restriction_international_only',
92
- :'restriction_po_box' => :'restriction_po_box',
93
- :'restriction_puerto_rico' => :'restriction_puerto_rico',
94
- :'restriction_us_territories' => :'restriction_us_territories',
95
- :'themes' => :'themes'
96
- }
97
- end
98
-
99
- # Attribute type mapping.
100
- def self.swagger_types
101
- {
102
- :'descriptions' => :'Array<String>',
103
- :'maximum_subtotal' => :'Float',
104
- :'minimum_subtotal' => :'Float',
105
- :'payment_method' => :'String',
106
- :'restriction_alaska_hawaii' => :'String',
107
- :'restriction_apo_fpo' => :'String',
108
- :'restriction_canada' => :'String',
109
- :'restriction_continental_us' => :'String',
110
- :'restriction_domestic_only' => :'String',
111
- :'restriction_international_only' => :'String',
112
- :'restriction_po_box' => :'String',
113
- :'restriction_puerto_rico' => :'String',
114
- :'restriction_us_territories' => :'String',
115
- :'themes' => :'Array<PaymentsConfigurationRestrictionsTheme>'
116
- }
117
- end
118
-
119
- # Initializes the object
120
- # @param [Hash] attributes Model attributes in the form of hash
121
- def initialize(attributes = {})
122
- return unless attributes.is_a?(Hash)
123
-
124
- # convert string to symbol for hash key
125
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
126
-
127
- if attributes.has_key?(:'descriptions')
128
- if (value = attributes[:'descriptions']).is_a?(Array)
129
- self.descriptions = value
130
- end
131
- end
132
-
133
- if attributes.has_key?(:'maximum_subtotal')
134
- self.maximum_subtotal = attributes[:'maximum_subtotal']
135
- end
136
-
137
- if attributes.has_key?(:'minimum_subtotal')
138
- self.minimum_subtotal = attributes[:'minimum_subtotal']
139
- end
140
-
141
- if attributes.has_key?(:'payment_method')
142
- self.payment_method = attributes[:'payment_method']
143
- end
144
-
145
- if attributes.has_key?(:'restriction_alaska_hawaii')
146
- self.restriction_alaska_hawaii = attributes[:'restriction_alaska_hawaii']
147
- end
148
-
149
- if attributes.has_key?(:'restriction_apo_fpo')
150
- self.restriction_apo_fpo = attributes[:'restriction_apo_fpo']
151
- end
152
-
153
- if attributes.has_key?(:'restriction_canada')
154
- self.restriction_canada = attributes[:'restriction_canada']
155
- end
156
-
157
- if attributes.has_key?(:'restriction_continental_us')
158
- self.restriction_continental_us = attributes[:'restriction_continental_us']
159
- end
160
-
161
- if attributes.has_key?(:'restriction_domestic_only')
162
- self.restriction_domestic_only = attributes[:'restriction_domestic_only']
163
- end
164
-
165
- if attributes.has_key?(:'restriction_international_only')
166
- self.restriction_international_only = attributes[:'restriction_international_only']
167
- end
168
-
169
- if attributes.has_key?(:'restriction_po_box')
170
- self.restriction_po_box = attributes[:'restriction_po_box']
171
- end
172
-
173
- if attributes.has_key?(:'restriction_puerto_rico')
174
- self.restriction_puerto_rico = attributes[:'restriction_puerto_rico']
175
- end
176
-
177
- if attributes.has_key?(:'restriction_us_territories')
178
- self.restriction_us_territories = attributes[:'restriction_us_territories']
179
- end
180
-
181
- if attributes.has_key?(:'themes')
182
- if (value = attributes[:'themes']).is_a?(Array)
183
- self.themes = value
184
- end
185
- end
186
- end
187
-
188
- # Show invalid properties with the reasons. Usually used together with valid?
189
- # @return Array for valid properties with the reasons
190
- def list_invalid_properties
191
- invalid_properties = Array.new
192
- invalid_properties
193
- end
194
-
195
- # Check to see if the all the properties in the model are valid
196
- # @return true if the model is valid
197
- def valid?
198
- restriction_alaska_hawaii_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
199
- return false unless restriction_alaska_hawaii_validator.valid?(@restriction_alaska_hawaii)
200
- restriction_apo_fpo_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
201
- return false unless restriction_apo_fpo_validator.valid?(@restriction_apo_fpo)
202
- restriction_canada_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
203
- return false unless restriction_canada_validator.valid?(@restriction_canada)
204
- restriction_continental_us_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
205
- return false unless restriction_continental_us_validator.valid?(@restriction_continental_us)
206
- restriction_domestic_only_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
207
- return false unless restriction_domestic_only_validator.valid?(@restriction_domestic_only)
208
- restriction_international_only_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
209
- return false unless restriction_international_only_validator.valid?(@restriction_international_only)
210
- restriction_po_box_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
211
- return false unless restriction_po_box_validator.valid?(@restriction_po_box)
212
- restriction_puerto_rico_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
213
- return false unless restriction_puerto_rico_validator.valid?(@restriction_puerto_rico)
214
- restriction_us_territories_validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
215
- return false unless restriction_us_territories_validator.valid?(@restriction_us_territories)
216
- true
217
- end
218
-
219
- # Custom attribute writer method checking allowed values (enum).
220
- # @param [Object] restriction_alaska_hawaii Object to be assigned
221
- def restriction_alaska_hawaii=(restriction_alaska_hawaii)
222
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
223
- unless validator.valid?(restriction_alaska_hawaii)
224
- fail ArgumentError, 'invalid value for "restriction_alaska_hawaii", must be one of #{validator.allowable_values}.'
225
- end
226
- @restriction_alaska_hawaii = restriction_alaska_hawaii
227
- end
228
-
229
- # Custom attribute writer method checking allowed values (enum).
230
- # @param [Object] restriction_apo_fpo Object to be assigned
231
- def restriction_apo_fpo=(restriction_apo_fpo)
232
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
233
- unless validator.valid?(restriction_apo_fpo)
234
- fail ArgumentError, 'invalid value for "restriction_apo_fpo", must be one of #{validator.allowable_values}.'
235
- end
236
- @restriction_apo_fpo = restriction_apo_fpo
237
- end
238
-
239
- # Custom attribute writer method checking allowed values (enum).
240
- # @param [Object] restriction_canada Object to be assigned
241
- def restriction_canada=(restriction_canada)
242
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
243
- unless validator.valid?(restriction_canada)
244
- fail ArgumentError, 'invalid value for "restriction_canada", must be one of #{validator.allowable_values}.'
245
- end
246
- @restriction_canada = restriction_canada
247
- end
248
-
249
- # Custom attribute writer method checking allowed values (enum).
250
- # @param [Object] restriction_continental_us Object to be assigned
251
- def restriction_continental_us=(restriction_continental_us)
252
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
253
- unless validator.valid?(restriction_continental_us)
254
- fail ArgumentError, 'invalid value for "restriction_continental_us", must be one of #{validator.allowable_values}.'
255
- end
256
- @restriction_continental_us = restriction_continental_us
257
- end
258
-
259
- # Custom attribute writer method checking allowed values (enum).
260
- # @param [Object] restriction_domestic_only Object to be assigned
261
- def restriction_domestic_only=(restriction_domestic_only)
262
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
263
- unless validator.valid?(restriction_domestic_only)
264
- fail ArgumentError, 'invalid value for "restriction_domestic_only", must be one of #{validator.allowable_values}.'
265
- end
266
- @restriction_domestic_only = restriction_domestic_only
267
- end
268
-
269
- # Custom attribute writer method checking allowed values (enum).
270
- # @param [Object] restriction_international_only Object to be assigned
271
- def restriction_international_only=(restriction_international_only)
272
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
273
- unless validator.valid?(restriction_international_only)
274
- fail ArgumentError, 'invalid value for "restriction_international_only", must be one of #{validator.allowable_values}.'
275
- end
276
- @restriction_international_only = restriction_international_only
277
- end
278
-
279
- # Custom attribute writer method checking allowed values (enum).
280
- # @param [Object] restriction_po_box Object to be assigned
281
- def restriction_po_box=(restriction_po_box)
282
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
283
- unless validator.valid?(restriction_po_box)
284
- fail ArgumentError, 'invalid value for "restriction_po_box", must be one of #{validator.allowable_values}.'
285
- end
286
- @restriction_po_box = restriction_po_box
287
- end
288
-
289
- # Custom attribute writer method checking allowed values (enum).
290
- # @param [Object] restriction_puerto_rico Object to be assigned
291
- def restriction_puerto_rico=(restriction_puerto_rico)
292
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
293
- unless validator.valid?(restriction_puerto_rico)
294
- fail ArgumentError, 'invalid value for "restriction_puerto_rico", must be one of #{validator.allowable_values}.'
295
- end
296
- @restriction_puerto_rico = restriction_puerto_rico
297
- end
298
-
299
- # Custom attribute writer method checking allowed values (enum).
300
- # @param [Object] restriction_us_territories Object to be assigned
301
- def restriction_us_territories=(restriction_us_territories)
302
- validator = EnumAttributeValidator.new('String', ['invalid', 'invalidOnly', 'valid'])
303
- unless validator.valid?(restriction_us_territories)
304
- fail ArgumentError, 'invalid value for "restriction_us_territories", must be one of #{validator.allowable_values}.'
305
- end
306
- @restriction_us_territories = restriction_us_territories
307
- end
308
-
309
- # Checks equality by comparing each attribute.
310
- # @param [Object] Object to be compared
311
- def ==(o)
312
- return true if self.equal?(o)
313
- self.class == o.class &&
314
- descriptions == o.descriptions &&
315
- maximum_subtotal == o.maximum_subtotal &&
316
- minimum_subtotal == o.minimum_subtotal &&
317
- payment_method == o.payment_method &&
318
- restriction_alaska_hawaii == o.restriction_alaska_hawaii &&
319
- restriction_apo_fpo == o.restriction_apo_fpo &&
320
- restriction_canada == o.restriction_canada &&
321
- restriction_continental_us == o.restriction_continental_us &&
322
- restriction_domestic_only == o.restriction_domestic_only &&
323
- restriction_international_only == o.restriction_international_only &&
324
- restriction_po_box == o.restriction_po_box &&
325
- restriction_puerto_rico == o.restriction_puerto_rico &&
326
- restriction_us_territories == o.restriction_us_territories &&
327
- themes == o.themes
328
- end
329
-
330
- # @see the `==` method
331
- # @param [Object] Object to be compared
332
- def eql?(o)
333
- self == o
334
- end
335
-
336
- # Calculates hash code according to all attributes.
337
- # @return [Fixnum] Hash code
338
- def hash
339
- [descriptions, maximum_subtotal, minimum_subtotal, payment_method, restriction_alaska_hawaii, restriction_apo_fpo, restriction_canada, restriction_continental_us, restriction_domestic_only, restriction_international_only, restriction_po_box, restriction_puerto_rico, restriction_us_territories, themes].hash
340
- end
341
-
342
- # Builds the object from hash
343
- # @param [Hash] attributes Model attributes in the form of hash
344
- # @return [Object] Returns the model itself
345
- def build_from_hash(attributes)
346
- return nil unless attributes.is_a?(Hash)
347
- self.class.swagger_types.each_pair do |key, type|
348
- if type =~ /\AArray<(.*)>/i
349
- # check to ensure the input is an array given that the attribute
350
- # is documented as an array but the input is not
351
- if attributes[self.class.attribute_map[key]].is_a?(Array)
352
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
353
- end
354
- elsif !attributes[self.class.attribute_map[key]].nil?
355
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
356
- end # or else data not found in attributes(hash), not an issue as the data can be optional
357
- end
358
-
359
- self
360
- end
361
-
362
- # Deserializes the data based on type
363
- # @param string type Data type
364
- # @param string value Value to be deserialized
365
- # @return [Object] Deserialized data
366
- def _deserialize(type, value)
367
- case type.to_sym
368
- when :DateTime
369
- DateTime.parse(value)
370
- when :Date
371
- Date.parse(value)
372
- when :String
373
- value.to_s
374
- when :Integer
375
- value.to_i
376
- when :Float
377
- value.to_f
378
- when :BOOLEAN
379
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
380
- true
381
- else
382
- false
383
- end
384
- when :Object
385
- # generic object (usually a Hash), return directly
386
- value
387
- when /\AArray<(?<inner_type>.+)>\z/
388
- inner_type = Regexp.last_match[:inner_type]
389
- value.map { |v| _deserialize(inner_type, v) }
390
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
391
- k_type = Regexp.last_match[:k_type]
392
- v_type = Regexp.last_match[:v_type]
393
- {}.tap do |hash|
394
- value.each do |k, v|
395
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
396
- end
397
- end
398
- else # model
399
- temp_model = UltracartClient.const_get(type).new
400
- temp_model.build_from_hash(value)
401
- end
402
- end
403
-
404
- # Returns the string representation of the object
405
- # @return [String] String presentation of the object
406
- def to_s
407
- to_hash.to_s
408
- end
409
-
410
- # to_body is an alias to to_hash (backward compatibility)
411
- # @return [Hash] Returns the object in the form of hash
412
- def to_body
413
- to_hash
414
- end
415
-
416
- # Returns the object in the form of hash
417
- # @return [Hash] Returns the object in the form of hash
418
- def to_hash
419
- hash = {}
420
- self.class.attribute_map.each_pair do |attr, param|
421
- value = self.send(attr)
422
- next if value.nil?
423
- hash[param] = _to_hash(value)
424
- end
425
- hash
426
- end
427
-
428
- # Outputs non-array value in the form of hash
429
- # For object, use to_hash. Otherwise, just return the value
430
- # @param [Object] value Any valid value
431
- # @return [Hash] Returns the value in the form of hash
432
- def _to_hash(value)
433
- if value.is_a?(Array)
434
- value.compact.map { |v| _to_hash(v) }
435
- elsif value.is_a?(Hash)
436
- {}.tap do |hash|
437
- value.each { |k, v| hash[k] = _to_hash(v) }
438
- end
439
- elsif value.respond_to? :to_hash
440
- value.to_hash
441
- else
442
- value
443
- end
444
- end
445
-
446
- end
447
- end
@@ -1,202 +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 PaymentsConfigurationRestrictionsTheme
17
- attr_accessor :code
18
-
19
- attr_accessor :restriction
20
-
21
- attr_accessor :store_front_host_name
22
-
23
- # Attribute mapping from ruby-style variable name to JSON key.
24
- def self.attribute_map
25
- {
26
- :'code' => :'code',
27
- :'restriction' => :'restriction',
28
- :'store_front_host_name' => :'storeFrontHostName'
29
- }
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.swagger_types
34
- {
35
- :'code' => :'String',
36
- :'restriction' => :'String',
37
- :'store_front_host_name' => :'String'
38
- }
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- return unless attributes.is_a?(Hash)
45
-
46
- # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
-
49
- if attributes.has_key?(:'code')
50
- self.code = attributes[:'code']
51
- end
52
-
53
- if attributes.has_key?(:'restriction')
54
- self.restriction = attributes[:'restriction']
55
- end
56
-
57
- if attributes.has_key?(:'storeFrontHostName')
58
- self.store_front_host_name = attributes[:'storeFrontHostName']
59
- end
60
- end
61
-
62
- # Show invalid properties with the reasons. Usually used together with valid?
63
- # @return Array for valid properties with the reasons
64
- def list_invalid_properties
65
- invalid_properties = Array.new
66
- invalid_properties
67
- end
68
-
69
- # Check to see if the all the properties in the model are valid
70
- # @return true if the model is valid
71
- def valid?
72
- true
73
- end
74
-
75
- # Checks equality by comparing each attribute.
76
- # @param [Object] Object to be compared
77
- def ==(o)
78
- return true if self.equal?(o)
79
- self.class == o.class &&
80
- code == o.code &&
81
- restriction == o.restriction &&
82
- store_front_host_name == o.store_front_host_name
83
- end
84
-
85
- # @see the `==` method
86
- # @param [Object] Object to be compared
87
- def eql?(o)
88
- self == o
89
- end
90
-
91
- # Calculates hash code according to all attributes.
92
- # @return [Fixnum] Hash code
93
- def hash
94
- [code, restriction, store_front_host_name].hash
95
- end
96
-
97
- # Builds the object from hash
98
- # @param [Hash] attributes Model attributes in the form of hash
99
- # @return [Object] Returns the model itself
100
- def build_from_hash(attributes)
101
- return nil unless attributes.is_a?(Hash)
102
- self.class.swagger_types.each_pair do |key, type|
103
- if type =~ /\AArray<(.*)>/i
104
- # check to ensure the input is an array given that the attribute
105
- # is documented as an array but the input is not
106
- if attributes[self.class.attribute_map[key]].is_a?(Array)
107
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
- end
109
- elsif !attributes[self.class.attribute_map[key]].nil?
110
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
- end # or else data not found in attributes(hash), not an issue as the data can be optional
112
- end
113
-
114
- self
115
- end
116
-
117
- # Deserializes the data based on type
118
- # @param string type Data type
119
- # @param string value Value to be deserialized
120
- # @return [Object] Deserialized data
121
- def _deserialize(type, value)
122
- case type.to_sym
123
- when :DateTime
124
- DateTime.parse(value)
125
- when :Date
126
- Date.parse(value)
127
- when :String
128
- value.to_s
129
- when :Integer
130
- value.to_i
131
- when :Float
132
- value.to_f
133
- when :BOOLEAN
134
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
- true
136
- else
137
- false
138
- end
139
- when :Object
140
- # generic object (usually a Hash), return directly
141
- value
142
- when /\AArray<(?<inner_type>.+)>\z/
143
- inner_type = Regexp.last_match[:inner_type]
144
- value.map { |v| _deserialize(inner_type, v) }
145
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
- k_type = Regexp.last_match[:k_type]
147
- v_type = Regexp.last_match[:v_type]
148
- {}.tap do |hash|
149
- value.each do |k, v|
150
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
- end
152
- end
153
- else # model
154
- temp_model = UltracartClient.const_get(type).new
155
- temp_model.build_from_hash(value)
156
- end
157
- end
158
-
159
- # Returns the string representation of the object
160
- # @return [String] String presentation of the object
161
- def to_s
162
- to_hash.to_s
163
- end
164
-
165
- # to_body is an alias to to_hash (backward compatibility)
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_body
168
- to_hash
169
- end
170
-
171
- # Returns the object in the form of hash
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_hash
174
- hash = {}
175
- self.class.attribute_map.each_pair do |attr, param|
176
- value = self.send(attr)
177
- next if value.nil?
178
- hash[param] = _to_hash(value)
179
- end
180
- hash
181
- end
182
-
183
- # Outputs non-array value in the form of hash
184
- # For object, use to_hash. Otherwise, just return the value
185
- # @param [Object] value Any valid value
186
- # @return [Hash] Returns the value in the form of hash
187
- def _to_hash(value)
188
- if value.is_a?(Array)
189
- value.compact.map { |v| _to_hash(v) }
190
- elsif value.is_a?(Hash)
191
- {}.tap do |hash|
192
- value.each { |k, v| hash[k] = _to_hash(v) }
193
- end
194
- elsif value.respond_to? :to_hash
195
- value.to_hash
196
- else
197
- value
198
- end
199
- end
200
-
201
- end
202
- end