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.



11512
11513
11514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11512

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11510
11511
11512
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11510

def value
  @value
end

Class Method Details

.ALLObject



11532
11533
11534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11532

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



11517
11518
11519
11520
11521
11522
11523
11524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11517

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



11544
11545
11546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11544

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



11527
11528
11529
11530
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11527

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



11550
11551
11552
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11550

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)



11538
11539
11540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11538

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

Instance Method Details

#to_hashObject



11554
11555
11556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11554

def to_hash
  value
end