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.



9855
9856
9857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9855

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9853
9854
9855
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9853

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



9860
9861
9862
9863
9864
9865
9866
9867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9860

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.



9880
9881
9882
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9880

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.



9891
9892
9893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9891

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

.discountObject

A discount applied to the base price of the item.



9885
9886
9887
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9885

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.



9914
9915
9916
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9914

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.



9924
9925
9926
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9924

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

.duties_item_priceObject

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



9908
9909
9910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9908

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.



9919
9920
9921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9919

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.



9992
9993
9994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9992

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.



9903
9904
9905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9903

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



9870
9871
9872
9873
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9870

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.



9966
9967
9968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9966

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.



9971
9972
9973
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9971

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.



9897
9898
9899
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9897

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.



9976
9977
9978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9976

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.



9935
9936
9937
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9935

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.



9961
9962
9963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9961

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.



9951
9952
9953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9951

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.



9945
9946
9947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9945

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.



9956
9957
9958
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9956

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.



9987
9988
9989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9987

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.



9929
9930
9931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9929

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.



9981
9982
9983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9981

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.



9940
9941
9942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9940

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

Instance Method Details

#to_hashObject



9996
9997
9998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9996

def to_hash
  value
end