REST Resource: comments

资源:注释

对 Google 云端硬盘中的文件发表评论。

某些资源方法(例如 comments.update)需要 commentId。使用 comments.list 方法检索文件中评论的 ID。

JSON 表示法
{
  "commentId": string,
  "kind": string,
  "createdDate": string,
  "modifiedDate": string,
  "fileId": string,
  "status": string,
  "anchor": string,
  "replies": [
    {
      object (CommentReply)
    }
  ],
  "author": {
    object (User)
  },
  "deleted": boolean,
  "selfLink": string,
  "htmlContent": string,
  "content": string,
  "context": {
    "type": string,
    "value": string
  },
  "fileTitle": string
}
字段
commentId

string

仅供输出。评论的 ID。

kind

string

仅供输出。始终为 drive#comment

createdDate

string

仅供输出。首次创建此评论的日期。

modifiedDate

string

仅供输出。此评论或其任意回复的上次修改日期。

fileId

string

仅供输出。此评论指向的文件。

status

string

仅供输出。此评论的状态。对具有所需状态的评论发布回复即可更改状态。

  • open - 评论仍处于打开状态。
  • resolved - 该评论已由其某一回复予以解决。
anchor

string

以 JSON 字符串表示的文档区域。如需详细了解如何定义锚标记属性,请参阅添加评论和回复

replies[]

object (CommentReply)

仅供输出。对此帖子的回复。

author

object (User)

仅供输出。评论的作者。系统不会填充作者的电子邮件地址和权限 ID。

deleted

boolean

仅供输出。此评论是否已删除。如果评论已删除,其内容将会被清除,仅代表存在过的评论。

htmlContent

string

仅供输出。此评论的 HTML 格式的内容。

content

string

用于创建此评论的纯文本内容。这并非 HTML 安全内容,只能用作修改评论内容的起点。

context

object

要接受评论的文件的上下文。

context.type

string

上下文片段的 MIME 类型。

context.value

string

所评论的文件段的数据表示形式。例如,对于文本文件,则是评论所涉及的实际文本。

fileTitle

string

仅供输出。此评论指向的文件的标题。

方法

delete

删除评论。

get

根据 ID 获取评论。

insert

对指定文件创建新评论。

list

列出文件注释。

patch

更新现有评论。

update

更新现有评论。