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.



20397
20398
20399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20397

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20395
20396
20397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20395

def value
  @value
end

Class Method Details

.addressObject



20425
20426
20427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20425

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

.ALLObject



20417
20418
20419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20417

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



20402
20403
20404
20405
20406
20407
20408
20409
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20402

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



20412
20413
20414
20415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20412

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

.inventoryObject



20421
20422
20423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20421

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

.otherObject



20433
20434
20435
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20433

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

.promotionObject



20429
20430
20431
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20429

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

Instance Method Details

#to_hashObject



20437
20438
20439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20437

def to_hash
  value
end