From 61bd77b81ba01adeabe7a9264d89fe1cc0d69a6b Mon Sep 17 00:00:00 2001 From: Mark Ferrell Date: Wed, 15 Jan 2025 05:26:26 -0800 Subject: [PATCH] feat: support EmptyTrash() Extracted from fork https://github.com/henrybear327/go-proton-api --- link_folder.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/link_folder.go b/link_folder.go index 67c3516..7e403a0 100644 --- a/link_folder.go +++ b/link_folder.go @@ -71,6 +71,20 @@ func (c *Client) TrashChildren(ctx context.Context, shareID, linkID string, chil return nil } +func (c *Client) EmptyTrash(ctx context.Context, shareID string) error { + var res struct { + APIError + } + + if err := c.do(ctx, func(r *resty.Request) (*resty.Response, error) { + return r.SetResult(&res).Delete("/drive/shares/" + shareID + "/trash") + }); err != nil { + return err + } + + return nil +} + func (c *Client) DeleteChildren(ctx context.Context, shareID, linkID string, childIDs ...string) error { var res struct { Responses []struct {