Class: Io::Flow::V0::Models::FtpFile
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FtpFile
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The FTP File represents a file uploaded to the FTP Server
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FtpFile
constructor
A new instance of FtpFile.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ FtpFile
Returns a new instance of FtpFile.
38591 38592 38593 38594 38595 38596 38597 38598 38599 38600 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38591 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :source, :name, :directory, :url, :created_at], 'FtpFile') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @source = (x = opts.delete(:source); x.is_a?(::Io::Flow::V0::Models::FtpFileSource) ? x : ::Io::Flow::V0::Models::FtpFileSource.apply(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @directory = HttpClient::Preconditions.assert_class('directory', opts.delete(:directory), String) @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String) @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime) end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
38589 38590 38591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38589 def created_at @created_at end |
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
38589 38590 38591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38589 def directory @directory end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
38589 38590 38591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38589 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
38589 38590 38591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38589 def name @name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
38589 38590 38591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38589 def source @source end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
38589 38590 38591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38589 def url @url end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38606 38607 38608 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38606 def copy(incoming={}) FtpFile.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
38610 38611 38612 38613 38614 38615 38616 38617 38618 38619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38610 def to_hash { :id => id, :source => source.value, :name => name, :directory => directory, :url => url, :created_at => created_at } end |
#to_json ⇒ Object
38602 38603 38604 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38602 def to_json JSON.dump(to_hash) end |