Class: UltracartClient::OrderItem

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

Defined Under Namespace

Classes: EnumAttributeValidator

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



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
518
519
520
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
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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
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
# File 'lib/ultracart_api/models/order_item.rb', line 381

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderItem` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'accounting_code')
    self.accounting_code = attributes[:'accounting_code']
  end

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

  if attributes.key?(:'actual_cogs')
    self.actual_cogs = attributes[:'actual_cogs']
  end

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

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

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

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

  if attributes.key?(:'barcode_gtin12')
    self.barcode_gtin12 = attributes[:'barcode_gtin12']
  end

  if attributes.key?(:'barcode_gtin14')
    self.barcode_gtin14 = attributes[:'barcode_gtin14']
  end

  if attributes.key?(:'barcode_upc11')
    self.barcode_upc11 = attributes[:'barcode_upc11']
  end

  if attributes.key?(:'barcode_upc12')
    self.barcode_upc12 = attributes[:'barcode_upc12']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'item_index')
    self.item_index = attributes[:'item_index']
  end

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'parent_item_index')
    self.parent_item_index = attributes[:'parent_item_index']
  end

  if attributes.key?(:'parent_merchant_item_id')
    self.parent_merchant_item_id = attributes[:'parent_merchant_item_id']
  end

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

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

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

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

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

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

  if attributes.key?(:'refund_reason')
    self.refund_reason = attributes[:'refund_reason']
  end

  if attributes.key?(:'return_reason')
    self.return_reason = attributes[:'return_reason']
  end

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

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

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

  if attributes.key?(:'shipping_status')
    self.shipping_status = attributes[:'shipping_status']
  end

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

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

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

  if attributes.key?(:'tax_product_type')
    self.tax_product_type = attributes[:'tax_product_type']
  end

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

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

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

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

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

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

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

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

Instance Attribute Details

#accounting_codeObject

QuickBooks code



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

def accounting_code
  @accounting_code
end

#activation_codesObject

Activation codes assigned to this item



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

def activation_codes
  @activation_codes
end

#actual_cogsObject

Returns the value of attribute actual_cogs.



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

def actual_cogs
  @actual_cogs
end

#arbitrary_unit_costObject

Returns the value of attribute arbitrary_unit_cost.



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

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



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

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



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

def auto_order_schedule
  @auto_order_schedule
end

#barcodeObject

Barcode



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

def barcode
  @barcode
end

#barcode_gtin12Object

Barcode - GTIN 12



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

def barcode_gtin12
  @barcode_gtin12
end

#barcode_gtin14Object

Barcode - GTIN 14



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

def barcode_gtin14
  @barcode_gtin14
end

#barcode_upc11Object

Barcode - UPC 11



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

def barcode_upc11
  @barcode_upc11
end

#barcode_upc12Object

Barcode - UPC 12



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

def barcode_upc12
  @barcode_upc12
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



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

def channel_partner_item_id
  @channel_partner_item_id
end

#cogsObject

Cost of goods sold



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

def cogs
  @cogs
end

#component_unit_valueObject

Value of the kit component item



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

def component_unit_value
  @component_unit_value
end

#costObject

Returns the value of attribute cost.



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

def cost
  @cost
end

#country_code_of_originObject

Country of origin (ISO-3166 two letter code)



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

def country_code_of_origin
  @country_code_of_origin
end

#customs_descriptionObject

Customs description



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

def customs_description
  @customs_description
end

#descriptionObject

Description



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

def description
  @description
end

#discountObject

Returns the value of attribute discount.



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

def discount
  @discount
end

#discount_quantityObject

Discount quantity



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

def discount_quantity
  @discount_quantity
end

#discount_shipping_weightObject

Returns the value of attribute discount_shipping_weight.



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

def discount_shipping_weight
  @discount_shipping_weight
end

#distribution_center_codeObject

Distribution center code responsible for shipping this item



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

def distribution_center_code
  @distribution_center_code
end

#ediObject

Returns the value of attribute edi.



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

def edi
  @edi
end

#exclude_couponObject

True if this item is excluded from coupons



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

def exclude_coupon
  @exclude_coupon
end

#free_shippingObject

True if the item receives free shipping



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

def free_shipping
  @free_shipping
end

#hazmatObject

Hazardous materials indicator



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

def hazmat
  @hazmat
end

#heightObject

Returns the value of attribute height.



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

def height
  @height
end

#item_indexObject

Index of the item on the order (one based index)



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

def item_index
  @item_index
end

#item_reference_oidObject

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



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

def item_reference_oid
  @item_reference_oid
end

#kitObject

True if this item is a kit



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

def kit
  @kit
end

#kit_componentObject

True if this item is a kit component



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

def kit_component
  @kit_component
end

#lengthObject

Returns the value of attribute length.



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

def length
  @length
end

#manufacturer_skuObject

Manufacturer SKU



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

def manufacturer_sku
  @manufacturer_sku
end

#max_days_time_in_transitObject

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



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

def max_days_time_in_transit
  @max_days_time_in_transit
end

#merchant_item_idObject

Item ID



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

def merchant_item_id
  @merchant_item_id
end

#mix_and_match_group_nameObject

Mix and match group name



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

def mix_and_match_group_name
  @mix_and_match_group_name
end

#mix_and_match_group_oidObject

Mix and match group object identifier



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

def mix_and_match_group_oid
  @mix_and_match_group_oid
end

#no_shipping_discountObject

True if this item is excluded from shipping discounts



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

def no_shipping_discount
  @no_shipping_discount
end

#optionsObject

Options



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

def options
  @options
end

#packed_by_userObject

Packed by user



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

def packed_by_user
  @packed_by_user
end

#parent_item_indexObject

If this item is a kit component, this is the item index of the parent item (kit)



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

def parent_item_index
  @parent_item_index
end

#parent_merchant_item_idObject

If this item is a kit component, this is the item id of the parent item (kit)



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

def parent_merchant_item_id
  @parent_merchant_item_id
end

#perishable_classObject

Perishable class of the item



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

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



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

def pricing_tier_name
  @pricing_tier_name
end

#propertiesObject

Properties



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

def properties
  @properties
end

#quantityObject

Quantity



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

def quantity
  @quantity
end

#quantity_refundedObject

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



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

def quantity_refunded
  @quantity_refunded
end

#quickbooks_classObject

QuickBooks class



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

def quickbooks_class
  @quickbooks_class
end

#refund_reasonObject

Refund reason code. This can only be written during a refund operation otherwise this field is read only.



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

def refund_reason
  @refund_reason
end

#return_reasonObject

Return reason code. This can only be written during a refund operation otherwise this field is read only.



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

def return_reason
  @return_reason
end

#ship_separatelyObject

True if this item ships in a separate box



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

def ship_separately
  @ship_separately
end

#shipped_by_userObject

Shipped by user



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

def shipped_by_user
  @shipped_by_user
end

#shipped_dtsObject

Date/time that this item was marked shipped



167
168
169
# File 'lib/ultracart_api/models/order_item.rb', line 167

def shipped_dts
  @shipped_dts
end

#shipping_statusObject

Shipping status for this item. This is the replacement for the old order level shipping status.



170
171
172
# File 'lib/ultracart_api/models/order_item.rb', line 170

def shipping_status
  @shipping_status
end

#special_product_typeObject

Special product type (USPS Media Mail)



173
174
175
# File 'lib/ultracart_api/models/order_item.rb', line 173

def special_product_type
  @special_product_type
end

#tagsObject

Tags



176
177
178
# File 'lib/ultracart_api/models/order_item.rb', line 176

def tags
  @tags
end

#tax_freeObject

True if the item is tax free



179
180
181
# File 'lib/ultracart_api/models/order_item.rb', line 179

def tax_free
  @tax_free
end

#tax_product_typeObject

Type of product for tax purposes (self or UltraCart Managed taxes)



182
183
184
# File 'lib/ultracart_api/models/order_item.rb', line 182

def tax_product_type
  @tax_product_type
end

#taxable_costObject

Returns the value of attribute taxable_cost.



184
185
186
# File 'lib/ultracart_api/models/order_item.rb', line 184

def taxable_cost
  @taxable_cost
end

#total_cost_with_discountObject

Returns the value of attribute total_cost_with_discount.



186
187
188
# File 'lib/ultracart_api/models/order_item.rb', line 186

def total_cost_with_discount
  @total_cost_with_discount
end

#total_refundedObject

Returns the value of attribute total_refunded.



188
189
190
# File 'lib/ultracart_api/models/order_item.rb', line 188

def total_refunded
  @total_refunded
end

#transmitted_to_distribution_center_dtsObject

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



191
192
193
# File 'lib/ultracart_api/models/order_item.rb', line 191

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.



193
194
195
# File 'lib/ultracart_api/models/order_item.rb', line 193

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



196
197
198
# File 'lib/ultracart_api/models/order_item.rb', line 196

def upsell
  @upsell
end

#weightObject

Returns the value of attribute weight.



198
199
200
# File 'lib/ultracart_api/models/order_item.rb', line 198

def weight
  @weight
end

#widthObject

Returns the value of attribute width.



200
201
202
# File 'lib/ultracart_api/models/order_item.rb', line 200

def width
  @width
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



297
298
299
# File 'lib/ultracart_api/models/order_item.rb', line 297

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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
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
285
286
287
288
289
290
291
292
293
294
# File 'lib/ultracart_api/models/order_item.rb', line 225

def self.attribute_map
  {
    :'accounting_code' => :'accounting_code',
    :'activation_codes' => :'activation_codes',
    :'actual_cogs' => :'actual_cogs',
    :'arbitrary_unit_cost' => :'arbitrary_unit_cost',
    :'auto_order_last_rebill_dts' => :'auto_order_last_rebill_dts',
    :'auto_order_schedule' => :'auto_order_schedule',
    :'barcode' => :'barcode',
    :'barcode_gtin12' => :'barcode_gtin12',
    :'barcode_gtin14' => :'barcode_gtin14',
    :'barcode_upc11' => :'barcode_upc11',
    :'barcode_upc12' => :'barcode_upc12',
    :'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_index' => :'item_index',
    :'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',
    :'parent_item_index' => :'parent_item_index',
    :'parent_merchant_item_id' => :'parent_merchant_item_id',
    :'perishable_class' => :'perishable_class',
    :'pricing_tier_name' => :'pricing_tier_name',
    :'properties' => :'properties',
    :'quantity' => :'quantity',
    :'quantity_refunded' => :'quantity_refunded',
    :'quickbooks_class' => :'quickbooks_class',
    :'refund_reason' => :'refund_reason',
    :'return_reason' => :'return_reason',
    :'ship_separately' => :'ship_separately',
    :'shipped_by_user' => :'shipped_by_user',
    :'shipped_dts' => :'shipped_dts',
    :'shipping_status' => :'shipping_status',
    :'special_product_type' => :'special_product_type',
    :'tags' => :'tags',
    :'tax_free' => :'tax_free',
    :'tax_product_type' => :'tax_product_type',
    :'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

.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



945
946
947
# File 'lib/ultracart_api/models/order_item.rb', line 945

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



374
375
376
377
# File 'lib/ultracart_api/models/order_item.rb', line 374

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'accounting_code' => :'String',
    :'activation_codes' => :'Array<String>',
    :'actual_cogs' => :'Currency',
    :'arbitrary_unit_cost' => :'Currency',
    :'auto_order_last_rebill_dts' => :'String',
    :'auto_order_schedule' => :'String',
    :'barcode' => :'String',
    :'barcode_gtin12' => :'String',
    :'barcode_gtin14' => :'String',
    :'barcode_upc11' => :'String',
    :'barcode_upc12' => :'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_index' => :'Integer',
    :'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',
    :'parent_item_index' => :'Integer',
    :'parent_merchant_item_id' => :'String',
    :'perishable_class' => :'String',
    :'pricing_tier_name' => :'String',
    :'properties' => :'Array<OrderItemProperty>',
    :'quantity' => :'Float',
    :'quantity_refunded' => :'Float',
    :'quickbooks_class' => :'String',
    :'refund_reason' => :'String',
    :'return_reason' => :'String',
    :'ship_separately' => :'Boolean',
    :'shipped_by_user' => :'String',
    :'shipped_dts' => :'String',
    :'shipping_status' => :'String',
    :'special_product_type' => :'String',
    :'tags' => :'Array<OrderItemTag>',
    :'tax_free' => :'Boolean',
    :'tax_product_type' => :'String',
    :'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



859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
# File 'lib/ultracart_api/models/order_item.rb', line 859

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      accounting_code == o.accounting_code &&
      activation_codes == o.activation_codes &&
      actual_cogs == o.actual_cogs &&
      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 &&
      barcode_gtin12 == o.barcode_gtin12 &&
      barcode_gtin14 == o.barcode_gtin14 &&
      barcode_upc11 == o.barcode_upc11 &&
      barcode_upc12 == o.barcode_upc12 &&
      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_index == o.item_index &&
      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 &&
      parent_item_index == o.parent_item_index &&
      parent_merchant_item_id == o.parent_merchant_item_id &&
      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 &&
      refund_reason == o.refund_reason &&
      return_reason == o.return_reason &&
      ship_separately == o.ship_separately &&
      shipped_by_user == o.shipped_by_user &&
      shipped_dts == o.shipped_dts &&
      shipping_status == o.shipping_status &&
      special_product_type == o.special_product_type &&
      tags == o.tags &&
      tax_free == o.tax_free &&
      tax_product_type == o.tax_product_type &&
      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



976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
# File 'lib/ultracart_api/models/order_item.rb', line 976

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = UltracartClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
# File 'lib/ultracart_api/models/order_item.rb', line 1047

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



952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
# File 'lib/ultracart_api/models/order_item.rb', line 952

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif 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
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


932
933
934
# File 'lib/ultracart_api/models/order_item.rb', line 932

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



938
939
940
# File 'lib/ultracart_api/models/order_item.rb', line 938

def hash
  [accounting_code, activation_codes, actual_cogs, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, barcode_gtin12, barcode_gtin14, barcode_upc11, barcode_upc12, 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_index, 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, parent_item_index, parent_merchant_item_id, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, refund_reason, return_reason, ship_separately, shipped_by_user, shipped_dts, shipping_status, special_product_type, tags, tax_free, tax_product_type, 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



669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/ultracart_api/models/order_item.rb', line 669

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

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

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

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

  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 !@parent_merchant_item_id.nil? && @parent_merchant_item_id.to_s.length > 20
    invalid_properties.push('invalid value for "parent_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



1023
1024
1025
# File 'lib/ultracart_api/models/order_item.rb', line 1023

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



1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
# File 'lib/ultracart_api/models/order_item.rb', line 1029

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



1017
1018
1019
# File 'lib/ultracart_api/models/order_item.rb', line 1017

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



720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
# File 'lib/ultracart_api/models/order_item.rb', line 720

def valid?
  return false if !@barcode_gtin12.nil? && @barcode_gtin12.to_s.length > 12
  return false if !@barcode_gtin14.nil? && @barcode_gtin14.to_s.length > 14
  return false if !@barcode_upc11.nil? && @barcode_upc11.to_s.length > 11
  return false if !@barcode_upc12.nil? && @barcode_upc12.to_s.length > 12
  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 !@parent_merchant_item_id.nil? && @parent_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
  tax_product_type_validator = EnumAttributeValidator.new('String', ["", "digital", "physical", "service"])
  return false unless tax_product_type_validator.valid?(@tax_product_type)
  true
end