list method

Future<SearchListResponse> list(
  1. List<String> part, {
  2. String? channelId,
  3. String? channelType,
  4. String? eventType,
  5. bool? forContentOwner,
  6. bool? forDeveloper,
  7. bool? forMine,
  8. String? location,
  9. String? locationRadius,
  10. int? maxResults,
  11. String? onBehalfOfContentOwner,
  12. String? order,
  13. String? pageToken,
  14. String? publishedAfter,
  15. String? publishedBefore,
  16. String? q,
  17. String? regionCode,
  18. String? relevanceLanguage,
  19. String? safeSearch,
  20. String? topicId,
  21. List<String>? type,
  22. String? videoCaption,
  23. String? videoCategoryId,
  24. String? videoDefinition,
  25. String? videoDimension,
  26. String? videoDuration,
  27. String? videoEmbeddable,
  28. String? videoLicense,
  29. String? videoPaidProductPlacement,
  30. String? videoSyndicated,
  31. String? videoType,
  32. String? $fields,
})

Retrieves a list of search resources

Request parameters:

part - The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet.

channelId - Filter on resources belonging to this channelId.

channelType - Add a filter on the channel search. Possible string values are:

  • "channelTypeUnspecified"
  • "any" : Return all channels.
  • "show" : Only retrieve shows.

eventType - Filter on the livestream status of the videos. Possible string values are:

  • "none"
  • "upcoming" : The live broadcast is upcoming.
  • "live" : The live broadcast is active.
  • "completed" : The live broadcast has been completed.

forContentOwner - Search owned by a content owner.

forDeveloper - Restrict the search to only retrieve videos uploaded using the project id of the authenticated user.

forMine - Search for the private videos of the authenticated user.

location - Filter on location of the video

locationRadius - Filter on distance from the location (specified above).

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".

onBehalfOfContentOwner - Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

order - Sort order of the results. Possible string values are:

  • "searchSortUnspecified"
  • "date" : Resources are sorted in reverse chronological order based on the date they were created.
  • "rating" : Resources are sorted from highest to lowest rating.
  • "viewCount" : Resources are sorted from highest to lowest number of views.
  • "relevance" : Resources are sorted based on their relevance to the search query. This is the default value for this parameter.
  • "title" : Resources are sorted alphabetically by title.
  • "videoCount" : Channels are sorted in descending order of their number of uploaded videos.

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 - Filter on resources published after this date.

publishedBefore - Filter on resources published before this date.

q - Textual search terms to match.

regionCode - Display the content as seen by viewers in this country.

relevanceLanguage - Return results relevant to this language.

safeSearch - Indicates whether the search results should include restricted content as well as standard content. Possible string values are:

  • "safeSearchSettingUnspecified"
  • "none" : YouTube will not filter the search result set.
  • "moderate" : YouTube will filter some content from search results and, at the least, will filter content that is restricted in your locale. Based on their content, search results could be removed from search results or demoted in search results. This is the default parameter value.
  • "strict" : YouTube will try to exclude all restricted content from the search result set. Based on their content, search results could be removed from search results or demoted in search results.

topicId - Restrict results to a particular topic.

type - Restrict results to a particular set of resource types from One Platform.

videoCaption - Filter on the presence of captions on the videos. Possible string values are:

  • "videoCaptionUnspecified"
  • "any" : Do not filter results based on caption availability.
  • "closedCaption" : Only include videos that have captions.
  • "none" : Only include videos that do not have captions.

videoCategoryId - Filter on videos in a specific category.

videoDefinition - Filter on the definition of the videos. Possible string values are:

  • "any" : Return all videos, regardless of their resolution.
  • "standard" : Only retrieve videos in standard definition.
  • "high" : Only retrieve HD videos.

videoDimension - Filter on 3d videos. Possible string values are:

  • "any" : Include both 3D and non-3D videos in returned results. This is the default value.
  • "2d" : Restrict search results to exclude 3D videos.
  • "3d" : Restrict search results to only include 3D videos.

videoDuration - Filter on the duration of the videos. Possible string values are:

  • "videoDurationUnspecified"
  • "any" : Do not filter video search results based on their duration. This is the default value.
  • "short" : Only include videos that are less than four minutes long.
  • "medium" : Only include videos that are between four and 20 minutes long (inclusive).
  • "long" : Only include videos longer than 20 minutes.

videoEmbeddable - Filter on embeddable videos. Possible string values are:

  • "videoEmbeddableUnspecified"
  • "any" : Return all videos, embeddable or not.
  • "true" : Only retrieve embeddable videos.

videoLicense - Filter on the license of the videos. Possible string values are:

  • "any" : Return all videos, regardless of which license they have, that match the query parameters.
  • "youtube" : Only return videos that have the standard YouTube license.
  • "creativeCommon" : Only return videos that have a Creative Commons license. Users can reuse videos with this license in other videos that they create. Learn more.

videoPaidProductPlacement - null Possible string values are:

  • "videoPaidProductPlacementUnspecified"
  • "any" : Return all videos, paid product placement or not.
  • "true" : Restrict results to only videos with paid product placement.

videoSyndicated - Filter on syndicated videos. Possible string values are:

  • "videoSyndicatedUnspecified"
  • "any" : Return all videos, syndicated or not.
  • "true" : Only retrieve syndicated videos.

videoType - Filter on videos of a specific type. Possible string values are:

  • "videoTypeUnspecified"
  • "any" : Return all videos.
  • "movie" : Only retrieve movies.
  • "episode" : Only retrieve episodes of shows.

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

Completes with a SearchListResponse.

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<SearchListResponse> list(
  core.List<core.String> part, {
  core.String? channelId,
  core.String? channelType,
  core.String? eventType,
  core.bool? forContentOwner,
  core.bool? forDeveloper,
  core.bool? forMine,
  core.String? location,
  core.String? locationRadius,
  core.int? maxResults,
  core.String? onBehalfOfContentOwner,
  core.String? order,
  core.String? pageToken,
  core.String? publishedAfter,
  core.String? publishedBefore,
  core.String? q,
  core.String? regionCode,
  core.String? relevanceLanguage,
  core.String? safeSearch,
  core.String? topicId,
  core.List<core.String>? type,
  core.String? videoCaption,
  core.String? videoCategoryId,
  core.String? videoDefinition,
  core.String? videoDimension,
  core.String? videoDuration,
  core.String? videoEmbeddable,
  core.String? videoLicense,
  core.String? videoPaidProductPlacement,
  core.String? videoSyndicated,
  core.String? videoType,
  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 (channelType != null) 'channelType': [channelType],
    if (eventType != null) 'eventType': [eventType],
    if (forContentOwner != null) 'forContentOwner': ['${forContentOwner}'],
    if (forDeveloper != null) 'forDeveloper': ['${forDeveloper}'],
    if (forMine != null) 'forMine': ['${forMine}'],
    if (location != null) 'location': [location],
    if (locationRadius != null) 'locationRadius': [locationRadius],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (onBehalfOfContentOwner != null)
      'onBehalfOfContentOwner': [onBehalfOfContentOwner],
    if (order != null) 'order': [order],
    if (pageToken != null) 'pageToken': [pageToken],
    if (publishedAfter != null) 'publishedAfter': [publishedAfter],
    if (publishedBefore != null) 'publishedBefore': [publishedBefore],
    if (q != null) 'q': [q],
    if (regionCode != null) 'regionCode': [regionCode],
    if (relevanceLanguage != null) 'relevanceLanguage': [relevanceLanguage],
    if (safeSearch != null) 'safeSearch': [safeSearch],
    if (topicId != null) 'topicId': [topicId],
    if (type != null) 'type': type,
    if (videoCaption != null) 'videoCaption': [videoCaption],
    if (videoCategoryId != null) 'videoCategoryId': [videoCategoryId],
    if (videoDefinition != null) 'videoDefinition': [videoDefinition],
    if (videoDimension != null) 'videoDimension': [videoDimension],
    if (videoDuration != null) 'videoDuration': [videoDuration],
    if (videoEmbeddable != null) 'videoEmbeddable': [videoEmbeddable],
    if (videoLicense != null) 'videoLicense': [videoLicense],
    if (videoPaidProductPlacement != null)
      'videoPaidProductPlacement': [videoPaidProductPlacement],
    if (videoSyndicated != null) 'videoSyndicated': [videoSyndicated],
    if (videoType != null) 'videoType': [videoType],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'youtube/v3/search';

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