class Io::Flow::V0::Models::ItemAvailabilityStatus
Attributes
value[R]
Public Class Methods
ALL()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 21745 def ItemAvailabilityStatus.ALL @@all ||= [ItemAvailabilityStatus.available, ItemAvailabilityStatus.low, ItemAvailabilityStatus.out_of_stock] end
apply(value)
click to toggle source
Returns the instance of ItemAvailabilityStatus
for this value, creating a new instance for an unknown value
# File lib/flow_commerce/flow_api_v0_client.rb, line 21730 def ItemAvailabilityStatus.apply(value) if value.instance_of?(ItemAvailabilityStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ItemAvailabilityStatus.new(value)) end end
available()
click to toggle source
Inventory is generally available for purchase
# File lib/flow_commerce/flow_api_v0_client.rb, line 21750 def ItemAvailabilityStatus.available @@_available ||= ItemAvailabilityStatus.new('available') end
from_string(value)
click to toggle source
Returns the instance of ItemAvailabilityStatus
for this value, or nil if not found
# File lib/flow_commerce/flow_api_v0_client.rb, line 21740 def ItemAvailabilityStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ItemAvailabilityStatus.ALL.find { |v| v.value == value } end
low()
click to toggle source
Inventory is low and may soon become unavailable for purchase (# inventory items <= 5). Unless there is a specific use case for low inventory, it can be treated the same as ‘available’
# File lib/flow_commerce/flow_api_v0_client.rb, line 21757 def ItemAvailabilityStatus.low @@_low ||= ItemAvailabilityStatus.new('low') end
new(value)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 21725 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end
out_of_stock()
click to toggle source
There is no inventory available and is not available for purchase. Sample actions that can be taken are hiding the item or marking as ‘sold out` on the frontend
# File lib/flow_commerce/flow_api_v0_client.rb, line 21764 def ItemAvailabilityStatus.out_of_stock @@_out_of_stock ||= ItemAvailabilityStatus.new('out_of_stock') end
Public Instance Methods
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 21768 def to_hash value end