Class: UltracartClient::OrderItem
- Inherits:
-
Object
- Object
- UltracartClient::OrderItem
- Defined in:
- lib/ultracart_api/models/order_item.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#accounting_code ⇒ Object
QuickBooks code.
-
#activation_codes ⇒ Object
Activation codes assigned to this item.
-
#arbitrary_unit_cost ⇒ Object
Returns the value of attribute arbitrary_unit_cost.
-
#auto_order_last_rebill_dts ⇒ Object
Date/time of the last rebill, used only during order insert to help project future rebills.
-
#auto_order_schedule ⇒ Object
Auto order schedule, used only during inserts supplying the recurring schedule.
-
#barcode ⇒ Object
Barcode.
-
#barcode_gtin12 ⇒ Object
Barcode - GTIN 12.
-
#barcode_gtin14 ⇒ Object
Barcode - GTIN 14.
-
#barcode_upc11 ⇒ Object
Barcode - UPC 11.
-
#barcode_upc12 ⇒ Object
Barcode - UPC 12.
-
#channel_partner_item_id ⇒ Object
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.
-
#cogs ⇒ Object
Cost of goods sold.
-
#component_unit_value ⇒ Object
Value of the kit component item.
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#country_code_of_origin ⇒ Object
Country of origin (ISO-3166 two letter code).
-
#customs_description ⇒ Object
Customs description.
-
#description ⇒ Object
Description.
-
#discount ⇒ Object
Returns the value of attribute discount.
-
#discount_quantity ⇒ Object
Discount quantity.
-
#discount_shipping_weight ⇒ Object
Returns the value of attribute discount_shipping_weight.
-
#distribution_center_code ⇒ Object
Distribution center code responsible for shipping this item.
-
#edi ⇒ Object
Returns the value of attribute edi.
-
#exclude_coupon ⇒ Object
True if this item is excluded from coupons.
-
#free_shipping ⇒ Object
True if the item receives free shipping.
-
#hazmat ⇒ Object
Hazardous materials indicator.
-
#height ⇒ Object
Returns the value of attribute height.
-
#item_index ⇒ Object
Index of the item on the order (one based index).
-
#item_reference_oid ⇒ Object
Item reference object identifier used to linked to auto order item record.
-
#kit ⇒ Object
True if this item is a kit.
-
#kit_component ⇒ Object
True if this item is a kit component.
-
#length ⇒ Object
Returns the value of attribute length.
-
#manufacturer_sku ⇒ Object
Manufacturer SKU.
-
#max_days_time_in_transit ⇒ Object
Maximum days that the item can be in transit before spoilage (perishable products).
-
#merchant_item_id ⇒ Object
Item ID.
-
#mix_and_match_group_name ⇒ Object
Mix and match group name.
-
#mix_and_match_group_oid ⇒ Object
Mix and match group object identifier.
-
#no_shipping_discount ⇒ Object
True if this item is excluded from shipping discounts.
-
#options ⇒ Object
Options.
-
#packed_by_user ⇒ Object
Packed by user.
-
#parent_item_index ⇒ Object
If this item is a kit component, this is the item index of the parent item (kit).
-
#parent_merchant_item_id ⇒ Object
If this item is a kit component, this is the item id of the parent item (kit).
-
#perishable_class ⇒ Object
Perishable class of the item.
-
#pricing_tier_name ⇒ Object
Pricing tier that granted the particular price for this item if the customer profile had pricing tiers assigned.
-
#properties ⇒ Object
Properties.
-
#quantity ⇒ Object
Quantity.
-
#quantity_refunded ⇒ Object
Quantity refunded on this item (read only except refund operation).
-
#quickbooks_class ⇒ Object
QuickBooks class.
-
#refund_reason ⇒ Object
Refund reason code.
-
#return_reason ⇒ Object
Return reason code.
-
#ship_separately ⇒ Object
True if this item ships in a separate box.
-
#shipped_by_user ⇒ Object
Shipped by user.
-
#shipped_dts ⇒ Object
Date/time that this item was marked shipped.
-
#shipping_status ⇒ Object
Shipping status for this item.
-
#special_product_type ⇒ Object
Special product type (USPS Media Mail).
-
#tags ⇒ Object
Tags.
-
#tax_free ⇒ Object
True if the item is tax free.
-
#tax_product_type ⇒ Object
Type of product for tax purposes (self or UltraCart Managed taxes).
-
#taxable_cost ⇒ Object
Returns the value of attribute taxable_cost.
-
#total_cost_with_discount ⇒ Object
Returns the value of attribute total_cost_with_discount.
-
#total_refunded ⇒ Object
Returns the value of attribute total_refunded.
-
#transmitted_to_distribution_center_dts ⇒ Object
Date/time that this item was transmitted to the distribution center.
-
#unit_cost_with_discount ⇒ Object
Returns the value of attribute unit_cost_with_discount.
-
#upsell ⇒ Object
True if this item was added to the order as part of an upsell.
-
#weight ⇒ Object
Returns the value of attribute weight.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OrderItem
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ OrderItem
Initializes the object
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 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 |
# File 'lib/ultracart_api/models/order_item.rb', line 365 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. = attributes[:'barcode'] end if attributes.has_key?(:'barcode_gtin12') self. = attributes[:'barcode_gtin12'] end if attributes.has_key?(:'barcode_gtin14') self. = attributes[:'barcode_gtin14'] end if attributes.has_key?(:'barcode_upc11') self. = attributes[:'barcode_upc11'] end if attributes.has_key?(:'barcode_upc12') self. = attributes[:'barcode_upc12'] 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_index') self.item_index = attributes[:'item_index'] 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. = value end end if attributes.has_key?(:'packed_by_user') self.packed_by_user = attributes[:'packed_by_user'] end if attributes.has_key?(:'parent_item_index') self.parent_item_index = attributes[:'parent_item_index'] end if attributes.has_key?(:'parent_merchant_item_id') self.parent_merchant_item_id = attributes[:'parent_merchant_item_id'] 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?(:'refund_reason') self.refund_reason = attributes[:'refund_reason'] end if attributes.has_key?(:'return_reason') self.return_reason = attributes[:'return_reason'] 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?(:'shipping_status') self.shipping_status = attributes[:'shipping_status'] 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. = value end end if attributes.has_key?(:'tax_free') self.tax_free = attributes[:'tax_free'] end if attributes.has_key?(:'tax_product_type') self.tax_product_type = attributes[:'tax_product_type'] 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_code ⇒ Object
QuickBooks code
18 19 20 |
# File 'lib/ultracart_api/models/order_item.rb', line 18 def accounting_code @accounting_code end |
#activation_codes ⇒ Object
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_cost ⇒ Object
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_dts ⇒ Object
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_schedule ⇒ Object
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 |
#barcode ⇒ Object
Barcode
32 33 34 |
# File 'lib/ultracart_api/models/order_item.rb', line 32 def end |
#barcode_gtin12 ⇒ Object
Barcode - GTIN 12
35 36 37 |
# File 'lib/ultracart_api/models/order_item.rb', line 35 def end |
#barcode_gtin14 ⇒ Object
Barcode - GTIN 14
38 39 40 |
# File 'lib/ultracart_api/models/order_item.rb', line 38 def end |
#barcode_upc11 ⇒ Object
Barcode - UPC 11
41 42 43 |
# File 'lib/ultracart_api/models/order_item.rb', line 41 def end |
#barcode_upc12 ⇒ Object
Barcode - UPC 12
44 45 46 |
# File 'lib/ultracart_api/models/order_item.rb', line 44 def end |
#channel_partner_item_id ⇒ Object
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
47 48 49 |
# File 'lib/ultracart_api/models/order_item.rb', line 47 def channel_partner_item_id @channel_partner_item_id end |
#cogs ⇒ Object
Cost of goods sold
50 51 52 |
# File 'lib/ultracart_api/models/order_item.rb', line 50 def cogs @cogs end |
#component_unit_value ⇒ Object
Value of the kit component item
53 54 55 |
# File 'lib/ultracart_api/models/order_item.rb', line 53 def component_unit_value @component_unit_value end |
#cost ⇒ Object
Returns the value of attribute cost.
55 56 57 |
# File 'lib/ultracart_api/models/order_item.rb', line 55 def cost @cost end |
#country_code_of_origin ⇒ Object
Country of origin (ISO-3166 two letter code)
58 59 60 |
# File 'lib/ultracart_api/models/order_item.rb', line 58 def country_code_of_origin @country_code_of_origin end |
#customs_description ⇒ Object
Customs description
61 62 63 |
# File 'lib/ultracart_api/models/order_item.rb', line 61 def customs_description @customs_description end |
#description ⇒ Object
Description
64 65 66 |
# File 'lib/ultracart_api/models/order_item.rb', line 64 def description @description end |
#discount ⇒ Object
Returns the value of attribute discount.
66 67 68 |
# File 'lib/ultracart_api/models/order_item.rb', line 66 def discount @discount end |
#discount_quantity ⇒ Object
Discount quantity
69 70 71 |
# File 'lib/ultracart_api/models/order_item.rb', line 69 def discount_quantity @discount_quantity end |
#discount_shipping_weight ⇒ Object
Returns the value of attribute discount_shipping_weight.
71 72 73 |
# File 'lib/ultracart_api/models/order_item.rb', line 71 def discount_shipping_weight @discount_shipping_weight end |
#distribution_center_code ⇒ Object
Distribution center code responsible for shipping this item
74 75 76 |
# File 'lib/ultracart_api/models/order_item.rb', line 74 def distribution_center_code @distribution_center_code end |
#edi ⇒ Object
Returns the value of attribute edi.
76 77 78 |
# File 'lib/ultracart_api/models/order_item.rb', line 76 def edi @edi end |
#exclude_coupon ⇒ Object
True if this item is excluded from coupons
79 80 81 |
# File 'lib/ultracart_api/models/order_item.rb', line 79 def exclude_coupon @exclude_coupon end |
#free_shipping ⇒ Object
True if the item receives free shipping
82 83 84 |
# File 'lib/ultracart_api/models/order_item.rb', line 82 def free_shipping @free_shipping end |
#hazmat ⇒ Object
Hazardous materials indicator
85 86 87 |
# File 'lib/ultracart_api/models/order_item.rb', line 85 def hazmat @hazmat end |
#height ⇒ Object
Returns the value of attribute height.
87 88 89 |
# File 'lib/ultracart_api/models/order_item.rb', line 87 def height @height end |
#item_index ⇒ Object
Index of the item on the order (one based index)
90 91 92 |
# File 'lib/ultracart_api/models/order_item.rb', line 90 def item_index @item_index end |
#item_reference_oid ⇒ Object
Item reference object identifier used to linked to auto order item record
93 94 95 |
# File 'lib/ultracart_api/models/order_item.rb', line 93 def item_reference_oid @item_reference_oid end |
#kit ⇒ Object
True if this item is a kit
96 97 98 |
# File 'lib/ultracart_api/models/order_item.rb', line 96 def kit @kit end |
#kit_component ⇒ Object
True if this item is a kit component
99 100 101 |
# File 'lib/ultracart_api/models/order_item.rb', line 99 def kit_component @kit_component end |
#length ⇒ Object
Returns the value of attribute length.
101 102 103 |
# File 'lib/ultracart_api/models/order_item.rb', line 101 def length @length end |
#manufacturer_sku ⇒ Object
Manufacturer SKU
104 105 106 |
# File 'lib/ultracart_api/models/order_item.rb', line 104 def manufacturer_sku @manufacturer_sku end |
#max_days_time_in_transit ⇒ Object
Maximum days that the item can be in transit before spoilage (perishable products)
107 108 109 |
# File 'lib/ultracart_api/models/order_item.rb', line 107 def max_days_time_in_transit @max_days_time_in_transit end |
#merchant_item_id ⇒ Object
Item ID
110 111 112 |
# File 'lib/ultracart_api/models/order_item.rb', line 110 def merchant_item_id @merchant_item_id end |
#mix_and_match_group_name ⇒ Object
Mix and match group name
113 114 115 |
# File 'lib/ultracart_api/models/order_item.rb', line 113 def mix_and_match_group_name @mix_and_match_group_name end |
#mix_and_match_group_oid ⇒ Object
Mix and match group object identifier
116 117 118 |
# File 'lib/ultracart_api/models/order_item.rb', line 116 def mix_and_match_group_oid @mix_and_match_group_oid end |
#no_shipping_discount ⇒ Object
True if this item is excluded from shipping discounts
119 120 121 |
# File 'lib/ultracart_api/models/order_item.rb', line 119 def no_shipping_discount @no_shipping_discount end |
#options ⇒ Object
Options
122 123 124 |
# File 'lib/ultracart_api/models/order_item.rb', line 122 def end |
#packed_by_user ⇒ Object
Packed by user
125 126 127 |
# File 'lib/ultracart_api/models/order_item.rb', line 125 def packed_by_user @packed_by_user end |
#parent_item_index ⇒ Object
If this item is a kit component, this is the item index of the parent item (kit)
128 129 130 |
# File 'lib/ultracart_api/models/order_item.rb', line 128 def parent_item_index @parent_item_index end |
#parent_merchant_item_id ⇒ Object
If this item is a kit component, this is the item id of the parent item (kit)
131 132 133 |
# File 'lib/ultracart_api/models/order_item.rb', line 131 def parent_merchant_item_id @parent_merchant_item_id end |
#perishable_class ⇒ Object
Perishable class of the item
134 135 136 |
# File 'lib/ultracart_api/models/order_item.rb', line 134 def perishable_class @perishable_class end |
#pricing_tier_name ⇒ Object
Pricing tier that granted the particular price for this item if the customer profile had pricing tiers assigned
137 138 139 |
# File 'lib/ultracart_api/models/order_item.rb', line 137 def pricing_tier_name @pricing_tier_name end |
#properties ⇒ Object
Properties
140 141 142 |
# File 'lib/ultracart_api/models/order_item.rb', line 140 def properties @properties end |
#quantity ⇒ Object
Quantity
143 144 145 |
# File 'lib/ultracart_api/models/order_item.rb', line 143 def quantity @quantity end |
#quantity_refunded ⇒ Object
Quantity refunded on this item (read only except refund operation)
146 147 148 |
# File 'lib/ultracart_api/models/order_item.rb', line 146 def quantity_refunded @quantity_refunded end |
#quickbooks_class ⇒ Object
QuickBooks class
149 150 151 |
# File 'lib/ultracart_api/models/order_item.rb', line 149 def quickbooks_class @quickbooks_class end |
#refund_reason ⇒ Object
Refund reason code. This can only be written during a refund operation otherwise this field is read only.
152 153 154 |
# File 'lib/ultracart_api/models/order_item.rb', line 152 def refund_reason @refund_reason end |
#return_reason ⇒ Object
Return 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 return_reason @return_reason end |
#ship_separately ⇒ Object
True if this item ships in a separate box
158 159 160 |
# File 'lib/ultracart_api/models/order_item.rb', line 158 def ship_separately @ship_separately end |
#shipped_by_user ⇒ Object
Shipped by user
161 162 163 |
# File 'lib/ultracart_api/models/order_item.rb', line 161 def shipped_by_user @shipped_by_user end |
#shipped_dts ⇒ Object
Date/time that this item was marked shipped
164 165 166 |
# File 'lib/ultracart_api/models/order_item.rb', line 164 def shipped_dts @shipped_dts end |
#shipping_status ⇒ Object
Shipping status for this item. This is the replacement for the old order level shipping status.
167 168 169 |
# File 'lib/ultracart_api/models/order_item.rb', line 167 def shipping_status @shipping_status end |
#special_product_type ⇒ Object
Special product type (USPS Media Mail)
170 171 172 |
# File 'lib/ultracart_api/models/order_item.rb', line 170 def special_product_type @special_product_type end |
#tags ⇒ Object
Tags
173 174 175 |
# File 'lib/ultracart_api/models/order_item.rb', line 173 def end |
#tax_free ⇒ Object
True if the item is tax free
176 177 178 |
# File 'lib/ultracart_api/models/order_item.rb', line 176 def tax_free @tax_free end |
#tax_product_type ⇒ Object
Type of product for tax purposes (self or UltraCart Managed taxes)
179 180 181 |
# File 'lib/ultracart_api/models/order_item.rb', line 179 def tax_product_type @tax_product_type end |
#taxable_cost ⇒ Object
Returns the value of attribute taxable_cost.
181 182 183 |
# File 'lib/ultracart_api/models/order_item.rb', line 181 def taxable_cost @taxable_cost end |
#total_cost_with_discount ⇒ Object
Returns the value of attribute total_cost_with_discount.
183 184 185 |
# File 'lib/ultracart_api/models/order_item.rb', line 183 def total_cost_with_discount @total_cost_with_discount end |
#total_refunded ⇒ Object
Returns the value of attribute total_refunded.
185 186 187 |
# File 'lib/ultracart_api/models/order_item.rb', line 185 def total_refunded @total_refunded end |
#transmitted_to_distribution_center_dts ⇒ Object
Date/time that this item was transmitted to the distribution center
188 189 190 |
# File 'lib/ultracart_api/models/order_item.rb', line 188 def transmitted_to_distribution_center_dts @transmitted_to_distribution_center_dts end |
#unit_cost_with_discount ⇒ Object
Returns the value of attribute unit_cost_with_discount.
190 191 192 |
# File 'lib/ultracart_api/models/order_item.rb', line 190 def unit_cost_with_discount @unit_cost_with_discount end |
#upsell ⇒ Object
True if this item was added to the order as part of an upsell
193 194 195 |
# File 'lib/ultracart_api/models/order_item.rb', line 193 def upsell @upsell end |
#weight ⇒ Object
Returns the value of attribute weight.
195 196 197 |
# File 'lib/ultracart_api/models/order_item.rb', line 195 def weight @weight end |
#width ⇒ Object
Returns the value of attribute width.
197 198 199 |
# File 'lib/ultracart_api/models/order_item.rb', line 197 def width @width end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 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 |
# File 'lib/ultracart_api/models/order_item.rb', line 222 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', :'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 |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/ultracart_api/models/order_item.rb', line 293 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', :'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.
832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 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 |
# File 'lib/ultracart_api/models/order_item.rb', line 832 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 && == o. && == o. && == o. && == o. && == o. && 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 && == o. && 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 && == o. && 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
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 |
# File 'lib/ultracart_api/models/order_item.rb', line 938 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
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 |
# File 'lib/ultracart_api/models/order_item.rb', line 1004 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
917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 |
# File 'lib/ultracart_api/models/order_item.rb', line 917 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
904 905 906 |
# File 'lib/ultracart_api/models/order_item.rb', line 904 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
910 911 912 |
# File 'lib/ultracart_api/models/order_item.rb', line 910 def hash [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, , , , , , 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, , 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, , 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_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 682 683 684 685 686 687 688 689 |
# File 'lib/ultracart_api/models/order_item.rb', line 642 def list_invalid_properties invalid_properties = Array.new if !.nil? && .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 !.nil? && .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 !.nil? && .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 !.nil? && .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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
984 985 986 |
# File 'lib/ultracart_api/models/order_item.rb', line 984 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
990 991 992 993 994 995 996 997 998 |
# File 'lib/ultracart_api/models/order_item.rb', line 990 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_s ⇒ String
Returns the string representation of the object
978 979 980 |
# File 'lib/ultracart_api/models/order_item.rb', line 978 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/ultracart_api/models/order_item.rb', line 693 def valid? return false if !.nil? && .to_s.length > 12 return false if !.nil? && .to_s.length > 14 return false if !.nil? && .to_s.length > 11 return false if !.nil? && .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 |