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.



6666
6667
6668
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6666

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6664
6665
6666
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6664

def value
  @value
end

Class Method Details

.apply(value) ⇒ Object

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



6671
6672
6673
6674
6675
6676
6677
6678
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6671

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.



6691
6692
6693
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6691

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

.currency_marginObject

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



6702
6703
6704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6702

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

.discountObject

A discount applied to the item.



6696
6697
6698
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6696

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.



6724
6725
6726
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6724

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.



6734
6735
6736
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6734

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

.duties_item_priceObject

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



6718
6719
6720
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6718

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.



6729
6730
6731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6729

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

.fixed_item_marginObject

The amount added to the total item price from the fixed margin, if applicable.



6713
6714
6715
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6713

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



6681
6682
6683
6684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6681

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

.percent_item_marginObject

The amount added to the total item price from the percent margin, if applicable.



6708
6709
6710
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6708

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

.vat_added_marginObject

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



6745
6746
6747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6745

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.



6771
6772
6773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6771

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.



6761
6762
6763
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6761

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.



6755
6756
6757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6755

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.



6766
6767
6768
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6766

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

.vat_item_priceObject

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



6739
6740
6741
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6739

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

.vat_roundingObject

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



6750
6751
6752
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6750

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

Instance Method Details

#to_hashObject



6775
6776
6777
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6775

def to_hash
  value
end