Class: Io::Flow::V0::Clients::ChannelDefaultBankAccounts

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ChannelDefaultBankAccounts

Returns a new instance of ChannelDefaultBankAccounts.



5913
5914
5915
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5913

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#delete(channel) ⇒ Object



5930
5931
5932
5933
5934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5930

def delete(channel)
  HttpClient::Preconditions.assert_class('channel', channel, String)
  r = @client.request("/channel/#{CGI.escape(channel)}/default/bank/accounts").delete
  nil
end

#get(channel) ⇒ Object



5917
5918
5919
5920
5921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5917

def get(channel)
  HttpClient::Preconditions.assert_class('channel', channel, String)
  r = @client.request("/channel/#{CGI.escape(channel)}/default/bank/accounts").get
  ::Io::Flow::V0::Models::ChannelDefaultBankAccount.new(r)
end

#put(channel, default_bank_account_form) ⇒ Object



5923
5924
5925
5926
5927
5928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5923

def put(channel, )
  HttpClient::Preconditions.assert_class('channel', channel, String)
  (x = ; x.is_a?(::Io::Flow::V0::Models::DefaultBankAccountForm) ? x : ::Io::Flow::V0::Models::DefaultBankAccountForm.new(x))
  r = @client.request("/channel/#{CGI.escape(channel)}/default/bank/accounts").with_json(.to_json).put
  ::Io::Flow::V0::Models::ChannelDefaultBankAccount.new(r)
end