Class: Io::Flow::V0::Models::ConsumerInvoiceStatus

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) ⇒ ConsumerInvoiceStatus

Returns a new instance of ConsumerInvoiceStatus.



16745
16746
16747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16745

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16743
16744
16745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16743

def value
  @value
end

Class Method Details

.ALLObject



16765
16766
16767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16765

def ConsumerInvoiceStatus.ALL
  @@all ||= [ConsumerInvoiceStatus.pending, ConsumerInvoiceStatus.available, ConsumerInvoiceStatus.invalid]
end

.apply(value) ⇒ Object

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



16750
16751
16752
16753
16754
16755
16756
16757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16750

def ConsumerInvoiceStatus.apply(value)
  if value.instance_of?(ConsumerInvoiceStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || ConsumerInvoiceStatus.new(value))
  end
end

.availableObject

Indicates that the credit memo is fully validated and available for the end consumer



16777
16778
16779
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16777

def ConsumerInvoiceStatus.available
  @@_available ||= ConsumerInvoiceStatus.new('available')
end

.from_string(value) ⇒ Object

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



16760
16761
16762
16763
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16760

def ConsumerInvoiceStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  ConsumerInvoiceStatus.ALL.find { |v| v.value == value }
end

.invalidObject

Indicates that the credit memo failed to validate after multiple attempts and time



16783
16784
16785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16783

def ConsumerInvoiceStatus.invalid
  @@_invalid ||= ConsumerInvoiceStatus.new('invalid')
end

.pendingObject

Indicates that the credit memo has been created but validation is pending (e.g. waiting for the associated refund to be confirmed)



16771
16772
16773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16771

def ConsumerInvoiceStatus.pending
  @@_pending ||= ConsumerInvoiceStatus.new('pending')
end

Instance Method Details

#to_hashObject



16787
16788
16789
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16787

def to_hash
  value
end