Class: Io::Flow::V0::Models::SyncRecordFailureReason

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



20764
20765
20766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20764

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20762
20763
20764
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20762

def value
  @value
end

Class Method Details

.addressObject



20792
20793
20794
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20792

def SyncRecordFailureReason.address
  @@_address ||= SyncRecordFailureReason.new('address')
end

.ALLObject



20784
20785
20786
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20784

def SyncRecordFailureReason.ALL
  @@all ||= [SyncRecordFailureReason.inventory, SyncRecordFailureReason.address, SyncRecordFailureReason.promotion, SyncRecordFailureReason.other]
end

.apply(value) ⇒ Object

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



20769
20770
20771
20772
20773
20774
20775
20776
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20769

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

.from_string(value) ⇒ Object

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



20779
20780
20781
20782
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20779

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

.inventoryObject



20788
20789
20790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20788

def SyncRecordFailureReason.inventory
  @@_inventory ||= SyncRecordFailureReason.new('inventory')
end

.otherObject



20800
20801
20802
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20800

def SyncRecordFailureReason.other
  @@_other ||= SyncRecordFailureReason.new('other')
end

.promotionObject



20796
20797
20798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20796

def SyncRecordFailureReason.promotion
  @@_promotion ||= SyncRecordFailureReason.new('promotion')
end

Instance Method Details

#to_hashObject



20804
20805
20806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20804

def to_hash
  value
end