list method
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.
Request parameters:
fileId - The ID of the file.
includeDeleted - Whether to include deleted comments. Deleted comments
will not include their original content.
pageSize - The maximum number of comments to return per page.
Value must be between "1" and "100".
pageToken - The token for continuing a previous list request on the next
page. This should be set to the value of 'nextPageToken' from the previous
response.
startModifiedTime - The minimum value of 'modifiedTime' for the result
comments (RFC 3339 date-time).
$fields - Selector specifying which fields to include in a partial
response.
Completes with a CommentList.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<CommentList> list(
core.String fileId, {
core.bool? includeDeleted,
core.int? pageSize,
core.String? pageToken,
core.String? startModifiedTime,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'includeDeleted': ?includeDeleted == null ? null : ['${includeDeleted}'],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'startModifiedTime': ?startModifiedTime == null
? null
: [startModifiedTime],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'files/' + commons.escapeVariable('$fileId') + '/comments';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return CommentList.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}