Google API Drive V3检索使用的驱动器存储空间 [英] Google API Drive V3 retrieving drive storage space used
本文介绍了Google API Drive V3检索使用的驱动器存储空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Google服务帐户来检索来自不同用户的数据使用情况. 我正在使用Google的python客户端进行身份验证和检索数据.
I'm using a google service account to retrieve the usage of data from different users. I'm using google's python client to authenticate and retrieve the data.
代码
service = build('drive', 'v3', credentials=auth)
result = service.about().get(email).execute();
result = result.get("storageQuota", {})
我一直收到以下错误:
method() takes 1 positional argument but 2 were given
我希望能够使用电子邮件作为标识符从特定用户的驱动器信息中获取信息.
I want to be able to get it from a specific user's drive information using the email as an identifier.
推荐答案
这是该请求的未记录必需参数.它称为字段.我有一个错误报告.
The is an undocumented required paramater with that request. Its called fields. I have a bug report out.
service = build('drive', 'v3', credentials=auth)
driveRequest = service.about().get(email);
driveRequest.fields = "*";
result = driveRequest.execute();
result = result.get("storageQuota", {})
请注意,我不是python开发人员,这是有关如何实现的猜测.
Kindly note i am not a python developer this is a guess on how to do it.
这篇关于Google API Drive V3检索使用的驱动器存储空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文