c# - 使用 Google Drive API 在 Google Doc 上获取评论:评论所有者的 EmalAddress 返回 null
问题描述
我有以下代码来获取对给定 Google Doc 的评论。对于Fields
,我提供了*
检索所有信息的值。我可以正确检索该Author.DisplayName
值,但Author.EmailAddress
始终是null
. 我想知道这是否是正常行为。我怎样才能减轻这种情况?
public IList<Comment> RetrieveComments(string fileId)
{
var _driveService = GetDriveServiceInstance();
try
{
CommentsResource.ListRequest commentRequest = _driveService.Comments.List(fileId);
commentRequest.Fields = "*";
CommentList comments = commentRequest.Execute();
return comments.Comments;
}
catch (Exception e)
{
Console.WriteLine("An error occurred: " + e.Message);
}
return null;
}
解决方案
该字段EmailAddress
未填充Comments
作者
嵌套对象
评论的作者。不会填充作者的电子邮件地址和权限 ID。
推荐阅读
- python - 如何在基于 loc 条件更新一系列行的同时迭代 Pandas 行?
- swift - 使用 ARKit 可视化表面上的放置点
- python - Pandas:对于特定列中的所有重复条目集,获取一些信息
- windows - 使用“dotnet dev-certs https”创建的证书的默认位置是什么
- javascript - Javascript 正则表达式最小长度匹配
- google-maps - 如何在缩小下使管理.land_parcel 几何可见
- oracle-apex-5.1 - Oracle APEX - 文本字段显示破折号
- python - 没有 in 的 python 列表理解
- hyperledger-fabric - 超级账本:如何检查链码中的授权
- ios - 什么是钥匙串访问组?