forked from chyroc/go-aliyundrive
-
Notifications
You must be signed in to change notification settings - Fork 4
/
personal_info.go
39 lines (33 loc) · 928 Bytes
/
personal_info.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
35
36
37
38
39
package aliyundrive
import (
"context"
"net/http"
)
type PersonalInfoResp struct {
RightsInfo struct {
SpuId string `json:"spu_id"`
Name string `json:"name"`
IsExpires bool `json:"is_expires"`
Privileges []struct {
FeatureId string `json:"feature_id"`
FeatureAttrId string `json:"feature_attr_id"`
Quota int `json:"quota"`
} `json:"privileges"`
} `json:"personal_rights_info"`
SpaceInfo struct {
UsedSize uint `json:"used_size"`
TotalSize uint `json:"total_size"`
} `json:"personal_space_info"`
}
func (r *AliyunDrive) PersonalInfo(ctx context.Context) (*PersonalInfoResp, error) {
var personalInfoResp PersonalInfoResp
_, err := r.request(ctx, &config{
Method: http.MethodPost,
URL: "https://api.aliyundrive.com/v2/databox/get_personal_info",
Body: "{}",
}, &personalInfoResp)
if err != nil {
return nil, err
}
return &personalInfoResp, nil
}