list method
Retrieves a list of resources, possibly filtered.
Request parameters:
part
- The part parameter specifies a comma-separated list of one or
more activity resource properties that the API response will include. If
the parameter identifies a property that contains child properties, the
child properties will be included in the response. For example, in an
activity resource, the snippet property contains other properties that
identify the type of activity, a display title for the activity, and so
forth. If you set part=snippet, the API response will also contain all
of those nested properties.
channelId
- null
home
- null
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".
mine
- null
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.
publishedAfter
- null
publishedBefore
- null
regionCode
- null
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ActivityListResponse.
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<ActivityListResponse> list(
core.List<core.String> part, {
core.String? channelId,
core.bool? home,
core.int? maxResults,
core.bool? mine,
core.String? pageToken,
core.String? publishedAfter,
core.String? publishedBefore,
core.String? regionCode,
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 (channelId != null) 'channelId': [channelId],
if (home != null) 'home': ['${home}'],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (mine != null) 'mine': ['${mine}'],
if (pageToken != null) 'pageToken': [pageToken],
if (publishedAfter != null) 'publishedAfter': [publishedAfter],
if (publishedBefore != null) 'publishedBefore': [publishedBefore],
if (regionCode != null) 'regionCode': [regionCode],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'youtube/v3/activities';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ActivityListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}