Class: Io::Flow::V0::Models::PriceDetailComponentKey

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) ⇒ PriceDetailComponentKey

Returns a new instance of PriceDetailComponentKey.



14951
14952
14953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14951

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14949
14950
14951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14949

def value
  @value
end

Class Method Details

.ALLObject



14971
14972
14973
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14971

def PriceDetailComponentKey.ALL
  @@all ||= [PriceDetailComponentKey.base_price, PriceDetailComponentKey.discount, PriceDetailComponentKey.currency_margin, PriceDetailComponentKey.percent_item_margin, PriceDetailComponentKey.fixed_item_margin, PriceDetailComponentKey.duties_item_price, PriceDetailComponentKey.duties_added_margin, PriceDetailComponentKey.duties_rounding, PriceDetailComponentKey.duties_deminimis, PriceDetailComponentKey.vat_item_price, PriceDetailComponentKey.vat_added_margin, PriceDetailComponentKey.vat_rounding, PriceDetailComponentKey.vat_duties_item_price, PriceDetailComponentKey.vat_duties_added_margin, PriceDetailComponentKey.vat_duties_rounding, PriceDetailComponentKey.vat_deminimis, PriceDetailComponentKey.item_price_percent_sales_margin, PriceDetailComponentKey.margins_percent_sales_margin, PriceDetailComponentKey.rounding_percent_sales_margin, PriceDetailComponentKey.vat_percent_sales_margin, PriceDetailComponentKey.vat_duty_percent_sales_margin, PriceDetailComponentKey.duty_percent_sales_margin]
end

.apply(value) ⇒ Object

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



14956
14957
14958
14959
14960
14961
14962
14963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14956

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

.base_priceObject

The base price of the item.



14976
14977
14978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14976

def PriceDetailComponentKey.base_price
  @@_base_price ||= PriceDetailComponentKey.new('base_price')
end

.currency_marginObject

The amount added to the post-discount item price due to FX markup, as configured in the organization’s currency settings.



14987
14988
14989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14987

def PriceDetailComponentKey.currency_margin
  @@_currency_margin ||= PriceDetailComponentKey.new('currency_margin')
end

.discountObject

A discount applied to the base price of the item.



14981
14982
14983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14981

def PriceDetailComponentKey.discount
  @@_discount ||= PriceDetailComponentKey.new('discount')
end

.duties_added_marginObject

The duty owed on the sum of the currency margin, percent item margin, and fixed item margin.



15010
15011
15012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15010

def PriceDetailComponentKey.duties_added_margin
  @@_duties_added_margin ||= PriceDetailComponentKey.new('duties_added_margin')
end

.duties_deminimisObject

An adjustment made if the item does not meet the duty de minimis rule.



15020
15021
15022
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15020

def PriceDetailComponentKey.duties_deminimis
  @@_duties_deminimis ||= PriceDetailComponentKey.new('duties_deminimis')
end

.duties_item_priceObject

The duty owed on the post-discount base item price.



15004
15005
15006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15004

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

.duties_roundingObject

The duty owed on any rounding applied to the total item price.



15015
15016
15017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15015

def PriceDetailComponentKey.duties_rounding
  @@_duties_rounding ||= PriceDetailComponentKey.new('duties_rounding')
end

.duty_percent_sales_marginObject

An adjustment made to duty owed as a result of a percent sales margin.



15088
15089
15090
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15088

def PriceDetailComponentKey.duty_percent_sales_margin
  @@_duty_percent_sales_margin ||= PriceDetailComponentKey.new('duty_percent_sales_margin')
end

.fixed_item_marginObject

The amount added to the post-discount item price from a fixed item margin. Negative amounts represent discounts.



14999
15000
15001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14999

def PriceDetailComponentKey.fixed_item_margin
  @@_fixed_item_margin ||= PriceDetailComponentKey.new('fixed_item_margin')
end

.from_string(value) ⇒ Object

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



14966
14967
14968
14969
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14966

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

.item_price_percent_sales_marginObject

An adjustment made to the item price as a result of a percent sales margin.



15062
15063
15064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15062

def PriceDetailComponentKey.item_price_percent_sales_margin
  @@_item_price_percent_sales_margin ||= PriceDetailComponentKey.new('item_price_percent_sales_margin')
end

.margins_percent_sales_marginObject

An adjustment made to the item margins as a result of a percent sales margin.



15067
15068
15069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15067

def PriceDetailComponentKey.margins_percent_sales_margin
  @@_margins_percent_sales_margin ||= PriceDetailComponentKey.new('margins_percent_sales_margin')
end

.percent_item_marginObject

The amount added to the post-discount item price from a percent item margin. Negative amounts represent discounts.



14993
14994
14995
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14993

def PriceDetailComponentKey.percent_item_margin
  @@_percent_item_margin ||= PriceDetailComponentKey.new('percent_item_margin')
end

.rounding_percent_sales_marginObject

An adjustment made to rounding as a result of a percent sales margin.



15072
15073
15074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15072

def PriceDetailComponentKey.rounding_percent_sales_margin
  @@_rounding_percent_sales_margin ||= PriceDetailComponentKey.new('rounding_percent_sales_margin')
end

.vat_added_marginObject

The VAT owed on the sum of the currency margin, percent item margin, and fixed item margin.



15031
15032
15033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15031

def PriceDetailComponentKey.vat_added_margin
  @@_vat_added_margin ||= PriceDetailComponentKey.new('vat_added_margin')
end

.vat_deminimisObject

An adjustment made if the item does not meet the VAT de minimis rule.



15057
15058
15059
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15057

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

.vat_duties_added_marginObject

The VAT owed on the duty owed on the sum of the currency margin, percent item margin, and fixed item margin.



15047
15048
15049
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15047

def PriceDetailComponentKey.vat_duties_added_margin
  @@_vat_duties_added_margin ||= PriceDetailComponentKey.new('vat_duties_added_margin')
end

.vat_duties_item_priceObject

The VAT owed on the duty owed on the post-discount base item price.



15041
15042
15043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15041

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

.vat_duties_roundingObject

The VAT owed on the duty owed on any rounding applied to the total item price.



15052
15053
15054
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15052

def PriceDetailComponentKey.vat_duties_rounding
  @@_vat_duties_rounding ||= PriceDetailComponentKey.new('vat_duties_rounding')
end

.vat_duty_percent_sales_marginObject

An adjustment made to VAT on duties (e.g. VAT on duties on item price) owed as a result of a percent sales margin.



15083
15084
15085
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15083

def PriceDetailComponentKey.vat_duty_percent_sales_margin
  @@_vat_duty_percent_sales_margin ||= PriceDetailComponentKey.new('vat_duty_percent_sales_margin')
end

.vat_item_priceObject

The VAT owed on the post-discount base item price.



15025
15026
15027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15025

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

.vat_percent_sales_marginObject

An adjustment made to VAT owed as a result of a percent sales margin.



15077
15078
15079
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15077

def PriceDetailComponentKey.vat_percent_sales_margin
  @@_vat_percent_sales_margin ||= PriceDetailComponentKey.new('vat_percent_sales_margin')
end

.vat_roundingObject

The VAT owed on any rounding applied to the total item price.



15036
15037
15038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15036

def PriceDetailComponentKey.vat_rounding
  @@_vat_rounding ||= PriceDetailComponentKey.new('vat_rounding')
end

Instance Method Details

#to_hashObject



15092
15093
15094
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15092

def to_hash
  value
end