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.



15362
15363
15364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15362

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15360
15361
15362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15360

def value
  @value
end

Class Method Details

.ALLObject



15382
15383
15384
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15382

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



15367
15368
15369
15370
15371
15372
15373
15374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15367

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



15387
15388
15389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15387

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



15377
15378
15379
15380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15377

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



15392
15393
15394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15392

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

Instance Method Details

#to_hashObject



15396
15397
15398
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15396

def to_hash
  value
end