示例#1
0
        internal static RestFeaturedStream Create(BaseTwitchClient client, Model model)
        {
            var entity = new RestFeaturedStream();

            entity.Update(client, model);
            return(entity);
        }
示例#2
0
        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);
        }
示例#3
0
        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());
        }