Class: UltracartClient::OrderItem

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OrderItem

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/ultracart_api/models/order_item.rb', line 288

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_code')
    self.accounting_code = attributes[:'accounting_code']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#accounting_codeObject

QuickBooks code



18
19
20
# File 'lib/ultracart_api/models/order_item.rb', line 18

def accounting_code
  @accounting_code
end

#activation_codesObject

Activation codes assigned to this item



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

def activation_codes
  @activation_codes
end

#arbitrary_unit_costObject

Returns the value of attribute arbitrary_unit_cost.



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

def arbitrary_unit_cost
  @arbitrary_unit_cost
end

#auto_order_last_rebill_dtsObject

Date/time of the last rebill, used only during order insert to help project future rebills



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

def auto_order_last_rebill_dts
  @auto_order_last_rebill_dts
end

#auto_order_scheduleObject

Auto order schedule, used only during inserts supplying the recurring schedule



29
30
31
# File 'lib/ultracart_api/models/order_item.rb', line 29

def auto_order_schedule
  @auto_order_schedule
end

#barcodeObject

Barcode



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

def barcode
  @barcode
end

#channel_partner_item_idObject

Channel partner item id if this order came through a channel partner and the channel partner item id was mapped to an internal item id



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

def channel_partner_item_id
  @channel_partner_item_id
end

#cogsObject

Cost of goods sold



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

def cogs
  @cogs
end

#component_unit_valueObject

Value of the kit component item



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

def component_unit_value
  @component_unit_value
end

#costObject

Returns the value of attribute cost.



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

def cost
  @cost
end

#country_code_of_originObject

Country of origin (ISO-3166 two letter code)



46
47
48
# File 'lib/ultracart_api/models/order_item.rb', line 46

def country_code_of_origin
  @country_code_of_origin
end

#customs_descriptionObject

Customs description



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

def customs_description
  @customs_description
end

#descriptionObject

Description



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

def description
  @description
end

#discountObject

Returns the value of attribute discount.



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

def discount
  @discount
end

#discount_quantityObject

Discount quantity



57
58
59
# File 'lib/ultracart_api/models/order_item.rb', line 57

def discount_quantity
  @discount_quantity
end

#discount_shipping_weightObject

Returns the value of attribute discount_shipping_weight.



59
60
61
# File 'lib/ultracart_api/models/order_item.rb', line 59

def discount_shipping_weight
  @discount_shipping_weight
end

#distribution_center_codeObject

Distribution center code responsible for shipping this item



62
63
64
# File 'lib/ultracart_api/models/order_item.rb', line 62

def distribution_center_code
  @distribution_center_code
end

#ediObject

Returns the value of attribute edi.



64
65
66
# File 'lib/ultracart_api/models/order_item.rb', line 64

def edi
  @edi
end

#exclude_couponObject

True if this item is excluded from coupons



67
68
69
# File 'lib/ultracart_api/models/order_item.rb', line 67

def exclude_coupon
  @exclude_coupon
end

#free_shippingObject

True if the item receives free shipping



70
71
72
# File 'lib/ultracart_api/models/order_item.rb', line 70

def free_shipping
  @free_shipping
end

#hazmatObject

Hazardous materials indicator



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

def hazmat
  @hazmat
end

#heightObject

Returns the value of attribute height.



75
76
77
# File 'lib/ultracart_api/models/order_item.rb', line 75

def height
  @height
end

#item_reference_oidObject

Item reference object identifier used to linked to auto order item record



78
79
80
# File 'lib/ultracart_api/models/order_item.rb', line 78

def item_reference_oid
  @item_reference_oid
end

#kitObject

True if this item is a kit



81
82
83
# File 'lib/ultracart_api/models/order_item.rb', line 81

def kit
  @kit
end

#kit_componentObject

True if this item is a kit component



84
85
86
# File 'lib/ultracart_api/models/order_item.rb', line 84

def kit_component
  @kit_component
end

#lengthObject

Returns the value of attribute length.



86
87
88
# File 'lib/ultracart_api/models/order_item.rb', line 86

def length
  @length
end

#manufacturer_skuObject

Manufacturer SKU



89
90
91
# File 'lib/ultracart_api/models/order_item.rb', line 89

def manufacturer_sku
  @manufacturer_sku
end

#max_days_time_in_transitObject

Maximum days that the item can be in transit before spoilage (perishable products)



92
93
94
# File 'lib/ultracart_api/models/order_item.rb', line 92

def max_days_time_in_transit
  @max_days_time_in_transit
end

#merchant_item_idObject

Item ID



95
96
97
# File 'lib/ultracart_api/models/order_item.rb', line 95

def merchant_item_id
  @merchant_item_id
end

#mix_and_match_group_nameObject

Mix and match group name



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

def mix_and_match_group_name
  @mix_and_match_group_name
end

#mix_and_match_group_oidObject

Mix and match group object identifier



101
102
103
# File 'lib/ultracart_api/models/order_item.rb', line 101

def mix_and_match_group_oid
  @mix_and_match_group_oid
end

#no_shipping_discountObject

True if this item is excluded from shipping discounts



104
105
106
# File 'lib/ultracart_api/models/order_item.rb', line 104

def no_shipping_discount
  @no_shipping_discount
end

#optionsObject

Options



107
108
109
# File 'lib/ultracart_api/models/order_item.rb', line 107

def options
  @options
end

#packed_by_userObject

Packed by user



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

def packed_by_user
  @packed_by_user
end

#perishable_classObject

Perishable class of the item



113
114
115
# File 'lib/ultracart_api/models/order_item.rb', line 113

def perishable_class
  @perishable_class
end

#pricing_tier_nameObject

Pricing tier that granted the particular price for this item if the customer profile had pricing tiers assigned



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

def pricing_tier_name
  @pricing_tier_name
end

#propertiesObject

Properties



119
120
121
# File 'lib/ultracart_api/models/order_item.rb', line 119

def properties
  @properties
end

#quantityObject

Quantity



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

def quantity
  @quantity
end

#quantity_refundedObject

Quantity refunded on this item (read only except refund operation)



125
126
127
# File 'lib/ultracart_api/models/order_item.rb', line 125

def quantity_refunded
  @quantity_refunded
end

#quickbooks_classObject

QuickBooks class



128
129
130
# File 'lib/ultracart_api/models/order_item.rb', line 128

def quickbooks_class
  @quickbooks_class
end

#ship_separatelyObject

True if this item ships in a separate box



131
132
133
# File 'lib/ultracart_api/models/order_item.rb', line 131

def ship_separately
  @ship_separately
end

#shipped_by_userObject

Shipped by user



134
135
136
# File 'lib/ultracart_api/models/order_item.rb', line 134

def shipped_by_user
  @shipped_by_user
end

#shipped_dtsObject

Date/time that this item was marked shipped



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

def shipped_dts
  @shipped_dts
end

#special_product_typeObject

Special product type (USPS Media Mail)



140
141
142
# File 'lib/ultracart_api/models/order_item.rb', line 140

def special_product_type
  @special_product_type
end

#tagsObject

Tags



143
144
145
# File 'lib/ultracart_api/models/order_item.rb', line 143

def tags
  @tags
end

#tax_freeObject

True if the item is tax free



146
147
148
# File 'lib/ultracart_api/models/order_item.rb', line 146

def tax_free
  @tax_free
end

#taxable_costObject

Returns the value of attribute taxable_cost.



148
149
150
# File 'lib/ultracart_api/models/order_item.rb', line 148

def taxable_cost
  @taxable_cost
end

#total_cost_with_discountObject

Returns the value of attribute total_cost_with_discount.



150
151
152
# File 'lib/ultracart_api/models/order_item.rb', line 150

def total_cost_with_discount
  @total_cost_with_discount
end

#total_refundedObject

Returns the value of attribute total_refunded.



152
153
154
# File 'lib/ultracart_api/models/order_item.rb', line 152

def total_refunded
  @total_refunded
end

#transmitted_to_distribution_center_dtsObject

Date/time that this item was transmitted to the distribution center



155
156
157
# File 'lib/ultracart_api/models/order_item.rb', line 155

def transmitted_to_distribution_center_dts
  @transmitted_to_distribution_center_dts
end

#unit_cost_with_discountObject

Returns the value of attribute unit_cost_with_discount.



157
158
159
# File 'lib/ultracart_api/models/order_item.rb', line 157

def unit_cost_with_discount
  @unit_cost_with_discount
end

#upsellObject

True if this item was added to the order as part of an upsell



160
161
162
# File 'lib/ultracart_api/models/order_item.rb', line 160

def upsell
  @upsell
end

#weightObject

Returns the value of attribute weight.



162
163
164
# File 'lib/ultracart_api/models/order_item.rb', line 162

def weight
  @weight
end

#widthObject

Returns the value of attribute width.



164
165
166
# File 'lib/ultracart_api/models/order_item.rb', line 164

def width
  @width
end

Class Method Details

.attribute_mapObject

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



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
195
196
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
# File 'lib/ultracart_api/models/order_item.rb', line 167

def self.attribute_map
  {
    :'accounting_code' => :'accounting_code',
    :'activation_codes' => :'activation_codes',
    :'arbitrary_unit_cost' => :'arbitrary_unit_cost',
    :'auto_order_last_rebill_dts' => :'auto_order_last_rebill_dts',
    :'auto_order_schedule' => :'auto_order_schedule',
    :'barcode' => :'barcode',
    :'channel_partner_item_id' => :'channel_partner_item_id',
    :'cogs' => :'cogs',
    :'component_unit_value' => :'component_unit_value',
    :'cost' => :'cost',
    :'country_code_of_origin' => :'country_code_of_origin',
    :'customs_description' => :'customs_description',
    :'description' => :'description',
    :'discount' => :'discount',
    :'discount_quantity' => :'discount_quantity',
    :'discount_shipping_weight' => :'discount_shipping_weight',
    :'distribution_center_code' => :'distribution_center_code',
    :'edi' => :'edi',
    :'exclude_coupon' => :'exclude_coupon',
    :'free_shipping' => :'free_shipping',
    :'hazmat' => :'hazmat',
    :'height' => :'height',
    :'item_reference_oid' => :'item_reference_oid',
    :'kit' => :'kit',
    :'kit_component' => :'kit_component',
    :'length' => :'length',
    :'manufacturer_sku' => :'manufacturer_sku',
    :'max_days_time_in_transit' => :'max_days_time_in_transit',
    :'merchant_item_id' => :'merchant_item_id',
    :'mix_and_match_group_name' => :'mix_and_match_group_name',
    :'mix_and_match_group_oid' => :'mix_and_match_group_oid',
    :'no_shipping_discount' => :'no_shipping_discount',
    :'options' => :'options',
    :'packed_by_user' => :'packed_by_user',
    :'perishable_class' => :'perishable_class',
    :'pricing_tier_name' => :'pricing_tier_name',
    :'properties' => :'properties',
    :'quantity' => :'quantity',
    :'quantity_refunded' => :'quantity_refunded',
    :'quickbooks_class' => :'quickbooks_class',
    :'ship_separately' => :'ship_separately',
    :'shipped_by_user' => :'shipped_by_user',
    :'shipped_dts' => :'shipped_dts',
    :'special_product_type' => :'special_product_type',
    :'tags' => :'tags',
    :'tax_free' => :'tax_free',
    :'taxable_cost' => :'taxable_cost',
    :'total_cost_with_discount' => :'total_cost_with_discount',
    :'total_refunded' => :'total_refunded',
    :'transmitted_to_distribution_center_dts' => :'transmitted_to_distribution_center_dts',
    :'unit_cost_with_discount' => :'unit_cost_with_discount',
    :'upsell' => :'upsell',
    :'weight' => :'weight',
    :'width' => :'width'
  }
end

.swagger_typesObject

Attribute type mapping.



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
252
253
254
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
# File 'lib/ultracart_api/models/order_item.rb', line 227

def self.swagger_types
  {
    :'accounting_code' => :'String',
    :'activation_codes' => :'Array<String>',
    :'arbitrary_unit_cost' => :'Currency',
    :'auto_order_last_rebill_dts' => :'String',
    :'auto_order_schedule' => :'String',
    :'barcode' => :'String',
    :'channel_partner_item_id' => :'String',
    :'cogs' => :'Float',
    :'component_unit_value' => :'Float',
    :'cost' => :'Currency',
    :'country_code_of_origin' => :'String',
    :'customs_description' => :'String',
    :'description' => :'String',
    :'discount' => :'Currency',
    :'discount_quantity' => :'Float',
    :'discount_shipping_weight' => :'Weight',
    :'distribution_center_code' => :'String',
    :'edi' => :'OrderItemEdi',
    :'exclude_coupon' => :'BOOLEAN',
    :'free_shipping' => :'BOOLEAN',
    :'hazmat' => :'BOOLEAN',
    :'height' => :'Distance',
    :'item_reference_oid' => :'Integer',
    :'kit' => :'BOOLEAN',
    :'kit_component' => :'BOOLEAN',
    :'length' => :'Distance',
    :'manufacturer_sku' => :'String',
    :'max_days_time_in_transit' => :'Integer',
    :'merchant_item_id' => :'String',
    :'mix_and_match_group_name' => :'String',
    :'mix_and_match_group_oid' => :'Integer',
    :'no_shipping_discount' => :'BOOLEAN',
    :'options' => :'Array<OrderItemOption>',
    :'packed_by_user' => :'String',
    :'perishable_class' => :'String',
    :'pricing_tier_name' => :'String',
    :'properties' => :'Array<OrderItemProperty>',
    :'quantity' => :'Float',
    :'quantity_refunded' => :'Float',
    :'quickbooks_class' => :'String',
    :'ship_separately' => :'BOOLEAN',
    :'shipped_by_user' => :'String',
    :'shipped_dts' => :'String',
    :'special_product_type' => :'String',
    :'tags' => :'Array<OrderItemTag>',
    :'tax_free' => :'BOOLEAN',
    :'taxable_cost' => :'Currency',
    :'total_cost_with_discount' => :'Currency',
    :'total_refunded' => :'Currency',
    :'transmitted_to_distribution_center_dts' => :'String',
    :'unit_cost_with_discount' => :'Currency',
    :'upsell' => :'BOOLEAN',
    :'weight' => :'Weight',
    :'width' => :'Distance'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



624
625
626
627
628
629
630
631
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
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'lib/ultracart_api/models/order_item.rb', line 624

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      accounting_code == o.accounting_code &&
      activation_codes == o.activation_codes &&
      arbitrary_unit_cost == o.arbitrary_unit_cost &&
      auto_order_last_rebill_dts == o.auto_order_last_rebill_dts &&
      auto_order_schedule == o.auto_order_schedule &&
      barcode == o.barcode &&
      channel_partner_item_id == o.channel_partner_item_id &&
      cogs == o.cogs &&
      component_unit_value == o.component_unit_value &&
      cost == o.cost &&
      country_code_of_origin == o.country_code_of_origin &&
      customs_description == o.customs_description &&
      description == o.description &&
      discount == o.discount &&
      discount_quantity == o.discount_quantity &&
      discount_shipping_weight == o.discount_shipping_weight &&
      distribution_center_code == o.distribution_center_code &&
      edi == o.edi &&
      exclude_coupon == o.exclude_coupon &&
      free_shipping == o.free_shipping &&
      hazmat == o.hazmat &&
      height == o.height &&
      item_reference_oid == o.item_reference_oid &&
      kit == o.kit &&
      kit_component == o.kit_component &&
      length == o.length &&
      manufacturer_sku == o.manufacturer_sku &&
      max_days_time_in_transit == o.max_days_time_in_transit &&
      merchant_item_id == o.merchant_item_id &&
      mix_and_match_group_name == o.mix_and_match_group_name &&
      mix_and_match_group_oid == o.mix_and_match_group_oid &&
      no_shipping_discount == o.no_shipping_discount &&
      options == o.options &&
      packed_by_user == o.packed_by_user &&
      perishable_class == o.perishable_class &&
      pricing_tier_name == o.pricing_tier_name &&
      properties == o.properties &&
      quantity == o.quantity &&
      quantity_refunded == o.quantity_refunded &&
      quickbooks_class == o.quickbooks_class &&
      ship_separately == o.ship_separately &&
      shipped_by_user == o.shipped_by_user &&
      shipped_dts == o.shipped_dts &&
      special_product_type == o.special_product_type &&
      tags == o.tags &&
      tax_free == o.tax_free &&
      taxable_cost == o.taxable_cost &&
      total_cost_with_discount == o.total_cost_with_discount &&
      total_refunded == o.total_refunded &&
      transmitted_to_distribution_center_dts == o.transmitted_to_distribution_center_dts &&
      unit_cost_with_discount == o.unit_cost_with_discount &&
      upsell == o.upsell &&
      weight == o.weight &&
      width == o.width
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



719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/ultracart_api/models/order_item.rb', line 719

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



785
786
787
788
789
790
791
792
793
794
795
796
797
# File 'lib/ultracart_api/models/order_item.rb', line 785

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



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

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


685
686
687
# File 'lib/ultracart_api/models/order_item.rb', line 685

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



691
692
693
# File 'lib/ultracart_api/models/order_item.rb', line 691

def hash
  [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, channel_partner_item_id, cogs, component_unit_value, cost, country_code_of_origin, customs_description, description, discount, discount_quantity, discount_shipping_weight, distribution_center_code, edi, exclude_coupon, free_shipping, hazmat, height, item_reference_oid, kit, kit_component, length, manufacturer_sku, max_days_time_in_transit, merchant_item_id, mix_and_match_group_name, mix_and_match_group_oid, no_shipping_discount, options, packed_by_user, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, ship_separately, shipped_by_user, shipped_dts, special_product_type, tags, tax_free, taxable_cost, total_cost_with_discount, total_refunded, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/ultracart_api/models/order_item.rb', line 521

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

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

  if !@description.nil? && @description.to_s.length > 2000
    invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 2000.')
  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

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

  if !@quickbooks_class.nil? && @quickbooks_class.to_s.length > 31
    invalid_properties.push('invalid value for "quickbooks_class", the character length must be smaller than or equal to 31.')
  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



765
766
767
# File 'lib/ultracart_api/models/order_item.rb', line 765

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



771
772
773
774
775
776
777
778
779
# File 'lib/ultracart_api/models/order_item.rb', line 771

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



759
760
761
# File 'lib/ultracart_api/models/order_item.rb', line 759

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



552
553
554
555
556
557
558
559
560
# File 'lib/ultracart_api/models/order_item.rb', line 552

def valid?
  return false if !@channel_partner_item_id.nil? && @channel_partner_item_id.to_s.length > 30
  return false if !@country_code_of_origin.nil? && @country_code_of_origin.to_s.length > 2
  return false if !@description.nil? && @description.to_s.length > 2000
  return false if !@merchant_item_id.nil? && @merchant_item_id.to_s.length > 20
  return false if !@perishable_class.nil? && @perishable_class.to_s.length > 50
  return false if !@quickbooks_class.nil? && @quickbooks_class.to_s.length > 31
  true
end