Class: Io::Flow::V0::Models::OrderPriceDetailComponentKey

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ OrderPriceDetailComponentKey

Returns a new instance of OrderPriceDetailComponentKey.



9422
9423
9424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9422

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9420
9421
9422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9420

def value
  @value
end

Class Method Details

.adjustmentObject

A general purpose adjustment applied to the order.



9447
9448
9449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9447

def OrderPriceDetailComponentKey.adjustment
  @@_adjustment ||= OrderPriceDetailComponentKey.new('adjustment')
end

.ALLObject



9442
9443
9444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9442

def OrderPriceDetailComponentKey.ALL
  @@all ||= [OrderPriceDetailComponentKey.adjustment, OrderPriceDetailComponentKey.vat_deminimis, OrderPriceDetailComponentKey.duty_deminimis, OrderPriceDetailComponentKey.duties_item_price, OrderPriceDetailComponentKey.duties_freight, OrderPriceDetailComponentKey.duties_insurance, OrderPriceDetailComponentKey.vat_item_price, OrderPriceDetailComponentKey.vat_freight, OrderPriceDetailComponentKey.vat_insurance, OrderPriceDetailComponentKey.vat_duties_item_price, OrderPriceDetailComponentKey.vat_duties_freight, OrderPriceDetailComponentKey.vat_duties_insurance, OrderPriceDetailComponentKey.item_price, OrderPriceDetailComponentKey.rounding, OrderPriceDetailComponentKey.insurance, OrderPriceDetailComponentKey.shipping, OrderPriceDetailComponentKey.order_discount, OrderPriceDetailComponentKey.subtotal_percent_sales_margin, OrderPriceDetailComponentKey.subtotal_vat_percent_sales_margin, OrderPriceDetailComponentKey.subtotal_duty_percent_sales_margin, OrderPriceDetailComponentKey.vat_subsidy, OrderPriceDetailComponentKey.duty_subsidy]
end

.apply(value) ⇒ Object

Returns the instance of OrderPriceDetailComponentKey for this value, creating a new instance for an unknown value



9427
9428
9429
9430
9431
9432
9433
9434
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9427

def OrderPriceDetailComponentKey.apply(value)
  if value.instance_of?(OrderPriceDetailComponentKey)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || OrderPriceDetailComponentKey.new(value))
  end
end

.duties_freightObject

The duty owed on the freight cost of the order.



9468
9469
9470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9468

def OrderPriceDetailComponentKey.duties_freight
  @@_duties_freight ||= OrderPriceDetailComponentKey.new('duties_freight')
end

.duties_insuranceObject

The duty owed on the insurance cost of the order.



9473
9474
9475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9473

def OrderPriceDetailComponentKey.duties_insurance
  @@_duties_insurance ||= OrderPriceDetailComponentKey.new('duties_insurance')
end

.duties_item_priceObject

The VAT owed on the price of the order’s items, including any added margins and rounding.



9463
9464
9465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9463

def OrderPriceDetailComponentKey.duties_item_price
  @@_duties_item_price ||= OrderPriceDetailComponentKey.new('duties_item_price')
end

.duty_deminimisObject

An adjustment based on whether the duty de minimis applies to the order.



9457
9458
9459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9457

def OrderPriceDetailComponentKey.duty_deminimis
  @@_duty_deminimis ||= OrderPriceDetailComponentKey.new('duty_deminimis')
end

.duty_subsidyObject

An offset to account for any duty subsidized by the organization. For example, if duty is included in an item price and changes at the order level (due to passing de minimis threshold, or the destination having a more specific duty rate), the difference will be represented here.



9563
9564
9565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9563

def OrderPriceDetailComponentKey.duty_subsidy
  @@_duty_subsidy ||= OrderPriceDetailComponentKey.new('duty_subsidy')
end

.from_string(value) ⇒ Object

Returns the instance of OrderPriceDetailComponentKey for this value, or nil if not found



9437
9438
9439
9440
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9437

def OrderPriceDetailComponentKey.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  OrderPriceDetailComponentKey.ALL.find { |v| v.value == value }
end

.insuranceObject

The insurance cost for the order.



9521
9522
9523
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9521

def OrderPriceDetailComponentKey.insurance
  @@_insurance ||= OrderPriceDetailComponentKey.new('insurance')
end

.item_priceObject

The sum of the price of the order’s items with their currency margins, percent margins, and fixed margins included.



9511
9512
9513
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9511

def OrderPriceDetailComponentKey.item_price
  @@_item_price ||= OrderPriceDetailComponentKey.new('item_price')
end

.order_discountObject

A discount applied to the entire order.



9531
9532
9533
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9531

def OrderPriceDetailComponentKey.order_discount
  @@_order_discount ||= OrderPriceDetailComponentKey.new('order_discount')
end

.roundingObject

The sum of any rounding applied to the order’s items.



9516
9517
9518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9516

def OrderPriceDetailComponentKey.rounding
  @@_rounding ||= OrderPriceDetailComponentKey.new('rounding')
end

.shippingObject

The shipping cost for the order.



9526
9527
9528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9526

def OrderPriceDetailComponentKey.shipping
  @@_shipping ||= OrderPriceDetailComponentKey.new('shipping')
end

.subtotal_duty_percent_sales_marginObject

The sum of adjustments to duty owed made due to percentage sales margins.



9547
9548
9549
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9547

def OrderPriceDetailComponentKey.subtotal_duty_percent_sales_margin
  @@_subtotal_duty_percent_sales_margin ||= OrderPriceDetailComponentKey.new('subtotal_duty_percent_sales_margin')
end

.subtotal_percent_sales_marginObject

The sum of adjustments to item price, margin and rounding made due to percentage sales margins.



9537
9538
9539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9537

def OrderPriceDetailComponentKey.subtotal_percent_sales_margin
  @@_subtotal_percent_sales_margin ||= OrderPriceDetailComponentKey.new('subtotal_percent_sales_margin')
end

.subtotal_vat_percent_sales_marginObject

The sum of adjustments to VAT owed made due to percentage sales margins.



9542
9543
9544
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9542

def OrderPriceDetailComponentKey.subtotal_vat_percent_sales_margin
  @@_subtotal_vat_percent_sales_margin ||= OrderPriceDetailComponentKey.new('subtotal_vat_percent_sales_margin')
end

.vat_deminimisObject

An adjustment based on whether the VAT de minimis applies to the order.



9452
9453
9454
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9452

def OrderPriceDetailComponentKey.vat_deminimis
  @@_vat_deminimis ||= OrderPriceDetailComponentKey.new('vat_deminimis')
end

.vat_duties_freightObject

The VAT owed on the duties on the freight cost of the order.



9500
9501
9502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9500

def OrderPriceDetailComponentKey.vat_duties_freight
  @@_vat_duties_freight ||= OrderPriceDetailComponentKey.new('vat_duties_freight')
end

.vat_duties_insuranceObject

The VAT owed on the duties on the insurance cost of the order.



9505
9506
9507
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9505

def OrderPriceDetailComponentKey.vat_duties_insurance
  @@_vat_duties_insurance ||= OrderPriceDetailComponentKey.new('vat_duties_insurance')
end

.vat_duties_item_priceObject

The VAT owed on the duties on the price of the order’s items, including any added margins and rounding.



9495
9496
9497
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9495

def OrderPriceDetailComponentKey.vat_duties_item_price
  @@_vat_duties_item_price ||= OrderPriceDetailComponentKey.new('vat_duties_item_price')
end

.vat_freightObject

The VAT owed on the freight cost of the order.



9484
9485
9486
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9484

def OrderPriceDetailComponentKey.vat_freight
  @@_vat_freight ||= OrderPriceDetailComponentKey.new('vat_freight')
end

.vat_insuranceObject

The VAT owed on the insurance cost of the order.



9489
9490
9491
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9489

def OrderPriceDetailComponentKey.vat_insurance
  @@_vat_insurance ||= OrderPriceDetailComponentKey.new('vat_insurance')
end

.vat_item_priceObject

The VAT owed on the price of the order’s items, including any added margins and rounding.



9479
9480
9481
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9479

def OrderPriceDetailComponentKey.vat_item_price
  @@_vat_item_price ||= OrderPriceDetailComponentKey.new('vat_item_price')
end

.vat_subsidyObject

An offset to account for any VAT subsidized by the organization. For example, if VAT is included in an item price and changes at the order level (due to passing de minimis threshold, or the destination having a more specific VAT rate), the difference will be represented here.



9555
9556
9557
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9555

def OrderPriceDetailComponentKey.vat_subsidy
  @@_vat_subsidy ||= OrderPriceDetailComponentKey.new('vat_subsidy')
end

Instance Method Details

#to_hashObject



9567
9568
9569
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9567

def to_hash
  value
end