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.



20249
20250
20251
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20249

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20247
20248
20249
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20247

def value
  @value
end

Class Method Details

.addressObject



20277
20278
20279
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20277

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

.ALLObject



20269
20270
20271
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20269

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



20254
20255
20256
20257
20258
20259
20260
20261
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20254

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



20264
20265
20266
20267
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20264

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

.inventoryObject



20273
20274
20275
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20273

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

.otherObject



20285
20286
20287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20285

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

.promotionObject



20281
20282
20283
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20281

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

Instance Method Details

#to_hashObject



20289
20290
20291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20289

def to_hash
  value
end