Пример #1
0
 public async Task <MaybeResult <YouTubeSearchDto, StreamProviderError> > SearchGamingVideos(
     string query, VideoEventType eventType, VideoSortType order, int pageSize, string pageToken)
 {
     return(await BuildRequest("/youtube/v3/search")
            .SetQueryParam("part", "snippet")
            .SetQueryParam("eventType", eventType.GetAsString())
            .SetQueryParam("q", query)
            .SetQueryParam("type", "video")
            .SetQueryParam("videoCategoryId", 20)
            .SetQueryParam("maxResults", pageSize)
            .SetQueryParam("pageToken", pageToken)
            .SetQueryParam("order", order.GetAsString())
            .GetAsync()
            .GetOrError <YouTubeSearchDto>());
 }
Пример #2
0
 public static string GetAsString(this VideoEventType videoEventType)
 {
     return(videoEventType.ToString().ToLower());
 }