diff --git a/pixelapi/subscription.go b/pixelapi/subscription.go index 9c33c74..9b653d2 100644 --- a/pixelapi/subscription.go +++ b/pixelapi/subscription.go @@ -32,6 +32,8 @@ type SubscriptionType struct { FileExpiryDays int `json:"file_expiry_days"` DirectLinkingBandwidth int64 `json:"direct_linking_bandwidth"` StorageSpace int64 `json:"storage_space"` + PricePerTBStorage int64 `json:"price_per_tb_storage"` + PricePerTBBandwidth int64 `json:"price_per_tb_bandwidth"` } // GetSubscriptionID returns the subscription object identified by the given ID diff --git a/pixelapi/user.go b/pixelapi/user.go index c1b6c5a..842f9fd 100644 --- a/pixelapi/user.go +++ b/pixelapi/user.go @@ -15,6 +15,7 @@ type UserInfo struct { Subscription SubscriptionType `json:"subscription"` StorageSpaceUsed int64 `json:"storage_space_used"` IsAdmin bool `json:"is_admin"` + BalanceMicroEUR int64 `json:"balance_micro_eur"` } // UserSession is one user session @@ -101,6 +102,21 @@ func (p *PixelAPI) GetUserLists() (resp ListInfoSlice, err error) { return resp, p.jsonRequest("GET", "user/lists", &resp) } +type UserTransaction struct { + Time time.Time `json:"time"` + NewBalance int64 `json:"new_balance"` + DepositAmount int64 `json:"deposit_amount"` + SubscriptionCharge int64 `json:"subscription_charge"` + StorageCharge int64 `json:"storage_charge"` + StorageUsed int64 `json:"storage_used"` + BandwidthCharge int64 `json:"bandwidth_charge"` + BandwidthUsed int64 `json:"bandwidth_used"` +} + +func (p *PixelAPI) GetUserTransactions() (resp []UserTransaction, err error) { + return resp, p.jsonRequest("GET", "user/transactions", &resp) +} + // PutUserPassword changes the user's password func (p *PixelAPI) PutUserPassword(oldPW, newPW string) (err error) { return p.form(