mirror of
https://github.com/rclone/rclone.git
synced 2025-02-22 08:49:38 +08:00
jottacloud: implement cleanup
This commit is contained in:
parent
2c2f4a6a05
commit
64b5105edd
@ -164,6 +164,12 @@ type CustomerInfo struct {
|
|||||||
IOSHash string `json:"ios_hash"`
|
IOSHash string `json:"ios_hash"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TrashResponse is returned when emptying the Trash
|
||||||
|
type TrashResponse struct {
|
||||||
|
Folders int64 `json:"folders"`
|
||||||
|
Files int64 `json:"files"`
|
||||||
|
}
|
||||||
|
|
||||||
// XML structures returned by the old API
|
// XML structures returned by the old API
|
||||||
|
|
||||||
// Flag is a hacky type for checking if an attribute is present
|
// Flag is a hacky type for checking if an attribute is present
|
||||||
|
@ -1064,6 +1064,22 @@ func (f *Fs) About(ctx context.Context) (*fs.Usage, error) {
|
|||||||
return usage, nil
|
return usage, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CleanUp empties the trash
|
||||||
|
func (f *Fs) CleanUp(ctx context.Context) error {
|
||||||
|
opts := rest.Opts{
|
||||||
|
Method: "POST",
|
||||||
|
Path: "files/v1/purge_trash",
|
||||||
|
}
|
||||||
|
|
||||||
|
var info api.TrashResponse
|
||||||
|
_, err := f.apiSrv.CallJSON(ctx, &opts, nil, &info)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "couldn't empty trash")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Hashes returns the supported hash sets.
|
// Hashes returns the supported hash sets.
|
||||||
func (f *Fs) Hashes() hash.Set {
|
func (f *Fs) Hashes() hash.Set {
|
||||||
return hash.Set(hash.MD5)
|
return hash.Set(hash.MD5)
|
||||||
@ -1370,6 +1386,7 @@ var (
|
|||||||
_ fs.ListRer = (*Fs)(nil)
|
_ fs.ListRer = (*Fs)(nil)
|
||||||
_ fs.PublicLinker = (*Fs)(nil)
|
_ fs.PublicLinker = (*Fs)(nil)
|
||||||
_ fs.Abouter = (*Fs)(nil)
|
_ fs.Abouter = (*Fs)(nil)
|
||||||
|
_ fs.CleanUpper = (*Fs)(nil)
|
||||||
_ fs.Object = (*Object)(nil)
|
_ fs.Object = (*Object)(nil)
|
||||||
_ fs.MimeTyper = (*Object)(nil)
|
_ fs.MimeTyper = (*Object)(nil)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user