ultracart_api 4.0.54.rc → 4.0.57.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,545 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ItemReview
18
+ # Customer profile object identifier
19
+ attr_accessor :customer_profile_oid
20
+
21
+ attr_accessor :featured
22
+
23
+ attr_accessor :helperful_no_votes
24
+
25
+ attr_accessor :helpful_yes_votes
26
+
27
+ attr_accessor :order_id
28
+
29
+ attr_accessor :overall
30
+
31
+ attr_accessor :rating_name1
32
+
33
+ attr_accessor :rating_name10
34
+
35
+ attr_accessor :rating_name2
36
+
37
+ attr_accessor :rating_name3
38
+
39
+ attr_accessor :rating_name4
40
+
41
+ attr_accessor :rating_name5
42
+
43
+ attr_accessor :rating_name6
44
+
45
+ attr_accessor :rating_name7
46
+
47
+ attr_accessor :rating_name8
48
+
49
+ attr_accessor :rating_name9
50
+
51
+ attr_accessor :rating_score1
52
+
53
+ attr_accessor :rating_score10
54
+
55
+ attr_accessor :rating_score2
56
+
57
+ attr_accessor :rating_score3
58
+
59
+ attr_accessor :rating_score4
60
+
61
+ attr_accessor :rating_score5
62
+
63
+ attr_accessor :rating_score6
64
+
65
+ attr_accessor :rating_score7
66
+
67
+ attr_accessor :rating_score8
68
+
69
+ attr_accessor :rating_score9
70
+
71
+ attr_accessor :recommend_store_to_friend
72
+
73
+ attr_accessor :recommend_to_friend
74
+
75
+ attr_accessor :review
76
+
77
+ attr_accessor :review_oid
78
+
79
+ attr_accessor :reviewed_nickname
80
+
81
+ attr_accessor :reviewer_email
82
+
83
+ attr_accessor :reviewer_location
84
+
85
+ attr_accessor :status
86
+
87
+ attr_accessor :store_feedback
88
+
89
+ # Date/time of review submission
90
+ attr_accessor :submitted_dts
91
+
92
+ attr_accessor :title
93
+
94
+ # Attribute mapping from ruby-style variable name to JSON key.
95
+ def self.attribute_map
96
+ {
97
+ :'customer_profile_oid' => :'customer_profile_oid',
98
+ :'featured' => :'featured',
99
+ :'helperful_no_votes' => :'helperful_no_votes',
100
+ :'helpful_yes_votes' => :'helpful_yes_votes',
101
+ :'order_id' => :'order_id',
102
+ :'overall' => :'overall',
103
+ :'rating_name1' => :'rating_name1',
104
+ :'rating_name10' => :'rating_name10',
105
+ :'rating_name2' => :'rating_name2',
106
+ :'rating_name3' => :'rating_name3',
107
+ :'rating_name4' => :'rating_name4',
108
+ :'rating_name5' => :'rating_name5',
109
+ :'rating_name6' => :'rating_name6',
110
+ :'rating_name7' => :'rating_name7',
111
+ :'rating_name8' => :'rating_name8',
112
+ :'rating_name9' => :'rating_name9',
113
+ :'rating_score1' => :'rating_score1',
114
+ :'rating_score10' => :'rating_score10',
115
+ :'rating_score2' => :'rating_score2',
116
+ :'rating_score3' => :'rating_score3',
117
+ :'rating_score4' => :'rating_score4',
118
+ :'rating_score5' => :'rating_score5',
119
+ :'rating_score6' => :'rating_score6',
120
+ :'rating_score7' => :'rating_score7',
121
+ :'rating_score8' => :'rating_score8',
122
+ :'rating_score9' => :'rating_score9',
123
+ :'recommend_store_to_friend' => :'recommend_store_to_friend',
124
+ :'recommend_to_friend' => :'recommend_to_friend',
125
+ :'review' => :'review',
126
+ :'review_oid' => :'review_oid',
127
+ :'reviewed_nickname' => :'reviewed_nickname',
128
+ :'reviewer_email' => :'reviewer_email',
129
+ :'reviewer_location' => :'reviewer_location',
130
+ :'status' => :'status',
131
+ :'store_feedback' => :'store_feedback',
132
+ :'submitted_dts' => :'submitted_dts',
133
+ :'title' => :'title'
134
+ }
135
+ end
136
+
137
+ # Returns all the JSON keys this model knows about
138
+ def self.acceptable_attributes
139
+ attribute_map.values
140
+ end
141
+
142
+ # Attribute type mapping.
143
+ def self.openapi_types
144
+ {
145
+ :'customer_profile_oid' => :'Integer',
146
+ :'featured' => :'Boolean',
147
+ :'helperful_no_votes' => :'Integer',
148
+ :'helpful_yes_votes' => :'Integer',
149
+ :'order_id' => :'String',
150
+ :'overall' => :'Float',
151
+ :'rating_name1' => :'String',
152
+ :'rating_name10' => :'String',
153
+ :'rating_name2' => :'String',
154
+ :'rating_name3' => :'String',
155
+ :'rating_name4' => :'String',
156
+ :'rating_name5' => :'String',
157
+ :'rating_name6' => :'String',
158
+ :'rating_name7' => :'String',
159
+ :'rating_name8' => :'String',
160
+ :'rating_name9' => :'String',
161
+ :'rating_score1' => :'Float',
162
+ :'rating_score10' => :'Float',
163
+ :'rating_score2' => :'Float',
164
+ :'rating_score3' => :'Float',
165
+ :'rating_score4' => :'Float',
166
+ :'rating_score5' => :'Float',
167
+ :'rating_score6' => :'Float',
168
+ :'rating_score7' => :'Float',
169
+ :'rating_score8' => :'Float',
170
+ :'rating_score9' => :'Float',
171
+ :'recommend_store_to_friend' => :'Integer',
172
+ :'recommend_to_friend' => :'Boolean',
173
+ :'review' => :'String',
174
+ :'review_oid' => :'Integer',
175
+ :'reviewed_nickname' => :'String',
176
+ :'reviewer_email' => :'String',
177
+ :'reviewer_location' => :'String',
178
+ :'status' => :'String',
179
+ :'store_feedback' => :'String',
180
+ :'submitted_dts' => :'String',
181
+ :'title' => :'String'
182
+ }
183
+ end
184
+
185
+ # List of attributes with nullable: true
186
+ def self.openapi_nullable
187
+ Set.new([
188
+ ])
189
+ end
190
+
191
+ # Initializes the object
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ def initialize(attributes = {})
194
+ if (!attributes.is_a?(Hash))
195
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ItemReview` initialize method"
196
+ end
197
+
198
+ # check to see if the attribute exists and convert string to symbol for hash key
199
+ attributes = attributes.each_with_object({}) { |(k, v), h|
200
+ if (!self.class.attribute_map.key?(k.to_sym))
201
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ItemReview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
202
+ end
203
+ h[k.to_sym] = v
204
+ }
205
+
206
+ if attributes.key?(:'customer_profile_oid')
207
+ self.customer_profile_oid = attributes[:'customer_profile_oid']
208
+ end
209
+
210
+ if attributes.key?(:'featured')
211
+ self.featured = attributes[:'featured']
212
+ end
213
+
214
+ if attributes.key?(:'helperful_no_votes')
215
+ self.helperful_no_votes = attributes[:'helperful_no_votes']
216
+ end
217
+
218
+ if attributes.key?(:'helpful_yes_votes')
219
+ self.helpful_yes_votes = attributes[:'helpful_yes_votes']
220
+ end
221
+
222
+ if attributes.key?(:'order_id')
223
+ self.order_id = attributes[:'order_id']
224
+ end
225
+
226
+ if attributes.key?(:'overall')
227
+ self.overall = attributes[:'overall']
228
+ end
229
+
230
+ if attributes.key?(:'rating_name1')
231
+ self.rating_name1 = attributes[:'rating_name1']
232
+ end
233
+
234
+ if attributes.key?(:'rating_name10')
235
+ self.rating_name10 = attributes[:'rating_name10']
236
+ end
237
+
238
+ if attributes.key?(:'rating_name2')
239
+ self.rating_name2 = attributes[:'rating_name2']
240
+ end
241
+
242
+ if attributes.key?(:'rating_name3')
243
+ self.rating_name3 = attributes[:'rating_name3']
244
+ end
245
+
246
+ if attributes.key?(:'rating_name4')
247
+ self.rating_name4 = attributes[:'rating_name4']
248
+ end
249
+
250
+ if attributes.key?(:'rating_name5')
251
+ self.rating_name5 = attributes[:'rating_name5']
252
+ end
253
+
254
+ if attributes.key?(:'rating_name6')
255
+ self.rating_name6 = attributes[:'rating_name6']
256
+ end
257
+
258
+ if attributes.key?(:'rating_name7')
259
+ self.rating_name7 = attributes[:'rating_name7']
260
+ end
261
+
262
+ if attributes.key?(:'rating_name8')
263
+ self.rating_name8 = attributes[:'rating_name8']
264
+ end
265
+
266
+ if attributes.key?(:'rating_name9')
267
+ self.rating_name9 = attributes[:'rating_name9']
268
+ end
269
+
270
+ if attributes.key?(:'rating_score1')
271
+ self.rating_score1 = attributes[:'rating_score1']
272
+ end
273
+
274
+ if attributes.key?(:'rating_score10')
275
+ self.rating_score10 = attributes[:'rating_score10']
276
+ end
277
+
278
+ if attributes.key?(:'rating_score2')
279
+ self.rating_score2 = attributes[:'rating_score2']
280
+ end
281
+
282
+ if attributes.key?(:'rating_score3')
283
+ self.rating_score3 = attributes[:'rating_score3']
284
+ end
285
+
286
+ if attributes.key?(:'rating_score4')
287
+ self.rating_score4 = attributes[:'rating_score4']
288
+ end
289
+
290
+ if attributes.key?(:'rating_score5')
291
+ self.rating_score5 = attributes[:'rating_score5']
292
+ end
293
+
294
+ if attributes.key?(:'rating_score6')
295
+ self.rating_score6 = attributes[:'rating_score6']
296
+ end
297
+
298
+ if attributes.key?(:'rating_score7')
299
+ self.rating_score7 = attributes[:'rating_score7']
300
+ end
301
+
302
+ if attributes.key?(:'rating_score8')
303
+ self.rating_score8 = attributes[:'rating_score8']
304
+ end
305
+
306
+ if attributes.key?(:'rating_score9')
307
+ self.rating_score9 = attributes[:'rating_score9']
308
+ end
309
+
310
+ if attributes.key?(:'recommend_store_to_friend')
311
+ self.recommend_store_to_friend = attributes[:'recommend_store_to_friend']
312
+ end
313
+
314
+ if attributes.key?(:'recommend_to_friend')
315
+ self.recommend_to_friend = attributes[:'recommend_to_friend']
316
+ end
317
+
318
+ if attributes.key?(:'review')
319
+ self.review = attributes[:'review']
320
+ end
321
+
322
+ if attributes.key?(:'review_oid')
323
+ self.review_oid = attributes[:'review_oid']
324
+ end
325
+
326
+ if attributes.key?(:'reviewed_nickname')
327
+ self.reviewed_nickname = attributes[:'reviewed_nickname']
328
+ end
329
+
330
+ if attributes.key?(:'reviewer_email')
331
+ self.reviewer_email = attributes[:'reviewer_email']
332
+ end
333
+
334
+ if attributes.key?(:'reviewer_location')
335
+ self.reviewer_location = attributes[:'reviewer_location']
336
+ end
337
+
338
+ if attributes.key?(:'status')
339
+ self.status = attributes[:'status']
340
+ end
341
+
342
+ if attributes.key?(:'store_feedback')
343
+ self.store_feedback = attributes[:'store_feedback']
344
+ end
345
+
346
+ if attributes.key?(:'submitted_dts')
347
+ self.submitted_dts = attributes[:'submitted_dts']
348
+ end
349
+
350
+ if attributes.key?(:'title')
351
+ self.title = attributes[:'title']
352
+ end
353
+ end
354
+
355
+ # Show invalid properties with the reasons. Usually used together with valid?
356
+ # @return Array for valid properties with the reasons
357
+ def list_invalid_properties
358
+ invalid_properties = Array.new
359
+ invalid_properties
360
+ end
361
+
362
+ # Check to see if the all the properties in the model are valid
363
+ # @return true if the model is valid
364
+ def valid?
365
+ true
366
+ end
367
+
368
+ # Checks equality by comparing each attribute.
369
+ # @param [Object] Object to be compared
370
+ def ==(o)
371
+ return true if self.equal?(o)
372
+ self.class == o.class &&
373
+ customer_profile_oid == o.customer_profile_oid &&
374
+ featured == o.featured &&
375
+ helperful_no_votes == o.helperful_no_votes &&
376
+ helpful_yes_votes == o.helpful_yes_votes &&
377
+ order_id == o.order_id &&
378
+ overall == o.overall &&
379
+ rating_name1 == o.rating_name1 &&
380
+ rating_name10 == o.rating_name10 &&
381
+ rating_name2 == o.rating_name2 &&
382
+ rating_name3 == o.rating_name3 &&
383
+ rating_name4 == o.rating_name4 &&
384
+ rating_name5 == o.rating_name5 &&
385
+ rating_name6 == o.rating_name6 &&
386
+ rating_name7 == o.rating_name7 &&
387
+ rating_name8 == o.rating_name8 &&
388
+ rating_name9 == o.rating_name9 &&
389
+ rating_score1 == o.rating_score1 &&
390
+ rating_score10 == o.rating_score10 &&
391
+ rating_score2 == o.rating_score2 &&
392
+ rating_score3 == o.rating_score3 &&
393
+ rating_score4 == o.rating_score4 &&
394
+ rating_score5 == o.rating_score5 &&
395
+ rating_score6 == o.rating_score6 &&
396
+ rating_score7 == o.rating_score7 &&
397
+ rating_score8 == o.rating_score8 &&
398
+ rating_score9 == o.rating_score9 &&
399
+ recommend_store_to_friend == o.recommend_store_to_friend &&
400
+ recommend_to_friend == o.recommend_to_friend &&
401
+ review == o.review &&
402
+ review_oid == o.review_oid &&
403
+ reviewed_nickname == o.reviewed_nickname &&
404
+ reviewer_email == o.reviewer_email &&
405
+ reviewer_location == o.reviewer_location &&
406
+ status == o.status &&
407
+ store_feedback == o.store_feedback &&
408
+ submitted_dts == o.submitted_dts &&
409
+ title == o.title
410
+ end
411
+
412
+ # @see the `==` method
413
+ # @param [Object] Object to be compared
414
+ def eql?(o)
415
+ self == o
416
+ end
417
+
418
+ # Calculates hash code according to all attributes.
419
+ # @return [Integer] Hash code
420
+ def hash
421
+ [customer_profile_oid, featured, helperful_no_votes, helpful_yes_votes, order_id, overall, rating_name1, rating_name10, rating_name2, rating_name3, rating_name4, rating_name5, rating_name6, rating_name7, rating_name8, rating_name9, rating_score1, rating_score10, rating_score2, rating_score3, rating_score4, rating_score5, rating_score6, rating_score7, rating_score8, rating_score9, recommend_store_to_friend, recommend_to_friend, review, review_oid, reviewed_nickname, reviewer_email, reviewer_location, status, store_feedback, submitted_dts, title].hash
422
+ end
423
+
424
+ # Builds the object from hash
425
+ # @param [Hash] attributes Model attributes in the form of hash
426
+ # @return [Object] Returns the model itself
427
+ def self.build_from_hash(attributes)
428
+ new.build_from_hash(attributes)
429
+ end
430
+
431
+ # Builds the object from hash
432
+ # @param [Hash] attributes Model attributes in the form of hash
433
+ # @return [Object] Returns the model itself
434
+ def build_from_hash(attributes)
435
+ return nil unless attributes.is_a?(Hash)
436
+ attributes = attributes.transform_keys(&:to_sym)
437
+ self.class.openapi_types.each_pair do |key, type|
438
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
439
+ self.send("#{key}=", nil)
440
+ elsif type =~ /\AArray<(.*)>/i
441
+ # check to ensure the input is an array given that the attribute
442
+ # is documented as an array but the input is not
443
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
444
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
445
+ end
446
+ elsif !attributes[self.class.attribute_map[key]].nil?
447
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
448
+ end
449
+ end
450
+
451
+ self
452
+ end
453
+
454
+ # Deserializes the data based on type
455
+ # @param string type Data type
456
+ # @param string value Value to be deserialized
457
+ # @return [Object] Deserialized data
458
+ def _deserialize(type, value)
459
+ case type.to_sym
460
+ when :Time
461
+ Time.parse(value)
462
+ when :Date
463
+ Date.parse(value)
464
+ when :String
465
+ value.to_s
466
+ when :Integer
467
+ value.to_i
468
+ when :Float
469
+ value.to_f
470
+ when :Boolean
471
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
472
+ true
473
+ else
474
+ false
475
+ end
476
+ when :Object
477
+ # generic object (usually a Hash), return directly
478
+ value
479
+ when /\AArray<(?<inner_type>.+)>\z/
480
+ inner_type = Regexp.last_match[:inner_type]
481
+ value.map { |v| _deserialize(inner_type, v) }
482
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
483
+ k_type = Regexp.last_match[:k_type]
484
+ v_type = Regexp.last_match[:v_type]
485
+ {}.tap do |hash|
486
+ value.each do |k, v|
487
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
488
+ end
489
+ end
490
+ else # model
491
+ # models (e.g. Pet) or oneOf
492
+ klass = UltracartClient.const_get(type)
493
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
494
+ end
495
+ end
496
+
497
+ # Returns the string representation of the object
498
+ # @return [String] String presentation of the object
499
+ def to_s
500
+ to_hash.to_s
501
+ end
502
+
503
+ # to_body is an alias to to_hash (backward compatibility)
504
+ # @return [Hash] Returns the object in the form of hash
505
+ def to_body
506
+ to_hash
507
+ end
508
+
509
+ # Returns the object in the form of hash
510
+ # @return [Hash] Returns the object in the form of hash
511
+ def to_hash
512
+ hash = {}
513
+ self.class.attribute_map.each_pair do |attr, param|
514
+ value = self.send(attr)
515
+ if value.nil?
516
+ is_nullable = self.class.openapi_nullable.include?(attr)
517
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
518
+ end
519
+
520
+ hash[param] = _to_hash(value)
521
+ end
522
+ hash
523
+ end
524
+
525
+ # Outputs non-array value in the form of hash
526
+ # For object, use to_hash. Otherwise, just return the value
527
+ # @param [Object] value Any valid value
528
+ # @return [Hash] Returns the value in the form of hash
529
+ def _to_hash(value)
530
+ if value.is_a?(Array)
531
+ value.compact.map { |v| _to_hash(v) }
532
+ elsif value.is_a?(Hash)
533
+ {}.tap do |hash|
534
+ value.each { |k, v| hash[k] = _to_hash(v) }
535
+ end
536
+ elsif value.respond_to? :to_hash
537
+ value.to_hash
538
+ else
539
+ value
540
+ end
541
+ end
542
+
543
+ end
544
+
545
+ end
@@ -21,6 +21,8 @@ module UltracartClient
21
21
  # True if the item has a review
22
22
  attr_accessor :has_review
23
23
 
24
+ attr_accessor :individual_reviews
25
+
24
26
  # Number of approved reviews
25
27
  attr_accessor :review_count
26
28
 
@@ -47,6 +49,7 @@ module UltracartClient
47
49
  {
48
50
  :'has_approved_review' => :'has_approved_review',
49
51
  :'has_review' => :'has_review',
52
+ :'individual_reviews' => :'individual_reviews',
50
53
  :'review_count' => :'review_count',
51
54
  :'review_overall' => :'review_overall',
52
55
  :'review_template_name' => :'review_template_name',
@@ -67,6 +70,7 @@ module UltracartClient
67
70
  {
68
71
  :'has_approved_review' => :'Boolean',
69
72
  :'has_review' => :'Boolean',
73
+ :'individual_reviews' => :'Array<ItemReview>',
70
74
  :'review_count' => :'Integer',
71
75
  :'review_overall' => :'Float',
72
76
  :'review_template_name' => :'String',
@@ -106,6 +110,12 @@ module UltracartClient
106
110
  self.has_review = attributes[:'has_review']
107
111
  end
108
112
 
113
+ if attributes.key?(:'individual_reviews')
114
+ if (value = attributes[:'individual_reviews']).is_a?(Array)
115
+ self.individual_reviews = value
116
+ end
117
+ end
118
+
109
119
  if attributes.key?(:'review_count')
110
120
  self.review_count = attributes[:'review_count']
111
121
  end
@@ -155,6 +165,7 @@ module UltracartClient
155
165
  self.class == o.class &&
156
166
  has_approved_review == o.has_approved_review &&
157
167
  has_review == o.has_review &&
168
+ individual_reviews == o.individual_reviews &&
158
169
  review_count == o.review_count &&
159
170
  review_overall == o.review_overall &&
160
171
  review_template_name == o.review_template_name &&
@@ -173,7 +184,7 @@ module UltracartClient
173
184
  # Calculates hash code according to all attributes.
174
185
  # @return [Integer] Hash code
175
186
  def hash
176
- [has_approved_review, has_review, review_count, review_overall, review_template_name, review_template_oid, reviewable, share_reviews_with_merchant_item_id, share_reviews_with_merchant_item_oid].hash
187
+ [has_approved_review, has_review, individual_reviews, review_count, review_overall, review_template_name, review_template_oid, reviewable, share_reviews_with_merchant_item_id, share_reviews_with_merchant_item_oid].hash
177
188
  end
178
189
 
179
190
  # Builds the object from hash