make private if not part of provider interface
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
// of which the API client is authorized.
|
||||
//
|
||||
// Ref: http://www.questrade.com/api/documentation/rest-operations/account-calls/accounts
|
||||
type Account struct {
|
||||
type account struct {
|
||||
// Type of the account (e.g., "Cash", "Margin").
|
||||
Type string `json:"type"`
|
||||
|
||||
@@ -34,7 +34,7 @@ type Account struct {
|
||||
// Balance belonging to an Account
|
||||
//
|
||||
// Ref: http://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-balances
|
||||
type Balance struct {
|
||||
type balance struct {
|
||||
|
||||
// Currency of the balance figure(e.g., "USD" or "CAD").
|
||||
Currency string `json:"currency"`
|
||||
@@ -61,35 +61,35 @@ type Balance struct {
|
||||
// AccountBalances represents per-currency and combined balances for a specified account.
|
||||
//
|
||||
// Ref: http://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-balances
|
||||
type AccountBalances struct {
|
||||
PerCurrencyBalances []Balance `json:"perCurrencyBalances"`
|
||||
CombinedBalances []Balance `json:"combinedBalances"`
|
||||
SODPerCurrencyBalances []Balance `json:"sodPerCurrencyBalances"`
|
||||
SODCombinedBalances []Balance `json:"sodCombinedBalances"`
|
||||
type accountBalances struct {
|
||||
PerCurrencyBalances []balance `json:"perCurrencyBalances"`
|
||||
CombinedBalances []balance `json:"combinedBalances"`
|
||||
SODPerCurrencyBalances []balance `json:"sodPerCurrencyBalances"`
|
||||
SODCombinedBalances []balance `json:"sodCombinedBalances"`
|
||||
}
|
||||
|
||||
// GetAccounts returns the logged-in User ID, and a list of accounts
|
||||
// belonging to that user.
|
||||
func (c *client) GetAccounts() (int, []Account, error) {
|
||||
func (c *client) GetAccounts() (int, []account, error) {
|
||||
list := struct {
|
||||
UserID int `json:"userId"`
|
||||
Accounts []Account `json:"accounts"`
|
||||
Accounts []account `json:"accounts"`
|
||||
}{}
|
||||
|
||||
err := c.get("v1/accounts", &list, url.Values{})
|
||||
if err != nil {
|
||||
return 0, []Account{}, err
|
||||
return 0, []account{}, err
|
||||
}
|
||||
return list.UserID, list.Accounts, nil
|
||||
}
|
||||
|
||||
// GetBalances returns the balances for the account with the specified account number
|
||||
func (c *client) GetBalances(number string) (AccountBalances, error) {
|
||||
bal := AccountBalances{}
|
||||
func (c *client) GetBalances(number string) (accountBalances, error) {
|
||||
bal := accountBalances{}
|
||||
|
||||
err := c.get("v1/accounts/"+number+"/balances", &bal, url.Values{})
|
||||
if err != nil {
|
||||
return AccountBalances{}, err
|
||||
return accountBalances{}, err
|
||||
}
|
||||
return bal, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user