Class: Tango::Api::Resources::Accounts

Inherits:
Base
  • Object
show all
Defined in:
lib/tango/api/resources/accounts.rb

Overview

Client for Accounts endpoints.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Tango::Api::Resources::Base

Instance Method Details

#create(customer_identifier, body) ⇒ Object

POST /customers/customerIdentifier/accounts



19
20
21
# File 'lib/tango/api/resources/accounts.rb', line 19

def create(customer_identifier, body)
  post_json("customers/#{customer_identifier}/accounts", body)
end

#delete_low_balance_alert(customer_identifier, account_identifier, alert_identifier) ⇒ Object

DELETE /customers/customerIdentifier/accounts/accountIdentifier/lowbalance/alertIdentifier



52
53
54
55
# File 'lib/tango/api/resources/accounts.rb', line 52

def delete_low_balance_alert(customer_identifier, , alert_identifier)
  path = "customers/#{customer_identifier}/accounts/#{account_identifier}/lowbalance/#{alert_identifier}"
  delete_json(path)
end

#get(account_identifier) ⇒ Object

GET /accounts/accountIdentifier



14
15
16
# File 'lib/tango/api/resources/accounts.rb', line 14

def get()
  get_json("accounts/#{account_identifier}")
end

#get_low_balance_alert(customer_identifier, account_identifier, alert_identifier) ⇒ Object

GET /customers/customerIdentifier/accounts/accountIdentifier/lowbalance/alertIdentifier



40
41
42
43
# File 'lib/tango/api/resources/accounts.rb', line 40

def get_low_balance_alert(customer_identifier, , alert_identifier)
  path = "customers/#{customer_identifier}/accounts/#{account_identifier}/lowbalance/#{alert_identifier}"
  get_json(path)
end

#list_for_customer(customer_identifier, params = {}) ⇒ Object

GET /customers/customerIdentifier/accounts



9
10
11
# File 'lib/tango/api/resources/accounts.rb', line 9

def list_for_customer(customer_identifier, params = {})
  get_json("customers/#{customer_identifier}/accounts", params)
end

#list_low_balance_alerts(customer_identifier, account_identifier) ⇒ Object

Low balance alerts GET /customers/customerIdentifier/accounts/accountIdentifier/lowbalance



30
31
32
# File 'lib/tango/api/resources/accounts.rb', line 30

def list_low_balance_alerts(customer_identifier, )
  get_json("customers/#{customer_identifier}/accounts/#{account_identifier}/lowbalance")
end

#set_low_balance_alert(customer_identifier, account_identifier, body) ⇒ Object

POST /customers/customerIdentifier/accounts/accountIdentifier/lowbalance



35
36
37
# File 'lib/tango/api/resources/accounts.rb', line 35

def set_low_balance_alert(customer_identifier, , body)
  post_json("customers/#{customer_identifier}/accounts/#{account_identifier}/lowbalance", body)
end

#update_low_balance_alert(customer_identifier, account_identifier, alert_identifier, body) ⇒ Object

PATCH /customers/customerIdentifier/accounts/accountIdentifier/lowbalance/alertIdentifier



46
47
48
49
# File 'lib/tango/api/resources/accounts.rb', line 46

def update_low_balance_alert(customer_identifier, , alert_identifier, body)
  path = "customers/#{customer_identifier}/accounts/#{account_identifier}/lowbalance/#{alert_identifier}"
  patch_json(path, body)
end

#update_under_customer(customer_identifier, account_identifier, body) ⇒ Object

PATCH /customers/customerIdentifier/accounts/accountIdentifier



24
25
26
# File 'lib/tango/api/resources/accounts.rb', line 24

def update_under_customer(customer_identifier, , body)
  patch_json("customers/#{customer_identifier}/accounts/#{account_identifier}", body)
end