class BridgeBankin::Account

Account resource

Constants

RESOURCE_TYPE

Public Class Methods

find(id:, access_token:, **params) click to toggle source

Retrieve a single account for logged in user

@param [Integer] id the id of the requested resource @param [String] access_token the access token provided during the user authentication @param [Hash] params any params that might be required (or optional) to communicate with the API

@return [Account] the user accounts

# File lib/bridge_bankin/account.rb, line 38
def find(id:, access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/accounts/#{id}", **params)
    convert_to_bridge_object(**data)
  end
end
list(access_token:, **params) click to toggle source

List all logged in user accounts

@param [String] access_token the access token provided during the user authentication @param [Hash] params any params that might be required (or optional) to communicate with the API

@return [Array<Account>] the user accounts

# File lib/bridge_bankin/account.rb, line 21
def list(access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/accounts", **params)
    # binding.pry
    convert_to_bridge_object(**data)
  end
end