Class: Io::Flow::V0::Models::PriceDetailComponentKey
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PriceDetailComponentKey
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of PriceDetailComponentKey for this value, creating a new instance for an unknown value.
-
.base_price ⇒ Object
The base price of the item.
-
.currency_margin ⇒ Object
The amount added to the post-discount item price due to FX markup, as configured in the organization’s currency settings.
-
.discount ⇒ Object
A discount applied to the base price of the item.
-
.duties_added_margin ⇒ Object
The duty owed on the sum of the currency margin, percent item margin, and fixed item margin.
-
.duties_deminimis ⇒ Object
An adjustment made if the item does not meet the duty de minimis rule.
-
.duties_item_price ⇒ Object
The duty owed on the post-discount base item price.
-
.duties_rounding ⇒ Object
The duty owed on any rounding applied to the total item price.
-
.duty_percent_sales_margin ⇒ Object
An adjustment made to duty owed as a result of a percent sales margin.
-
.fixed_item_margin ⇒ Object
The amount added to the post-discount item price from a fixed item margin.
-
.from_string(value) ⇒ Object
Returns the instance of PriceDetailComponentKey for this value, or nil if not found.
-
.item_price_percent_sales_margin ⇒ Object
An adjustment made to the item price as a result of a percent sales margin.
-
.margins_percent_sales_margin ⇒ Object
An adjustment made to the item margins as a result of a percent sales margin.
-
.percent_item_margin ⇒ Object
The amount added to the post-discount item price from a percent item margin.
-
.rounding_percent_sales_margin ⇒ Object
An adjustment made to rounding as a result of a percent sales margin.
-
.vat_added_margin ⇒ Object
The VAT owed on the sum of the currency margin, percent item margin, and fixed item margin.
-
.vat_deminimis ⇒ Object
An adjustment made if the item does not meet the VAT de minimis rule.
-
.vat_duties_added_margin ⇒ Object
The VAT owed on the duty owed on the sum of the currency margin, percent item margin, and fixed item margin.
-
.vat_duties_item_price ⇒ Object
The VAT owed on the duty owed on the post-discount base item price.
-
.vat_duties_rounding ⇒ Object
The VAT owed on the duty owed on any rounding applied to the total item price.
-
.vat_duty_percent_sales_margin ⇒ Object
An adjustment made to VAT on duties (e.g. VAT on duties on item price) owed as a result of a percent sales margin.
-
.vat_item_price ⇒ Object
The VAT owed on the post-discount base item price.
-
.vat_percent_sales_margin ⇒ Object
An adjustment made to VAT owed as a result of a percent sales margin.
-
.vat_rounding ⇒ Object
The VAT owed on any rounding applied to the total item price.
Instance Method Summary collapse
-
#initialize(value) ⇒ PriceDetailComponentKey
constructor
A new instance of PriceDetailComponentKey.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PriceDetailComponentKey
Returns a new instance of PriceDetailComponentKey.
8414 8415 8416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8414 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8412 8413 8414 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8412 def value @value end |
Class Method Details
.ALL ⇒ Object
8434 8435 8436 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8434 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
8419 8420 8421 8422 8423 8424 8425 8426 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8419 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_price ⇒ Object
The base price of the item.
8439 8440 8441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8439 def PriceDetailComponentKey.base_price @@_base_price ||= PriceDetailComponentKey.new('base_price') end |
.currency_margin ⇒ Object
The amount added to the post-discount item price due to FX markup, as configured in the organization’s currency settings.
8450 8451 8452 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8450 def PriceDetailComponentKey.currency_margin @@_currency_margin ||= PriceDetailComponentKey.new('currency_margin') end |
.discount ⇒ Object
A discount applied to the base price of the item.
8444 8445 8446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8444 def PriceDetailComponentKey.discount @@_discount ||= PriceDetailComponentKey.new('discount') end |
.duties_added_margin ⇒ Object
The duty owed on the sum of the currency margin, percent item margin, and fixed item margin.
8473 8474 8475 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8473 def PriceDetailComponentKey.duties_added_margin @@_duties_added_margin ||= PriceDetailComponentKey.new('duties_added_margin') end |
.duties_deminimis ⇒ Object
An adjustment made if the item does not meet the duty de minimis rule.
8483 8484 8485 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8483 def PriceDetailComponentKey.duties_deminimis @@_duties_deminimis ||= PriceDetailComponentKey.new('duties_deminimis') end |
.duties_item_price ⇒ Object
The duty owed on the post-discount base item price.
8467 8468 8469 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8467 def PriceDetailComponentKey.duties_item_price @@_duties_item_price ||= PriceDetailComponentKey.new('duties_item_price') end |
.duties_rounding ⇒ Object
The duty owed on any rounding applied to the total item price.
8478 8479 8480 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8478 def PriceDetailComponentKey.duties_rounding @@_duties_rounding ||= PriceDetailComponentKey.new('duties_rounding') end |
.duty_percent_sales_margin ⇒ Object
An adjustment made to duty owed as a result of a percent sales margin.
8551 8552 8553 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8551 def PriceDetailComponentKey.duty_percent_sales_margin @@_duty_percent_sales_margin ||= PriceDetailComponentKey.new('duty_percent_sales_margin') end |
.fixed_item_margin ⇒ Object
The amount added to the post-discount item price from a fixed item margin. Negative amounts represent discounts.
8462 8463 8464 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8462 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
8429 8430 8431 8432 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8429 def PriceDetailComponentKey.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PriceDetailComponentKey.ALL.find { |v| v.value == value } end |
.item_price_percent_sales_margin ⇒ Object
An adjustment made to the item price as a result of a percent sales margin.
8525 8526 8527 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8525 def PriceDetailComponentKey.item_price_percent_sales_margin @@_item_price_percent_sales_margin ||= PriceDetailComponentKey.new('item_price_percent_sales_margin') end |
.margins_percent_sales_margin ⇒ Object
An adjustment made to the item margins as a result of a percent sales margin.
8530 8531 8532 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8530 def PriceDetailComponentKey.margins_percent_sales_margin @@_margins_percent_sales_margin ||= PriceDetailComponentKey.new('margins_percent_sales_margin') end |
.percent_item_margin ⇒ Object
The amount added to the post-discount item price from a percent item margin. Negative amounts represent discounts.
8456 8457 8458 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8456 def PriceDetailComponentKey.percent_item_margin @@_percent_item_margin ||= PriceDetailComponentKey.new('percent_item_margin') end |
.rounding_percent_sales_margin ⇒ Object
An adjustment made to rounding as a result of a percent sales margin.
8535 8536 8537 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8535 def PriceDetailComponentKey.rounding_percent_sales_margin @@_rounding_percent_sales_margin ||= PriceDetailComponentKey.new('rounding_percent_sales_margin') end |
.vat_added_margin ⇒ Object
The VAT owed on the sum of the currency margin, percent item margin, and fixed item margin.
8494 8495 8496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8494 def PriceDetailComponentKey.vat_added_margin @@_vat_added_margin ||= PriceDetailComponentKey.new('vat_added_margin') end |
.vat_deminimis ⇒ Object
An adjustment made if the item does not meet the VAT de minimis rule.
8520 8521 8522 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8520 def PriceDetailComponentKey.vat_deminimis @@_vat_deminimis ||= PriceDetailComponentKey.new('vat_deminimis') end |
.vat_duties_added_margin ⇒ Object
The VAT owed on the duty owed on the sum of the currency margin, percent item margin, and fixed item margin.
8510 8511 8512 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8510 def PriceDetailComponentKey.vat_duties_added_margin @@_vat_duties_added_margin ||= PriceDetailComponentKey.new('vat_duties_added_margin') end |
.vat_duties_item_price ⇒ Object
The VAT owed on the duty owed on the post-discount base item price.
8504 8505 8506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8504 def PriceDetailComponentKey.vat_duties_item_price @@_vat_duties_item_price ||= PriceDetailComponentKey.new('vat_duties_item_price') end |
.vat_duties_rounding ⇒ Object
The VAT owed on the duty owed on any rounding applied to the total item price.
8515 8516 8517 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8515 def PriceDetailComponentKey.vat_duties_rounding @@_vat_duties_rounding ||= PriceDetailComponentKey.new('vat_duties_rounding') end |
.vat_duty_percent_sales_margin ⇒ Object
An adjustment made to VAT on duties (e.g. VAT on duties on item price) owed as a result of a percent sales margin.
8546 8547 8548 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8546 def PriceDetailComponentKey.vat_duty_percent_sales_margin @@_vat_duty_percent_sales_margin ||= PriceDetailComponentKey.new('vat_duty_percent_sales_margin') end |
.vat_item_price ⇒ Object
The VAT owed on the post-discount base item price.
8488 8489 8490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8488 def PriceDetailComponentKey.vat_item_price @@_vat_item_price ||= PriceDetailComponentKey.new('vat_item_price') end |
.vat_percent_sales_margin ⇒ Object
An adjustment made to VAT owed as a result of a percent sales margin.
8540 8541 8542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8540 def PriceDetailComponentKey.vat_percent_sales_margin @@_vat_percent_sales_margin ||= PriceDetailComponentKey.new('vat_percent_sales_margin') end |
.vat_rounding ⇒ Object
The VAT owed on any rounding applied to the total item price.
8499 8500 8501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8499 def PriceDetailComponentKey.vat_rounding @@_vat_rounding ||= PriceDetailComponentKey.new('vat_rounding') end |
Instance Method Details
#to_hash ⇒ Object
8555 8556 8557 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8555 def to_hash value end |