Class: UltracartClient::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/models/item.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Item

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/ultracart_api/models/item.rb', line 255

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'accounting')
    self.accounting = attributes[:'accounting']
  end

  if attributes.has_key?(:'amember')
    self.amember = attributes[:'amember']
  end

  if attributes.has_key?(:'auto_order')
    self.auto_order = attributes[:'auto_order']
  end

  if attributes.has_key?(:'ccbill')
    self.ccbill = attributes[:'ccbill']
  end

  if attributes.has_key?(:'channel_partner_item_mappings')
    if (value = attributes[:'channel_partner_item_mappings']).is_a?(Array)
      self.channel_partner_item_mappings = value
    end
  end

  if attributes.has_key?(:'chargeback')
    self.chargeback = attributes[:'chargeback']
  end

  if attributes.has_key?(:'checkout')
    self.checkout = attributes[:'checkout']
  end

  if attributes.has_key?(:'content')
    self.content = attributes[:'content']
  end

  if attributes.has_key?(:'creation_dts')
    self.creation_dts = attributes[:'creation_dts']
  end

  if attributes.has_key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.has_key?(:'description_translated_text_instance_oid')
    self.description_translated_text_instance_oid = attributes[:'description_translated_text_instance_oid']
  end

  if attributes.has_key?(:'digital_delivery')
    self.digital_delivery = attributes[:'digital_delivery']
  end

  if attributes.has_key?(:'ebay')
    self.ebay = attributes[:'ebay']
  end

  if attributes.has_key?(:'email_notifications')
    self.email_notifications = attributes[:'email_notifications']
  end

  if attributes.has_key?(:'enrollment123')
    self.enrollment123 = attributes[:'enrollment123']
  end

  if attributes.has_key?(:'fulfillment_addons')
    if (value = attributes[:'fulfillment_addons']).is_a?(Array)
      self.fulfillment_addons = value
    end
  end

  if attributes.has_key?(:'gift_certificate')
    self.gift_certificate = attributes[:'gift_certificate']
  end

  if attributes.has_key?(:'google_product_search')
    self.google_product_search = attributes[:'google_product_search']
  end

  if attributes.has_key?(:'identifiers')
    self.identifiers = attributes[:'identifiers']
  end

  if attributes.has_key?(:'inactive')
    self.inactive = attributes[:'inactive']
  end

  if attributes.has_key?(:'instant_payment_notifications')
    self.instant_payment_notifications = attributes[:'instant_payment_notifications']
  end

  if attributes.has_key?(:'internal')
    self.internal = attributes[:'internal']
  end

  if attributes.has_key?(:'kit')
    self.kit = attributes[:'kit']
  end

  if attributes.has_key?(:'kit_component_only')
    self.kit_component_only = attributes[:'kit_component_only']
  end

  if attributes.has_key?(:'kit_definition')
    self.kit_definition = attributes[:'kit_definition']
  end

  if attributes.has_key?(:'last_modified_dts')
    self.last_modified_dts = attributes[:'last_modified_dts']
  end

  if attributes.has_key?(:'merchant_id')
    self.merchant_id = attributes[:'merchant_id']
  end

  if attributes.has_key?(:'merchant_item_id')
    self.merchant_item_id = attributes[:'merchant_item_id']
  end

  if attributes.has_key?(:'merchant_item_oid')
    self.merchant_item_oid = attributes[:'merchant_item_oid']
  end

  if attributes.has_key?(:'options')
    if (value = attributes[:'options']).is_a?(Array)
      self.options = value
    end
  end

  if attributes.has_key?(:'parent_category_id')
    self.parent_category_id = attributes[:'parent_category_id']
  end

  if attributes.has_key?(:'parent_category_path')
    self.parent_category_path = attributes[:'parent_category_path']
  end

  if attributes.has_key?(:'payment_processing')
    self.payment_processing = attributes[:'payment_processing']
  end

  if attributes.has_key?(:'physical')
    self.physical = attributes[:'physical']
  end

  if attributes.has_key?(:'pricing')
    self.pricing = attributes[:'pricing']
  end

  if attributes.has_key?(:'properties')
    if (value = attributes[:'properties']).is_a?(Array)
      self.properties = value
    end
  end

  if attributes.has_key?(:'realtime_pricing')
    self.realtime_pricing = attributes[:'realtime_pricing']
  end

  if attributes.has_key?(:'recommend_replenishment_days')
    self.recommend_replenishment_days = attributes[:'recommend_replenishment_days']
  end

  if attributes.has_key?(:'related')
    self.related = attributes[:'related']
  end

  if attributes.has_key?(:'reporting')
    self.reporting = attributes[:'reporting']
  end

  if attributes.has_key?(:'restriction')
    self.restriction = attributes[:'restriction']
  end

  if attributes.has_key?(:'revguard')
    self.revguard = attributes[:'revguard']
  end

  if attributes.has_key?(:'reviews')
    self.reviews = attributes[:'reviews']
  end

  if attributes.has_key?(:'salesforce')
    self.salesforce = attributes[:'salesforce']
  end

  if attributes.has_key?(:'shipping')
    self.shipping = attributes[:'shipping']
  end

  if attributes.has_key?(:'tags')
    self.tags = attributes[:'tags']
  end

  if attributes.has_key?(:'tax')
    self.tax = attributes[:'tax']
  end

  if attributes.has_key?(:'third_party_email_marketing')
    if (value = attributes[:'third_party_email_marketing']).is_a?(Array)
      self.third_party_email_marketing = value
    end
  end

  if attributes.has_key?(:'variant_items')
    if (value = attributes[:'variant_items']).is_a?(Array)
      self.variant_items = value
    end
  end

  if attributes.has_key?(:'variations')
    if (value = attributes[:'variations']).is_a?(Array)
      self.variations = value
    end
  end

  if attributes.has_key?(:'wishlist_member')
    self.wishlist_member = attributes[:'wishlist_member']
  end
end

Instance Attribute Details

#accountingObject

Returns the value of attribute accounting.



17
18
19
# File 'lib/ultracart_api/models/item.rb', line 17

def accounting
  @accounting
end

#amemberObject

Returns the value of attribute amember.



19
20
21
# File 'lib/ultracart_api/models/item.rb', line 19

def amember
  @amember
end

#auto_orderObject

Returns the value of attribute auto_order.



21
22
23
# File 'lib/ultracart_api/models/item.rb', line 21

def auto_order
  @auto_order
end

#ccbillObject

Returns the value of attribute ccbill.



23
24
25
# File 'lib/ultracart_api/models/item.rb', line 23

def ccbill
  @ccbill
end

#channel_partner_item_mappingsObject

Channel Partner Item Mapping



26
27
28
# File 'lib/ultracart_api/models/item.rb', line 26

def channel_partner_item_mappings
  @channel_partner_item_mappings
end

#chargebackObject

Returns the value of attribute chargeback.



28
29
30
# File 'lib/ultracart_api/models/item.rb', line 28

def chargeback
  @chargeback
end

#checkoutObject

Returns the value of attribute checkout.



30
31
32
# File 'lib/ultracart_api/models/item.rb', line 30

def checkout
  @checkout
end

#contentObject

Returns the value of attribute content.



32
33
34
# File 'lib/ultracart_api/models/item.rb', line 32

def content
  @content
end

#creation_dtsObject

Date/time of creation



35
36
37
# File 'lib/ultracart_api/models/item.rb', line 35

def creation_dts
  @creation_dts
end

#descriptionObject

Description of the item up to 500 characters.



38
39
40
# File 'lib/ultracart_api/models/item.rb', line 38

def description
  @description
end

#description_translated_text_instance_oidObject

Description translated text instance id



41
42
43
# File 'lib/ultracart_api/models/item.rb', line 41

def description_translated_text_instance_oid
  @description_translated_text_instance_oid
end

#digital_deliveryObject

Returns the value of attribute digital_delivery.



43
44
45
# File 'lib/ultracart_api/models/item.rb', line 43

def digital_delivery
  @digital_delivery
end

#ebayObject

Returns the value of attribute ebay.



45
46
47
# File 'lib/ultracart_api/models/item.rb', line 45

def ebay
  @ebay
end

#email_notificationsObject

Returns the value of attribute email_notifications.



47
48
49
# File 'lib/ultracart_api/models/item.rb', line 47

def email_notifications
  @email_notifications
end

#enrollment123Object

Returns the value of attribute enrollment123.



49
50
51
# File 'lib/ultracart_api/models/item.rb', line 49

def enrollment123
  @enrollment123
end

#fulfillment_addonsObject

Fulfillment Add-ons



52
53
54
# File 'lib/ultracart_api/models/item.rb', line 52

def fulfillment_addons
  @fulfillment_addons
end

#gift_certificateObject

Returns the value of attribute gift_certificate.



54
55
56
# File 'lib/ultracart_api/models/item.rb', line 54

def gift_certificate
  @gift_certificate
end

#google_product_searchObject

Returns the value of attribute google_product_search.



56
57
58
# File 'lib/ultracart_api/models/item.rb', line 56

def google_product_search
  @google_product_search
end

#identifiersObject

Returns the value of attribute identifiers.



58
59
60
# File 'lib/ultracart_api/models/item.rb', line 58

def identifiers
  @identifiers
end

#inactiveObject

True if this item is inactive and can not be purchased



61
62
63
# File 'lib/ultracart_api/models/item.rb', line 61

def inactive
  @inactive
end

#instant_payment_notificationsObject

Returns the value of attribute instant_payment_notifications.



63
64
65
# File 'lib/ultracart_api/models/item.rb', line 63

def instant_payment_notifications
  @instant_payment_notifications
end

#internalObject

Returns the value of attribute internal.



65
66
67
# File 'lib/ultracart_api/models/item.rb', line 65

def internal
  @internal
end

#kitObject

True if this item is a kit



68
69
70
# File 'lib/ultracart_api/models/item.rb', line 68

def kit
  @kit
end

#kit_component_onlyObject

True if this item can only be usd as a kit component



71
72
73
# File 'lib/ultracart_api/models/item.rb', line 71

def kit_component_only
  @kit_component_only
end

#kit_definitionObject

Returns the value of attribute kit_definition.



73
74
75
# File 'lib/ultracart_api/models/item.rb', line 73

def kit_definition
  @kit_definition
end

#last_modified_dtsObject

Date/time of last modification



76
77
78
# File 'lib/ultracart_api/models/item.rb', line 76

def last_modified_dts
  @last_modified_dts
end

#merchant_idObject

UltraCart merchant ID owning item



79
80
81
# File 'lib/ultracart_api/models/item.rb', line 79

def merchant_id
  @merchant_id
end

#merchant_item_idObject

Unique item id assigned to this item



82
83
84
# File 'lib/ultracart_api/models/item.rb', line 82

def merchant_item_id
  @merchant_item_id
end

#merchant_item_oidObject

Unique object identifier for this item



85
86
87
# File 'lib/ultracart_api/models/item.rb', line 85

def merchant_item_oid
  @merchant_item_oid
end

#optionsObject

Options



88
89
90
# File 'lib/ultracart_api/models/item.rb', line 88

def options
  @options
end

#parent_category_idObject

Parent category of the item. Zero indicates the root folder.



91
92
93
# File 'lib/ultracart_api/models/item.rb', line 91

def parent_category_id
  @parent_category_id
end

#parent_category_pathObject

Parent category path. / indicates the root folder.



94
95
96
# File 'lib/ultracart_api/models/item.rb', line 94

def parent_category_path
  @parent_category_path
end

#payment_processingObject

Returns the value of attribute payment_processing.



96
97
98
# File 'lib/ultracart_api/models/item.rb', line 96

def payment_processing
  @payment_processing
end

#physicalObject

Returns the value of attribute physical.



98
99
100
# File 'lib/ultracart_api/models/item.rb', line 98

def physical
  @physical
end

#pricingObject

Returns the value of attribute pricing.



100
101
102
# File 'lib/ultracart_api/models/item.rb', line 100

def pricing
  @pricing
end

#propertiesObject

Properties



103
104
105
# File 'lib/ultracart_api/models/item.rb', line 103

def properties
  @properties
end

#realtime_pricingObject

Returns the value of attribute realtime_pricing.



105
106
107
# File 'lib/ultracart_api/models/item.rb', line 105

def realtime_pricing
  @realtime_pricing
end

#recommend_replenishment_daysObject

Number of days to recommend replenishment after. Null is not configured. Set to zero to disable.



108
109
110
# File 'lib/ultracart_api/models/item.rb', line 108

def recommend_replenishment_days
  @recommend_replenishment_days
end

Returns the value of attribute related.



110
111
112
# File 'lib/ultracart_api/models/item.rb', line 110

def related
  @related
end

#reportingObject

Returns the value of attribute reporting.



112
113
114
# File 'lib/ultracart_api/models/item.rb', line 112

def reporting
  @reporting
end

#restrictionObject

Returns the value of attribute restriction.



114
115
116
# File 'lib/ultracart_api/models/item.rb', line 114

def restriction
  @restriction
end

#revguardObject

Returns the value of attribute revguard.



116
117
118
# File 'lib/ultracart_api/models/item.rb', line 116

def revguard
  @revguard
end

#reviewsObject

Returns the value of attribute reviews.



118
119
120
# File 'lib/ultracart_api/models/item.rb', line 118

def reviews
  @reviews
end

#salesforceObject

Returns the value of attribute salesforce.



120
121
122
# File 'lib/ultracart_api/models/item.rb', line 120

def salesforce
  @salesforce
end

#shippingObject

Returns the value of attribute shipping.



122
123
124
# File 'lib/ultracart_api/models/item.rb', line 122

def shipping
  @shipping
end

#tagsObject

Returns the value of attribute tags.



124
125
126
# File 'lib/ultracart_api/models/item.rb', line 124

def tags
  @tags
end

#taxObject

Returns the value of attribute tax.



126
127
128
# File 'lib/ultracart_api/models/item.rb', line 126

def tax
  @tax
end

#third_party_email_marketingObject

3rd Party Email Marketing



129
130
131
# File 'lib/ultracart_api/models/item.rb', line 129

def third_party_email_marketing
  @third_party_email_marketing
end

#variant_itemsObject

Variant Items



132
133
134
# File 'lib/ultracart_api/models/item.rb', line 132

def variant_items
  @variant_items
end

#variationsObject

Variations



135
136
137
# File 'lib/ultracart_api/models/item.rb', line 135

def variations
  @variations
end

#wishlist_memberObject

Returns the value of attribute wishlist_member.



137
138
139
# File 'lib/ultracart_api/models/item.rb', line 137

def wishlist_member
  @wishlist_member
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/ultracart_api/models/item.rb', line 140

def self.attribute_map
  {
    :'accounting' => :'accounting',
    :'amember' => :'amember',
    :'auto_order' => :'auto_order',
    :'ccbill' => :'ccbill',
    :'channel_partner_item_mappings' => :'channel_partner_item_mappings',
    :'chargeback' => :'chargeback',
    :'checkout' => :'checkout',
    :'content' => :'content',
    :'creation_dts' => :'creation_dts',
    :'description' => :'description',
    :'description_translated_text_instance_oid' => :'description_translated_text_instance_oid',
    :'digital_delivery' => :'digital_delivery',
    :'ebay' => :'ebay',
    :'email_notifications' => :'email_notifications',
    :'enrollment123' => :'enrollment123',
    :'fulfillment_addons' => :'fulfillment_addons',
    :'gift_certificate' => :'gift_certificate',
    :'google_product_search' => :'google_product_search',
    :'identifiers' => :'identifiers',
    :'inactive' => :'inactive',
    :'instant_payment_notifications' => :'instant_payment_notifications',
    :'internal' => :'internal',
    :'kit' => :'kit',
    :'kit_component_only' => :'kit_component_only',
    :'kit_definition' => :'kit_definition',
    :'last_modified_dts' => :'last_modified_dts',
    :'merchant_id' => :'merchant_id',
    :'merchant_item_id' => :'merchant_item_id',
    :'merchant_item_oid' => :'merchant_item_oid',
    :'options' => :'options',
    :'parent_category_id' => :'parent_category_id',
    :'parent_category_path' => :'parent_category_path',
    :'payment_processing' => :'payment_processing',
    :'physical' => :'physical',
    :'pricing' => :'pricing',
    :'properties' => :'properties',
    :'realtime_pricing' => :'realtime_pricing',
    :'recommend_replenishment_days' => :'recommend_replenishment_days',
    :'related' => :'related',
    :'reporting' => :'reporting',
    :'restriction' => :'restriction',
    :'revguard' => :'revguard',
    :'reviews' => :'reviews',
    :'salesforce' => :'salesforce',
    :'shipping' => :'shipping',
    :'tags' => :'tags',
    :'tax' => :'tax',
    :'third_party_email_marketing' => :'third_party_email_marketing',
    :'variant_items' => :'variant_items',
    :'variations' => :'variations',
    :'wishlist_member' => :'wishlist_member'
  }
end

.swagger_typesObject

Attribute type mapping.



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/ultracart_api/models/item.rb', line 197

def self.swagger_types
  {
    :'accounting' => :'ItemAccounting',
    :'amember' => :'ItemAmember',
    :'auto_order' => :'ItemAutoOrder',
    :'ccbill' => :'ItemCCBill',
    :'channel_partner_item_mappings' => :'Array<ItemChannelPartnerMapping>',
    :'chargeback' => :'ItemChargeback',
    :'checkout' => :'ItemCheckout',
    :'content' => :'ItemContent',
    :'creation_dts' => :'String',
    :'description' => :'String',
    :'description_translated_text_instance_oid' => :'Integer',
    :'digital_delivery' => :'ItemDigitalDelivery',
    :'ebay' => :'ItemEbay',
    :'email_notifications' => :'ItemEmailNotifications',
    :'enrollment123' => :'ItemEnrollment123',
    :'fulfillment_addons' => :'Array<ItemFulfillmentAddon>',
    :'gift_certificate' => :'ItemGiftCertificate',
    :'google_product_search' => :'ItemGoogleProductSearch',
    :'identifiers' => :'ItemIdentifiers',
    :'inactive' => :'BOOLEAN',
    :'instant_payment_notifications' => :'ItemInstantPaymentNotifications',
    :'internal' => :'ItemInternal',
    :'kit' => :'BOOLEAN',
    :'kit_component_only' => :'BOOLEAN',
    :'kit_definition' => :'ItemKitDefinition',
    :'last_modified_dts' => :'String',
    :'merchant_id' => :'String',
    :'merchant_item_id' => :'String',
    :'merchant_item_oid' => :'Integer',
    :'options' => :'Array<ItemOption>',
    :'parent_category_id' => :'Integer',
    :'parent_category_path' => :'String',
    :'payment_processing' => :'ItemPaymentProcessing',
    :'physical' => :'ItemPhysical',
    :'pricing' => :'ItemPricing',
    :'properties' => :'Array<ItemProperty>',
    :'realtime_pricing' => :'ItemRealtimePricing',
    :'recommend_replenishment_days' => :'Integer',
    :'related' => :'ItemRelated',
    :'reporting' => :'ItemReporting',
    :'restriction' => :'ItemRestriction',
    :'revguard' => :'ItemRevguard',
    :'reviews' => :'ItemReviews',
    :'salesforce' => :'ItemSalesforce',
    :'shipping' => :'ItemShipping',
    :'tags' => :'ItemTags',
    :'tax' => :'ItemTax',
    :'third_party_email_marketing' => :'Array<ItemThirdPartyEmailMarketing>',
    :'variant_items' => :'Array<ItemVariantItem>',
    :'variations' => :'Array<ItemVariation>',
    :'wishlist_member' => :'ItemWishlistMember'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/ultracart_api/models/item.rb', line 540

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      accounting == o.accounting &&
      amember == o.amember &&
      auto_order == o.auto_order &&
      ccbill == o.ccbill &&
      channel_partner_item_mappings == o.channel_partner_item_mappings &&
      chargeback == o.chargeback &&
      checkout == o.checkout &&
      content == o.content &&
      creation_dts == o.creation_dts &&
      description == o.description &&
      description_translated_text_instance_oid == o.description_translated_text_instance_oid &&
      digital_delivery == o.digital_delivery &&
      ebay == o.ebay &&
      email_notifications == o.email_notifications &&
      enrollment123 == o.enrollment123 &&
      fulfillment_addons == o.fulfillment_addons &&
      gift_certificate == o.gift_certificate &&
      google_product_search == o.google_product_search &&
      identifiers == o.identifiers &&
      inactive == o.inactive &&
      instant_payment_notifications == o.instant_payment_notifications &&
      internal == o.internal &&
      kit == o.kit &&
      kit_component_only == o.kit_component_only &&
      kit_definition == o.kit_definition &&
      last_modified_dts == o.last_modified_dts &&
      merchant_id == o.merchant_id &&
      merchant_item_id == o.merchant_item_id &&
      merchant_item_oid == o.merchant_item_oid &&
      options == o.options &&
      parent_category_id == o.parent_category_id &&
      parent_category_path == o.parent_category_path &&
      payment_processing == o.payment_processing &&
      physical == o.physical &&
      pricing == o.pricing &&
      properties == o.properties &&
      realtime_pricing == o.realtime_pricing &&
      recommend_replenishment_days == o.recommend_replenishment_days &&
      related == o.related &&
      reporting == o.reporting &&
      restriction == o.restriction &&
      revguard == o.revguard &&
      reviews == o.reviews &&
      salesforce == o.salesforce &&
      shipping == o.shipping &&
      tags == o.tags &&
      tax == o.tax &&
      third_party_email_marketing == o.third_party_email_marketing &&
      variant_items == o.variant_items &&
      variations == o.variations &&
      wishlist_member == o.wishlist_member
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
# File 'lib/ultracart_api/models/item.rb', line 632

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = UltracartClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/ultracart_api/models/item.rb', line 698

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'lib/ultracart_api/models/item.rb', line 611

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


598
599
600
# File 'lib/ultracart_api/models/item.rb', line 598

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



604
605
606
# File 'lib/ultracart_api/models/item.rb', line 604

def hash
  [accounting, amember, auto_order, ccbill, channel_partner_item_mappings, chargeback, checkout, content, creation_dts, description, description_translated_text_instance_oid, digital_delivery, ebay, email_notifications, enrollment123, fulfillment_addons, gift_certificate, google_product_search, identifiers, inactive, instant_payment_notifications, internal, kit, kit_component_only, kit_definition, last_modified_dts, merchant_id, merchant_item_id, merchant_item_oid, options, parent_category_id, parent_category_path, payment_processing, physical, pricing, properties, realtime_pricing, recommend_replenishment_days, related, reporting, restriction, revguard, reviews, salesforce, shipping, tags, tax, third_party_email_marketing, variant_items, variations, wishlist_member].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/ultracart_api/models/item.rb', line 482

def list_invalid_properties
  invalid_properties = Array.new
  if !@description.nil? && @description.to_s.length > 512
    invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 512.')
  end

  if !@merchant_id.nil? && @merchant_id.to_s.length > 5
    invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
  end

  if !@merchant_item_id.nil? && @merchant_item_id.to_s.length > 20
    invalid_properties.push('invalid value for "merchant_item_id", the character length must be smaller than or equal to 20.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



678
679
680
# File 'lib/ultracart_api/models/item.rb', line 678

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



684
685
686
687
688
689
690
691
692
# File 'lib/ultracart_api/models/item.rb', line 684

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



672
673
674
# File 'lib/ultracart_api/models/item.rb', line 672

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



501
502
503
504
505
506
# File 'lib/ultracart_api/models/item.rb', line 501

def valid?
  return false if !@description.nil? && @description.to_s.length > 512
  return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
  return false if !@merchant_item_id.nil? && @merchant_item_id.to_s.length > 20
  true
end