class Io::Flow::V0::Models::PriceDetailKey

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25377
def PriceDetailKey.ALL
  @@all ||= [PriceDetailKey.item_price, PriceDetailKey.margins, PriceDetailKey.vat, PriceDetailKey.duty, PriceDetailKey.rounding, PriceDetailKey.adjustment]
end
adjustment() click to toggle source

The details of any price adjustments due to sales margins. A negative value indicates a discount.

# File lib/flow_commerce/flow_api_v0_client.rb, line 25408
def PriceDetailKey.adjustment
  @@_adjustment ||= PriceDetailKey.new('adjustment')
end
apply(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 25362
def PriceDetailKey.apply(value)
  if value.instance_of?(PriceDetailKey)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PriceDetailKey.new(value))
  end
end
duty() click to toggle source

The details of any duties owed on the item.

# File lib/flow_commerce/flow_api_v0_client.rb, line 25397
def PriceDetailKey.duty
  @@_duty ||= PriceDetailKey.new('duty')
end
from_string(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 25372
def PriceDetailKey.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PriceDetailKey.ALL.find { |v| v.value == value }
end
item_price() click to toggle source

The details of the item price.

# File lib/flow_commerce/flow_api_v0_client.rb, line 25382
def PriceDetailKey.item_price
  @@_item_price ||= PriceDetailKey.new('item_price')
end
margins() click to toggle source

The details of any margins added to the item price.

# File lib/flow_commerce/flow_api_v0_client.rb, line 25387
def PriceDetailKey.margins
  @@_margins ||= PriceDetailKey.new('margins')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25357
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
rounding() click to toggle source

The details of any rounding added to the item.

# File lib/flow_commerce/flow_api_v0_client.rb, line 25402
def PriceDetailKey.rounding
  @@_rounding ||= PriceDetailKey.new('rounding')
end
vat() click to toggle source

The details of any VAT owed on the item.

# File lib/flow_commerce/flow_api_v0_client.rb, line 25392
def PriceDetailKey.vat
  @@_vat ||= PriceDetailKey.new('vat')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25412
def to_hash
  value
end