Class: Increase::Resources::Accounts
- Inherits:
-
Object
- Object
- Increase::Resources::Accounts
- Defined in:
- lib/increase/resources/accounts.rb
Instance Method Summary collapse
-
#balance(account_id, at_time: nil, request_options: {}) ⇒ Increase::Models::BalanceLookup
Retrieve the current and available balances for an account in minor units of the account’s currency.
-
#close(account_id, request_options: {}) ⇒ Increase::Models::Account
Close an Account.
-
#create(name: , entity_id: nil, informational_entity_id: nil, program_id: nil, request_options: {}) ⇒ Increase::Models::Account
Some parameter documentations has been truncated, see Models::AccountCreateParams for more details.
-
#initialize(client:) ⇒ Accounts
constructor
private
A new instance of Accounts.
-
#list(created_at: nil, cursor: nil, entity_id: nil, idempotency_key: nil, informational_entity_id: nil, limit: nil, program_id: nil, status: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::Account>
Some parameter documentations has been truncated, see Models::AccountListParams for more details.
-
#retrieve(account_id, request_options: {}) ⇒ Increase::Models::Account
Retrieve an Account.
-
#update(account_id, name: nil, request_options: {}) ⇒ Increase::Models::Account
Update an Account.
Constructor Details
#initialize(client:) ⇒ Accounts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Accounts.
169 170 171 |
# File 'lib/increase/resources/accounts.rb', line 169 def initialize(client:) @client = client end |
Instance Method Details
#balance(account_id, at_time: nil, request_options: {}) ⇒ Increase::Models::BalanceLookup
Retrieve the current and available balances for an account in minor units of the account’s currency. Learn more about [account balances](/documentation/balance).
135 136 137 138 139 140 141 142 143 144 |
# File 'lib/increase/resources/accounts.rb', line 135 def balance(account_id, params = {}) parsed, = Increase::AccountBalanceParams.dump_request(params) @client.request( method: :get, path: ["accounts/%1$s/balance", account_id], query: parsed, model: Increase::BalanceLookup, options: ) end |
#close(account_id, request_options: {}) ⇒ Increase::Models::Account
Close an Account
157 158 159 160 161 162 163 164 |
# File 'lib/increase/resources/accounts.rb', line 157 def close(account_id, params = {}) @client.request( method: :post, path: ["accounts/%1$s/close", account_id], model: Increase::Account, options: params[:request_options] ) end |
#create(name: , entity_id: nil, informational_entity_id: nil, program_id: nil, request_options: {}) ⇒ Increase::Models::Account
Some parameter documentations has been truncated, see Models::AccountCreateParams for more details.
Create an Account
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/increase/resources/accounts.rb', line 26 def create(params) parsed, = Increase::AccountCreateParams.dump_request(params) @client.request( method: :post, path: "accounts", body: parsed, model: Increase::Account, options: ) end |
#list(created_at: nil, cursor: nil, entity_id: nil, idempotency_key: nil, informational_entity_id: nil, limit: nil, program_id: nil, status: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::Account>
Some parameter documentations has been truncated, see Models::AccountListParams for more details.
List Accounts
109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/increase/resources/accounts.rb', line 109 def list(params = {}) parsed, = Increase::AccountListParams.dump_request(params) @client.request( method: :get, path: "accounts", query: parsed, page: Increase::Internal::Page, model: Increase::Account, options: ) end |
#retrieve(account_id, request_options: {}) ⇒ Increase::Models::Account
Retrieve an Account
48 49 50 51 52 53 54 55 |
# File 'lib/increase/resources/accounts.rb', line 48 def retrieve(account_id, params = {}) @client.request( method: :get, path: ["accounts/%1$s", account_id], model: Increase::Account, options: params[:request_options] ) end |
#update(account_id, name: nil, request_options: {}) ⇒ Increase::Models::Account
Update an Account
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/increase/resources/accounts.rb', line 70 def update(account_id, params = {}) parsed, = Increase::AccountUpdateParams.dump_request(params) @client.request( method: :patch, path: ["accounts/%1$s", account_id], body: parsed, model: Increase::Account, options: ) end |