list method
Retrieves a list of members that match the request criteria for a channel.
Request parameters:
part - The part parameter specifies the member resource parts that the
API response will include. Set the parameter value to snippet.
filterByMemberChannelId - Comma separated list of channel IDs. Only data
about members that are part of this list will be included in the response.
hasAccessToLevel - Filter members in the results set to the ones that
have access to a level.
maxResults - The maxResults parameter specifies the maximum number of
items that should be returned in the result set.
Value must be between "0" and "1000".
mode - Parameter that specifies which channel members to return.
Possible string values are:
- "listMembersModeUnknown"
- "updates" : Return only members that joined after the first call with this mode was made.
- "all_current" : Return all current members, from newest to oldest.
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 MemberListResponse.
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<MemberListResponse> list(
core.List<core.String> part, {
core.String? filterByMemberChannelId,
core.String? hasAccessToLevel,
core.int? maxResults,
core.String? mode,
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>>{
'part': part,
'filterByMemberChannelId': ?filterByMemberChannelId == null
? null
: [filterByMemberChannelId],
'hasAccessToLevel': ?hasAccessToLevel == null ? null : [hasAccessToLevel],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'mode': ?mode == null ? null : [mode],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'youtube/v3/members';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return MemberListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}