list method

Future<CommentThreadListResponse> list(
  1. List<String> part, {
  2. String? allThreadsRelatedToChannelId,
  3. String? channelId,
  4. List<String>? id,
  5. int? maxResults,
  6. String? moderationStatus,
  7. String? order,
  8. String? pageToken,
  9. String? searchTerms,
  10. String? textFormat,
  11. String? videoId,
  12. String? $fields,
})

Retrieves a list of resources, possibly filtered.

Request parameters:

part - The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.

allThreadsRelatedToChannelId - Returns the comment threads of all videos of the channel and the channel comments as well.

channelId - Returns the comment threads for all the channel comments (ie does not include comments left on videos).

id - Returns the comment threads with the given IDs for Stubby or Apiary.

maxResults - The maxResults parameter specifies the maximum number of items that should be returned in the result set. Value must be between "1" and "100".

moderationStatus - Limits the returned comment threads to those with the specified moderation status. Not compatible with the 'id' filter. Valid values: published, heldForReview, likelySpam. Possible string values are:

  • "published" : The comment is available for public display.
  • "heldForReview" : The comment is awaiting review by a moderator.
  • "likelySpam"
  • "rejected" : The comment is unfit for display.

order - null Possible string values are:

  • "orderUnspecified"
  • "time" : Order by time.
  • "relevance" : Order by relevance.

pageToken - The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.

searchTerms - Limits the returned comment threads to those matching the specified key words. Not compatible with the 'id' filter.

textFormat - The requested text format for the returned comments. Possible string values are:

  • "textFormatUnspecified"
  • "html" : Returns the comments in HTML format. This is the default value.
  • "plainText" : Returns the comments in plain text format.

videoId - Returns the comment threads of the specified video.

$fields - Selector specifying which fields to include in a partial response.

Completes with a CommentThreadListResponse.

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<CommentThreadListResponse> list(
  core.List<core.String> part, {
  core.String? allThreadsRelatedToChannelId,
  core.String? channelId,
  core.List<core.String>? id,
  core.int? maxResults,
  core.String? moderationStatus,
  core.String? order,
  core.String? pageToken,
  core.String? searchTerms,
  core.String? textFormat,
  core.String? videoId,
  core.String? $fields,
}) async {
  if (part.isEmpty) {
    throw core.ArgumentError('Parameter part cannot be empty.');
  }
  final queryParams_ = <core.String, core.List<core.String>>{
    'part': part,
    if (allThreadsRelatedToChannelId != null)
      'allThreadsRelatedToChannelId': [allThreadsRelatedToChannelId],
    if (channelId != null) 'channelId': [channelId],
    if (id != null) 'id': id,
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (moderationStatus != null) 'moderationStatus': [moderationStatus],
    if (order != null) 'order': [order],
    if (pageToken != null) 'pageToken': [pageToken],
    if (searchTerms != null) 'searchTerms': [searchTerms],
    if (textFormat != null) 'textFormat': [textFormat],
    if (videoId != null) 'videoId': [videoId],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'youtube/v3/commentThreads';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return CommentThreadListResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}