list method

Future<VideoCategoryListResponse> list(
  1. List<String> part, {
  2. String? hl,
  3. List<String>? id,
  4. String? regionCode,
  5. String? $fields,
})

Retrieves a list of resources, possibly filtered.

Request parameters:

part - The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet.

hl - null

id - Returns the video categories with the given IDs for Stubby or Apiary.

regionCode - null

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

Completes with a VideoCategoryListResponse.

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<VideoCategoryListResponse> list(
  core.List<core.String> part, {
  core.String? hl,
  core.List<core.String>? id,
  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 (hl != null) 'hl': [hl],
    if (id != null) 'id': id,
    if (regionCode != null) 'regionCode': [regionCode],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'youtube/v3/videoCategories';

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