Class: Io::Flow::V0::Models::FtpOrganizationSettings

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

Overview

The FTP Organization Settings allows you to enable an FTP Drop Point for an organization, creating the standard set of FTP Folders, credentials, and associated webhooks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ FtpOrganizationSettings

Returns a new instance of FtpOrganizationSettings.



40540
40541
40542
40543
40544
40545
40546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40540

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:enabled, :emails], 'FtpOrganizationSettings')
  @enabled = HttpClient::Preconditions.assert_boolean('enabled', opts.delete(:enabled))
  @emails = HttpClient::Preconditions.assert_class('emails', opts.delete(:emails), Array).map { |v| HttpClient::Preconditions.assert_class('emails', v, String) }
  @account = (x = opts.delete(:account); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::FtpAccount) ? x : ::Io::Flow::V0::Models::FtpAccount.new(x)))
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



40538
40539
40540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40538

def 
  @account
end

#emailsObject (readonly)

Returns the value of attribute emails.



40538
40539
40540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40538

def emails
  @emails
end

#enabledObject (readonly)

Returns the value of attribute enabled.



40538
40539
40540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40538

def enabled
  @enabled
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40552
40553
40554
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40552

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

#to_hashObject



40556
40557
40558
40559
40560
40561
40562
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40556

def to_hash
  {
    :enabled => enabled,
    :emails => emails,
    :account => .nil? ? nil : .to_hash
  }
end

#to_jsonObject



40548
40549
40550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40548

def to_json
  JSON.dump(to_hash)
end