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.



11056
11057
11058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11056

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11054
11055
11056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11054

def value
  @value
end

Class Method Details

.adjustmentObject

A general purpose adjustment applied to the order.



11081
11082
11083
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11081

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

.apply(value) ⇒ Object

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



11061
11062
11063
11064
11065
11066
11067
11068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11061

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.



11102
11103
11104
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11102

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

.duties_insuranceObject

The duty owed on the insurance cost of the order.



11107
11108
11109
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11107

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.



11097
11098
11099
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11097

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.



11091
11092
11093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11091

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.



11202
11203
11204
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11202

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



11071
11072
11073
11074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11071

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.



11160
11161
11162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11160

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

.item_discountObject

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



11150
11151
11152
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11150

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.



11145
11146
11147
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11145

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

.order_discountObject

A discount applied to the entire order.



11170
11171
11172
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11170

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

.roundingObject

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



11155
11156
11157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11155

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

.shippingObject

The shipping cost for the order.



11165
11166
11167
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11165

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.



11186
11187
11188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11186

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.



11176
11177
11178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11176

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.



11181
11182
11183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11181

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.



11086
11087
11088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11086

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.



11134
11135
11136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11134

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.



11139
11140
11141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11139

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.



11129
11130
11131
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11129

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.



11118
11119
11120
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11118

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

.vat_insuranceObject

The VAT owed on the insurance cost of the order.



11123
11124
11125
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11123

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.



11113
11114
11115
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11113

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.



11194
11195
11196
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11194

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

Instance Method Details

#to_hashObject



11206
11207
11208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11206

def to_hash
  value
end