Class: Increase::Resources::Accounts
- Inherits:
-
Object
- Object
- Increase::Resources::Accounts
- Defined in:
- lib/increase/resources/accounts.rb
Instance Method Summary collapse
-
#balance(account_id, params = {}, opts = {}) ⇒ Increase::Models::BalanceLookup
Retrieve an Account Balance.
-
#close(account_id, opts = {}) ⇒ Increase::Models::Account
Close an Account.
-
#create(params = {}, opts = {}) ⇒ Increase::Models::Account
Create an Account.
-
#initialize(client:) ⇒ Accounts
constructor
A new instance of Accounts.
-
#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::Account>
List Accounts.
-
#retrieve(account_id, opts = {}) ⇒ Increase::Models::Account
Retrieve an Account.
-
#update(account_id, params = {}, opts = {}) ⇒ Increase::Models::Account
Update an Account.
Constructor Details
#initialize(client:) ⇒ Accounts
Returns a new instance of Accounts.
6 7 8 |
# File 'lib/increase/resources/accounts.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#balance(account_id, params = {}, opts = {}) ⇒ Increase::Models::BalanceLookup
Retrieve an Account Balance
103 104 105 106 107 108 109 110 |
# File 'lib/increase/resources/accounts.rb', line 103 def balance(account_id, params = {}, opts = {}) req = {} req[:method] = :get req[:path] = "/accounts/#{account_id}/balance" req[:query] = params req[:model] = Increase::Models::BalanceLookup @client.request(req, opts) end |
#close(account_id, opts = {}) ⇒ Increase::Models::Account
Close an Account
118 119 120 121 122 123 124 |
# File 'lib/increase/resources/accounts.rb', line 118 def close(account_id, opts = {}) req = {} req[:method] = :post req[:path] = "/accounts/#{account_id}/close" req[:model] = Increase::Models::Account @client.request(req, opts) end |
#create(params = {}, opts = {}) ⇒ Increase::Models::Account
Create an Account
23 24 25 26 27 28 29 30 |
# File 'lib/increase/resources/accounts.rb', line 23 def create(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/accounts" req[:body] = params req[:model] = Increase::Models::Account @client.request(req, opts) end |
#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::Account>
List Accounts
83 84 85 86 87 88 89 90 91 |
# File 'lib/increase/resources/accounts.rb', line 83 def list(params = {}, opts = {}) req = {} req[:method] = :get req[:path] = "/accounts" req[:query] = params req[:page] = Increase::Page req[:model] = Increase::Models::Account @client.request(req, opts) end |
#retrieve(account_id, opts = {}) ⇒ Increase::Models::Account
Retrieve an Account
38 39 40 41 42 43 44 |
# File 'lib/increase/resources/accounts.rb', line 38 def retrieve(account_id, opts = {}) req = {} req[:method] = :get req[:path] = "/accounts/#{account_id}" req[:model] = Increase::Models::Account @client.request(req, opts) end |
#update(account_id, params = {}, opts = {}) ⇒ Increase::Models::Account
Update an Account
56 57 58 59 60 61 62 63 |
# File 'lib/increase/resources/accounts.rb', line 56 def update(account_id, params = {}, opts = {}) req = {} req[:method] = :patch req[:path] = "/accounts/#{account_id}" req[:body] = params req[:model] = Increase::Models::Account @client.request(req, opts) end |