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

Returns a new instance of SyncRecordFailureReason.



26972
26973
26974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26972

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



26970
26971
26972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26970

def value
  @value
end

Class Method Details

.addressObject



27000
27001
27002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27000

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

.ALLObject



26992
26993
26994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26992

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



26977
26978
26979
26980
26981
26982
26983
26984
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26977

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



26987
26988
26989
26990
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26987

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

.inventoryObject



26996
26997
26998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26996

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

.otherObject



27008
27009
27010
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27008

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

.promotionObject



27004
27005
27006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27004

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

Instance Method Details

#to_hashObject



27012
27013
27014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27012

def to_hash
  value
end