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.



18021
18022
18023
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18021

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18019
18020
18021
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18019

def value
  @value
end

Class Method Details

.adjustmentObject

A general purpose adjustment applied to the order.



18046
18047
18048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18046

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

.ALLObject



18041
18042
18043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18041

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.item_discount, 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, OrderPriceDetailComponentKey.remote_area_surcharge, OrderPriceDetailComponentKey.fuel_surcharge, OrderPriceDetailComponentKey.emergency_situation_surcharge]
end

.apply(value) ⇒ Object

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



18026
18027
18028
18029
18030
18031
18032
18033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18026

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.



18067
18068
18069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18067

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

.duties_insuranceObject

The duty owed on the insurance cost of the order.



18072
18073
18074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18072

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

.duties_item_priceObject

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



18062
18063
18064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18062

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.



18056
18057
18058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18056

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.



18167
18168
18169
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18167

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

.emergency_situation_surchargeObject

Surcharge applied to a shipment during emergency circumstances, such as covid19.



18184
18185
18186
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18184

def OrderPriceDetailComponentKey.emergency_situation_surcharge
  @@_emergency_situation_surcharge ||= OrderPriceDetailComponentKey.new('emergency_situation_surcharge')
end

.from_string(value) ⇒ Object

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



18036
18037
18038
18039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18036

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

.fuel_surchargeObject

Surcharge applied to a shipment for fuel consumption by the carrier.



18178
18179
18180
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18178

def OrderPriceDetailComponentKey.fuel_surcharge
  @@_fuel_surcharge ||= OrderPriceDetailComponentKey.new('fuel_surcharge')
end

.insuranceObject

The insurance cost for the order.



18125
18126
18127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18125

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

.item_discountObject

The sum of all discounts applied to the order’s items.



18115
18116
18117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18115

def OrderPriceDetailComponentKey.item_discount
  @@_item_discount ||= OrderPriceDetailComponentKey.new('item_discount')
end

.item_priceObject

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



18110
18111
18112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18110

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

.order_discountObject

A discount applied to the entire order.



18135
18136
18137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18135

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

.remote_area_surchargeObject

Surcharge applied to a shipment for delivery to a remote area determined by the carrier.



18173
18174
18175
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18173

def OrderPriceDetailComponentKey.remote_area_surcharge
  @@_remote_area_surcharge ||= OrderPriceDetailComponentKey.new('remote_area_surcharge')
end

.roundingObject

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



18120
18121
18122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18120

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

.shippingObject

The shipping cost for the order.



18130
18131
18132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18130

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.



18151
18152
18153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18151

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.



18141
18142
18143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18141

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.



18146
18147
18148
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18146

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.



18051
18052
18053
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18051

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.



18099
18100
18101
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18099

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.



18104
18105
18106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18104

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.



18094
18095
18096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18094

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.



18083
18084
18085
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18083

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

.vat_insuranceObject

The VAT owed on the insurance cost of the order.



18088
18089
18090
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18088

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.



18078
18079
18080
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18078

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.



18159
18160
18161
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18159

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

Instance Method Details

#to_hashObject



18188
18189
18190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18188

def to_hash
  value
end