Finished balance and holdings calls, onto history!!!
This commit is contained in:
parent
e2479704f2
commit
5ab62c3075
16
client.go
16
client.go
@ -79,8 +79,20 @@ func (c *AllyApi) AccountBalances() (balances []AccountBalance) {
|
|||||||
return resp.AccountBalances
|
return resp.AccountBalances
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *AllyApi) AccountDetail(accountId int) AccountDetailResponse {
|
func (c *AllyApi) AccountDetail(accountId string) AccountDetailResponse {
|
||||||
var resp AccountDetailResponse
|
var resp AccountDetailResponse
|
||||||
_ = xml.Unmarshal(c.getAndRead(fmt.Sprintf("accounts/%d", accountId)), &resp)
|
_ = xml.Unmarshal(c.getAndRead(fmt.Sprintf("accounts/%s", accountId)), &resp)
|
||||||
|
return resp
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *AllyApi) AccountBalance(accountId string) AccountDetailBalanceResponse {
|
||||||
|
var resp AccountDetailBalanceResponse
|
||||||
|
_ = xml.Unmarshal(c.getAndRead(fmt.Sprintf("accounts/%s/balances", accountId)), &resp)
|
||||||
|
return resp
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *AllyApi) AccountHoldings(accountId string) AccountDetailHoldingsResponse {
|
||||||
|
var resp AccountDetailHoldingsResponse
|
||||||
|
_ = xml.Unmarshal(c.getAndRead(fmt.Sprintf("accounts/%s/holdings", accountId)), &resp)
|
||||||
return resp
|
return resp
|
||||||
}
|
}
|
||||||
|
10
types.go
10
types.go
@ -128,3 +128,13 @@ type AccountDetailResponse struct {
|
|||||||
AccountBalance Accountbalance `xml:"accountbalance"`
|
AccountBalance Accountbalance `xml:"accountbalance"`
|
||||||
AccountHoldings Accountholdings `xml:"accountholdings"`
|
AccountHoldings Accountholdings `xml:"accountholdings"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AccountDetailBalanceResponse struct {
|
||||||
|
XMLName xml.Name `xml:"response"`
|
||||||
|
AccountBalance Accountbalance `xml:"accountbalance"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AccountDetailHoldingsResponse struct {
|
||||||
|
XMLName xml.Name `xml:"response"`
|
||||||
|
AccountHoldings Accountholdings `xml:"accountholdings"`
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user