list method

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

Retrieves a list of resources, possibly filtered.

Request parameters:

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

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

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

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.

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

Completes with a LiveChatModeratorListResponse.

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<LiveChatModeratorListResponse> list(
  core.String liveChatId,
  core.List<core.String> part, {
  core.int? maxResults,
  core.String? pageToken,
  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 (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

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

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