/// <param name="optional">Optional paramaters.</param> /// <returns>SubscriptionListResponseResponse</returns> public static SubscriptionListResponse List(YouTubeService service, string part, SubscriptionsListOptionalParms optional = null) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (part == null) throw new ArgumentNullException(part); // Building the initial request. var request = service.Subscriptions.List(part); // Applying optional parameters to the request. request = (SubscriptionsResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional); // Requesting data. return request.Execute(); } catch (Exception ex) { throw new Exception("Request Subscriptions.List failed.", ex); } }
/// <summary> /// Uploads a custom video thumbnail to YouTube and sets it for a video. /// Documentation https://developers.google.com/youtube/v3/reference/thumbnails/set /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated YouTube service.</param> /// <param name="videoId">The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided.</param> /// <param name="optional">Optional paramaters.</param> /// <returns>ThumbnailSetResponseResponse</returns> public static ThumbnailSetResponse Set(YouTubeService service, string videoId, ThumbnailsSetOptionalParms optional = null) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (videoId == null) throw new ArgumentNullException(videoId); // Building the initial request. var request = service.Thumbnails.Set(videoId); // Applying optional parameters to the request. request = (ThumbnailsResource.SetRequest)SampleHelpers.ApplyOptionalParms(request, optional); // Requesting data. return request.Execute(); } catch (Exception ex) { throw new Exception("Request Thumbnails.Set failed.", ex); } }