forked from linode/linodego
-
Notifications
You must be signed in to change notification settings - Fork 0
/
account_transfer.go
33 lines (26 loc) · 912 Bytes
/
account_transfer.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
package linodego
import "context"
// AccountTransfer represents an Account's network utilization for the current month.
type AccountTransfer struct {
Billable int `json:"billable"`
Quota int `json:"quota"`
Used int `json:"used"`
RegionTransfers []AccountTransferRegion `json:"region_transfers"`
}
// AccountTransferRegion represents an Account's network utilization for the current month
// in a given region.
type AccountTransferRegion struct {
ID string `json:"id"`
Billable int `json:"billable"`
Quota int `json:"quota"`
Used int `json:"used"`
}
// GetAccountTransfer gets current Account's network utilization for the current month.
func (c *Client) GetAccountTransfer(ctx context.Context) (*AccountTransfer, error) {
e := "account/transfer"
response, err := doGETRequest[AccountTransfer](ctx, c, e)
if err != nil {
return nil, err
}
return response, nil
}