Class: Io::Flow::V0::Models::FtpFileSource

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

Returns a new instance of FtpFileSource.



13421
13422
13423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13421

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13419
13420
13421
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13419

def value
  @value
end

Class Method Details

.ALLObject



13441
13442
13443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13441

def FtpFileSource.ALL
  @@all ||= [FtpFileSource.flow, FtpFileSource.organization]
end

.apply(value) ⇒ Object

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



13426
13427
13428
13429
13430
13431
13432
13433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13426

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

.flowObject

Indicates flow created this file



13446
13447
13448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13446

def FtpFileSource.flow
  @@_flow ||= FtpFileSource.new('flow')
end

.from_string(value) ⇒ Object

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



13436
13437
13438
13439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13436

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

.organizationObject

Indicates the organization created this file



13451
13452
13453
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13451

def FtpFileSource.organization
  @@_organization ||= FtpFileSource.new('organization')
end

Instance Method Details

#to_hashObject



13455
13456
13457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13455

def to_hash
  value
end