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.



18607
18608
18609
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18607

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18605
18606
18607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18605

def value
  @value
end

Class Method Details

.ALLObject



18627
18628
18629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18627

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



18612
18613
18614
18615
18616
18617
18618
18619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18612

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



18632
18633
18634
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18632

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



18622
18623
18624
18625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18622

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



18637
18638
18639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18637

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

Instance Method Details

#to_hashObject



18641
18642
18643
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18641

def to_hash
  value
end