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.



16980
16981
16982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16980

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16978
16979
16980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16978

def value
  @value
end

Class Method Details

.ALLObject



17000
17001
17002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000

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



16985
16986
16987
16988
16989
16990
16991
16992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16985

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.



17005
17006
17007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17005

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.



17016
17017
17018
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17016

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

.discountObject

A discount applied to the base price of the item.



17010
17011
17012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17010

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.



17039
17040
17041
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17039

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.



17049
17050
17051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17049

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

.duties_item_priceObject

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



17033
17034
17035
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17033

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.



17044
17045
17046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17044

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.



17117
17118
17119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17117

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.



17028
17029
17030
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17028

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



16995
16996
16997
16998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16995

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.



17091
17092
17093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17091

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.



17096
17097
17098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17096

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.



17022
17023
17024
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17022

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.



17101
17102
17103
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17101

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.



17060
17061
17062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17060

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.



17086
17087
17088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17086

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.



17076
17077
17078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17076

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.



17070
17071
17072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17070

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.



17081
17082
17083
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17081

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.



17112
17113
17114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17112

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.



17054
17055
17056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17054

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.



17106
17107
17108
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17106

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.



17065
17066
17067
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17065

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

Instance Method Details

#to_hashObject



17121
17122
17123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17121

def to_hash
  value
end