Skip to content

Commit db16c3a

Browse files
committed
feat: support EmptyTrash()
Extracted from fork https://github.com/henrybear327/go-proton-api
1 parent 98a73ff commit db16c3a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

link_folder.go

+14
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ func (c *Client) TrashChildren(ctx context.Context, shareID, linkID string, chil
7171
return nil
7272
}
7373

74+
func (c *Client) EmptyTrash(ctx context.Context, shareID string) error {
75+
var res struct {
76+
APIError
77+
}
78+
79+
if err := c.do(ctx, func(r *resty.Request) (*resty.Response, error) {
80+
return r.SetResult(&res).Delete("/drive/shares/" + shareID + "/trash")
81+
}); err != nil {
82+
return err
83+
}
84+
85+
return nil
86+
}
87+
7488
func (c *Client) DeleteChildren(ctx context.Context, shareID, linkID string, childIDs ...string) error {
7589
var res struct {
7690
Responses []struct {

0 commit comments

Comments
 (0)