comments
Creates, updates, deletes, gets or lists a comments
resource.
Overview
Name | comments |
Type | Resource |
Id | googleworkspace.drivev3.comments |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Name | Datatype | Description |
---|---|---|
id | string | Output only. The ID of the comment. |
anchor | string | A region of the document represented as a JSON string. For details on defining anchor properties, refer to Manage comments and replies. |
author | object | Information about a Drive user. (id: User) |
content | string | The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed. |
createdTime | string (date-time) | The time at which the comment was created (RFC 3339 date-time). |
deleted | boolean | Output only. Whether the comment has been deleted. A deleted comment has no content. |
htmlContent | string | Output only. The content of the comment with HTML formatting. |
kind | string | Output only. Identifies what kind of resource this is. Value: the fixed string "drive#comment" . (default: drive#comment) |
modifiedTime | string (date-time) | The last time the comment or any of its replies was modified (RFC 3339 date-time). |
quotedFileContent | object | The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment. |
replies | array | Output only. The full list of replies to the comment in chronological order. |
resolved | boolean | Output only. Whether the comment has been resolved by one of its replies. |
Name | Datatype | Description |
---|---|---|
id | string | Output only. The ID of the comment. |
anchor | string | A region of the document represented as a JSON string. For details on defining anchor properties, refer to Manage comments and replies. |
author | object | Information about a Drive user. (id: User) |
content | string | The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed. |
createdTime | string (date-time) | The time at which the comment was created (RFC 3339 date-time). |
deleted | boolean | Output only. Whether the comment has been deleted. A deleted comment has no content. |
htmlContent | string | Output only. The content of the comment with HTML formatting. |
kind | string | Output only. Identifies what kind of resource this is. Value: the fixed string "drive#comment" . (default: drive#comment) |
modifiedTime | string (date-time) | The last time the comment or any of its replies was modified (RFC 3339 date-time). |
quotedFileContent | object | The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment. |
replies | array | Output only. The full list of replies to the comment in chronological order. |
resolved | boolean | Output only. Whether the comment has been resolved by one of its replies. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | fileId , commentId | includeDeleted | Gets a comment by ID. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. |
list | select | fileId | includeDeleted , pageSize , pageToken , startModifiedTime | Lists a file's comments. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. |
create | insert | fileId | Creates a comment on a file. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. | |
update | update | fileId , commentId | Updates a comment with patch semantics. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields. | |
delete | delete | fileId , commentId | Deletes a comment. For more information, see Manage comments and replies. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
commentId | string | |
fileId | string | |
includeDeleted | boolean | |
pageSize | integer (int32) | |
pageToken | string | |
startModifiedTime | string |
SELECT
examples
- get
- list
Gets a comment by ID. For more information, see Manage comments and replies. Required: The fields
parameter must be set. To return the exact fields you need, see Return specific fields.
SELECT
id,
anchor,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
modifiedTime,
quotedFileContent,
replies,
resolved
FROM googleworkspace.drivev3.comments
WHERE fileId = '{{ fileId }}' -- required
AND commentId = '{{ commentId }}' -- required
AND includeDeleted = '{{ includeDeleted }}'
;
Lists a file's comments. For more information, see Manage comments and replies. Required: The fields
parameter must be set. To return the exact fields you need, see Return specific fields.
SELECT
id,
anchor,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
modifiedTime,
quotedFileContent,
replies,
resolved
FROM googleworkspace.drivev3.comments
WHERE fileId = '{{ fileId }}' -- required
AND includeDeleted = '{{ includeDeleted }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND startModifiedTime = '{{ startModifiedTime }}'
;
INSERT
examples
- create
- Manifest
Creates a comment on a file. For more information, see Manage comments and replies. Required: The fields
parameter must be set. To return the exact fields you need, see Return specific fields.
INSERT INTO googleworkspace.drivev3.comments (
data__id,
data__kind,
data__createdTime,
data__modifiedTime,
data__resolved,
data__anchor,
data__replies,
data__author,
data__deleted,
data__htmlContent,
data__content,
data__quotedFileContent,
fileId
)
SELECT
'{{ id }}',
'{{ kind }}',
'{{ createdTime }}',
'{{ modifiedTime }}',
{{ resolved }},
'{{ anchor }}',
'{{ replies }}',
'{{ author }}',
{{ deleted }},
'{{ htmlContent }}',
'{{ content }}',
'{{ quotedFileContent }}',
'{{ fileId }}'
RETURNING
id,
anchor,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
modifiedTime,
quotedFileContent,
replies,
resolved
;
# Description fields are for documentation purposes
- name: comments
props:
- name: fileId
value: string
description: Required parameter for the comments resource.
- name: id
value: string
description: >
Output only. The ID of the comment.
- name: kind
value: string
description: >
Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#comment"`.
default: drive#comment
- name: createdTime
value: string
description: >
The time at which the comment was created (RFC 3339 date-time).
- name: modifiedTime
value: string
description: >
The last time the comment or any of its replies was modified (RFC 3339 date-time).
- name: resolved
value: boolean
description: >
Output only. Whether the comment has been resolved by one of its replies.
- name: anchor
value: string
description: >
A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Manage comments and replies](https://developers.google.com/workspace/drive/api/v3/manage-comments).
- name: replies
value: array
description: >
Output only. The full list of replies to the comment in chronological order.
- name: author
value: object
description: >
Information about a Drive user.
- name: deleted
value: boolean
description: >
Output only. Whether the comment has been deleted. A deleted comment has no content.
- name: htmlContent
value: string
description: >
Output only. The content of the comment with HTML formatting.
- name: content
value: string
description: >
The plain text content of the comment. This field is used for setting the content, while `htmlContent` should be displayed.
- name: quotedFileContent
value: object
description: >
The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment.
UPDATE
examples
- update
Updates a comment with patch semantics. For more information, see Manage comments and replies. Required: The fields
parameter must be set. To return the exact fields you need, see Return specific fields.
UPDATE googleworkspace.drivev3.comments
SET
data__id = '{{ id }}',
data__kind = '{{ kind }}',
data__createdTime = '{{ createdTime }}',
data__modifiedTime = '{{ modifiedTime }}',
data__resolved = {{ resolved }},
data__anchor = '{{ anchor }}',
data__replies = '{{ replies }}',
data__author = '{{ author }}',
data__deleted = {{ deleted }},
data__htmlContent = '{{ htmlContent }}',
data__content = '{{ content }}',
data__quotedFileContent = '{{ quotedFileContent }}'
WHERE
fileId = '{{ fileId }}' --required
AND commentId = '{{ commentId }}' --required
RETURNING
id,
anchor,
author,
content,
createdTime,
deleted,
htmlContent,
kind,
modifiedTime,
quotedFileContent,
replies,
resolved;
DELETE
examples
- delete
Deletes a comment. For more information, see Manage comments and replies.
DELETE FROM googleworkspace.drivev3.comments
WHERE fileId = '{{ fileId }}' --required
AND commentId = '{{ commentId }}' --required
;