list method

Future<LiveChatMessageListResponse> list(
  1. String liveChatId,
  2. List<String> part, {
  3. String? hl,
  4. int? maxResults,
  5. String? pageToken,
  6. int? profileImageSize,
  7. String? $fields,
})

Retrieves a list of resources, possibly filtered.

Request parameters:

liveChatId - The id of the live chat for which comments should be returned.

part - The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet.

hl - Specifies the localization language in which the system messages should be returned.

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

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

profileImageSize - Specifies the size of the profile image that should be returned for each user. Value must be between "16" and "720".

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

Completes with a LiveChatMessageListResponse.

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<LiveChatMessageListResponse> list(
  core.String liveChatId,
  core.List<core.String> part, {
  core.String? hl,
  core.int? maxResults,
  core.String? pageToken,
  core.int? profileImageSize,
  core.String? $fields,
}) async {
  if (part.isEmpty) {
    throw core.ArgumentError('Parameter part cannot be empty.');
  }
  final queryParams_ = <core.String, core.List<core.String>>{
    'liveChatId': [liveChatId],
    'part': part,
    if (hl != null) 'hl': [hl],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (profileImageSize != null) 'profileImageSize': ['${profileImageSize}'],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'youtube/v3/liveChat/messages';

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