Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

jottacloud: add support for UserInfo feature

albertony78db3dba0ec1
diff --git a/backend/jottacloud/jottacloud.go b/backend/jottacloud/jottacloud.go
index 4c2134857..85db2f9e1 100644
--- a/backend/jottacloud/jottacloud.go
+++ b/backend/jottacloud/jottacloud.go
@@ -1289,6 +1289,21 @@ func (f *Fs) About(ctx context.Context) (*fs.Usage, error) {
return usage, nil
}
+// UserInfo fetches info about the current user
+func (f *Fs) UserInfo(ctx context.Context) (userInfo map[string]string, err error) {
+ cust, err := getCustomerInfo(ctx, f.apiSrv)
+ if err != nil {
+ return nil, err
+ }
+ return map[string]string{
+ "Username": cust.Username,
+ "Email": cust.Email,
+ "Name": cust.Name,
+ "AccountType": cust.AccountType,
+ "SubscriptionType": cust.SubscriptionType,
+ }, nil
+}
+
// CleanUp empties the trash
func (f *Fs) CleanUp(ctx context.Context) error {
opts := rest.Opts{
@@ -1694,6 +1709,7 @@ var (
_ fs.ListRer = (*Fs)(nil)
_ fs.PublicLinker = (*Fs)(nil)
_ fs.Abouter = (*Fs)(nil)
+ _ fs.UserInfoer = (*Fs)(nil)
_ fs.CleanUpper = (*Fs)(nil)
_ fs.Object = (*Object)(nil)
_ fs.MimeTyper = (*Object)(nil)