internal static RestFeaturedStream Create(BaseTwitchClient client, Model model) { var entity = new RestFeaturedStream(); entity.Update(client, model); return(entity); }
public static async Task <IReadOnlyCollection <RestFeaturedStream> > GetFeaturedStreamsAsync(BaseTwitchClient client, PageOptions paging, RequestOptions options = null) { var model = await client.ApiClient.GetFeaturedStreamsAsync(paging, options).ConfigureAwait(false); if (model.Featured != null) { return(model.Featured.Select(x => RestFeaturedStream.Create(client, x)).ToArray()); } return(null); }
internal static async Task <IReadOnlyCollection <RestFeaturedStream> > GetFeaturedStreamsAsync(BaseRestClient client, uint limit, uint offset) { var token = TokenHelper.GetSingleToken(client); var model = await client.RestClient.GetFeaturedStreamsInternalAsync(token, limit, offset); if (model == null) { return(new List <RestFeaturedStream>()); } var entity = model.Featured.Select(x => RestFeaturedStream.Create(client, x)); return(entity.ToArray()); }