-
Notifications
You must be signed in to change notification settings - Fork 1
/
folder.go
37 lines (29 loc) · 847 Bytes
/
folder.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
package cacoo
import (
"context"
"fmt"
)
// FolderService handles folder related methods
type FolderService service
// Folder represents the folder list of the account
type Folder struct {
Results []FolderResult `json:"result"`
}
// FolderResult represents the list of the folder information
type FolderResult struct {
Created *CacooTime `json:"created"`
FolderID *int `json:"folderId"`
FolderName *string `json:"folderName"`
Type *string `json:"type"`
Updated *CacooTime `json:"updated"`
}
// MyFolders returns the folder list of the authenticated user
func (fs *FolderService) MyFolders(ctx context.Context) (*Folder, *Response, error) {
u := fmt.Sprintf("%s", "folders.json")
f := new(Folder)
resp, err := fs.client.Get(ctx, u, &f)
if err != nil {
return nil, resp, err
}
return f, resp, nil
}