public string ListVideos(YouTubeVideoOptions options) { // Initialize the query NameValueCollection query = new NameValueCollection { { "part", "id,snippet,contentDetails,fileDetails,liveStreamingDetails,player,processingDetails,recordingDetails,statistics,status,suggestions,topicDetails" }, { "access_token", Client.AccessToken }, { "key", Client.ApiKey } }; // Optional parameters if (options != null) { if (options.Ids != null && options.Ids.Length > 0) { query.Add("id", String.Join(",", options.Ids)); } if (options.MaxResults > 0) { query.Add("maxResults", options.MaxResults + ""); } if (!String.IsNullOrWhiteSpace(options.PageToken)) { query.Add("pageToken", options.PageToken); } } // Make the call to the API return(SocialUtils.DoHttpGetRequestAndGetBodyAsString("https://www.googleapis.com/youtube/v3/videos", query)); }
/// <summary> /// Gets a list of videos from the sepcified <var>options</var>. /// </summary> /// <param name="options">The options specifying the query.</param> public YouTubeVideoListResponse ListVideos(YouTubeVideoOptions options) { return(YouTubeVideoListResponse.ParseJson(Raw.ListVideos(options))); }