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.



24889
24890
24891
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24889

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



24887
24888
24889
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24887

def value
  @value
end

Class Method Details

.addressObject



24917
24918
24919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24917

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

.ALLObject



24909
24910
24911
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24909

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



24894
24895
24896
24897
24898
24899
24900
24901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24894

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



24904
24905
24906
24907
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24904

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

.inventoryObject



24913
24914
24915
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24913

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

.otherObject



24925
24926
24927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24925

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

.promotionObject



24921
24922
24923
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24921

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

Instance Method Details

#to_hashObject



24929
24930
24931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24929

def to_hash
  value
end