Class: Io::Flow::V0::Models::CancelReason
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CancelReason
- 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 CancelReason for this value, creating a new instance for an unknown value.
-
.consumer_requested ⇒ Object
A consumer requested cancellation of an item qty and the fulfillment party has acknowledged that the qty will not be shipped.
-
.flow_cancel ⇒ Object
Flow has had to cancel an order, possibly due to fraud activity or inability to collect payment.
-
.from_string(value) ⇒ Object
Returns the instance of CancelReason for this value, or nil if not found.
-
.out_of_stock ⇒ Object
Out of stock is a permanent cancel of the fulfillment of an item qty.
Instance Method Summary collapse
-
#initialize(value) ⇒ CancelReason
constructor
A new instance of CancelReason.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CancelReason
Returns a new instance of CancelReason.
12980 12981 12982 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12980 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12978 12979 12980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12978 def value @value end |
Class Method Details
.ALL ⇒ Object
13000 13001 13002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13000 def CancelReason.ALL @@all ||= [CancelReason.out_of_stock, CancelReason.consumer_requested, CancelReason.flow_cancel] end |
.apply(value) ⇒ Object
Returns the instance of CancelReason for this value, creating a new instance for an unknown value
12985 12986 12987 12988 12989 12990 12991 12992 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12985 def CancelReason.apply(value) if value.instance_of?(CancelReason) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CancelReason.new(value)) end end |
.consumer_requested ⇒ Object
A consumer requested cancellation of an item qty and the fulfillment party has acknowledged that the qty will not be shipped. This is a cancel of the ordered quantity and will reduce or refund the consumer’s payment
13014 13015 13016 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13014 def CancelReason.consumer_requested @@_consumer_requested ||= CancelReason.new('consumer_requested') end |
.flow_cancel ⇒ Object
Flow has had to cancel an order, possibly due to fraud activity or inability to collect payment. This will cancel the ordered quantity. All known parties will be notified.
13021 13022 13023 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13021 def CancelReason.flow_cancel @@_flow_cancel ||= CancelReason.new('flow_cancel') end |
.from_string(value) ⇒ Object
Returns the instance of CancelReason for this value, or nil if not found
12995 12996 12997 12998 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12995 def CancelReason.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CancelReason.ALL.find { |v| v.value == value } end |
.out_of_stock ⇒ Object
Out of stock is a permanent cancel of the fulfillment of an item qty. If no other fulfillment parties exist, this will cancel the ordered quantity and reduce or refund the consumer’s payment.
13007 13008 13009 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13007 def CancelReason.out_of_stock @@_out_of_stock ||= CancelReason.new('out_of_stock') end |
Instance Method Details
#to_hash ⇒ Object
13025 13026 13027 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13025 def to_hash value end |