forked from soltys/go-aftermarketpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.go
34 lines (28 loc) · 863 Bytes
/
account.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package aftermarketpl
type accountIDResponse struct {
Data string `json:"data"`
}
// AccountID Returns the current user identifier.
func (a *Aftermarketpl) AccountID() (string, error) {
d := accountIDResponse{}
err := a.Do("/account/id", emptyRequest{}, &d)
return d.Data, err
}
type accountCurrencyResponse struct {
Data string `json:"data"`
}
// AccountCurrency Returns the current user currency.
func (a *Aftermarketpl) AccountCurrency() (string, error) {
d := accountCurrencyResponse{}
err := a.Do("/account/currency", emptyRequest{}, &d)
return d.Data, err
}
type accountBalanceResponse struct {
Data float64 `json:"data"`
}
// AccountBalance Returns the current user balance.
func (a *Aftermarketpl) AccountBalance() (float64, error) {
d := accountBalanceResponse{}
err := a.Do("/account/balance", emptyRequest{}, &d)
return d.Data, err
}