Skip to content

Commit 1631dc9

Browse files
committed
feat: add GetRevisionAllBlocks() support
1 parent 98a73ff commit 1631dc9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

link_file.go

+16
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ func (c *Client) ListRevisions(ctx context.Context, shareID, linkID string) ([]R
2222
return res.Revisions, nil
2323
}
2424

25+
func (c *Client) GetRevisionAllBlocks(ctx context.Context, shareID, linkID, revisionID string) (Revision, error) {
26+
var res struct {
27+
Revision Revision
28+
}
29+
30+
if err := c.do(ctx, func(r *resty.Request) (*resty.Response, error) {
31+
return r.
32+
SetResult(&res).
33+
Get("/drive/shares/" + shareID + "/files/" + linkID + "/revisions/" + revisionID)
34+
}); err != nil {
35+
return Revision{}, err
36+
}
37+
38+
return res.Revision, nil
39+
}
40+
2541
func (c *Client) GetRevision(ctx context.Context, shareID, linkID, revisionID string, fromBlock, pageSize int) (Revision, error) {
2642
if fromBlock < 1 {
2743
return Revision{}, fmt.Errorf("fromBlock must be greater than 0")

0 commit comments

Comments
 (0)