Class: Io::Flow::V0::Models::FtpFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

The FTP Folder represents a single folder associated with an organization for which we create an external FTP Directory

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ FtpFolder

Returns a new instance of FtpFolder.



29056
29057
29058
29059
29060
29061
29062
29063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29056

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :path, :webhook], 'FtpFolder')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @path = HttpClient::Preconditions.assert_class('path', opts.delete(:path), String)
  @webhook = HttpClient::Preconditions.assert_boolean('webhook', opts.delete(:webhook))
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



29054
29055
29056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29054

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



29054
29055
29056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29054

def id
  @id
end

#pathObject (readonly)

Returns the value of attribute path.



29054
29055
29056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29054

def path
  @path
end

#webhookObject (readonly)

Returns the value of attribute webhook.



29054
29055
29056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29054

def webhook
  @webhook
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29069
29070
29071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29069

def copy(incoming={})
  FtpFolder.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



29073
29074
29075
29076
29077
29078
29079
29080
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29073

def to_hash
  {
    :id => id,
    :path => path,
    :webhook => webhook,
    :description => description
  }
end

#to_jsonObject



29065
29066
29067
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29065

def to_json
  JSON.dump(to_hash)
end