list method
Retrieves a list of all pricing levels offered by a creator to the fans.
Request parameters:
part
- The part parameter specifies the membershipsLevel resource
parts that the API response will include. Supported values are id and
snippet.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a MembershipsLevelListResponse.
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<MembershipsLevelListResponse> list(
core.List<core.String> part, {
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 ($fields != null) 'fields': [$fields],
};
const url_ = 'youtube/v3/membershipsLevels';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return MembershipsLevelListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}