Beispiel #1
0
        internal new static RestTopCommunity Create(BaseRestClient client, Model model)
        {
            var entity = new RestTopCommunity(client, model.Id);

            entity.Update(model);
            return(entity);
        }
Beispiel #2
0
        public static async Task <IReadOnlyCollection <RestTopCommunity> > GetTopCommunitiesAsync(BaseRestClient client, uint limit)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.GetTopCommunitiesInternalAsync(token, limit);

            var entity = model.Communities.Select(x => RestTopCommunity.Create(client, x));

            return(entity.ToArray());
        }
Beispiel #3
0
        public static async Task <IReadOnlyCollection <RestTopCommunity> > GetTopCommunitiesAsync(BaseTwitchClient client, PageOptions paging = null, RequestOptions options = null)
        {
            var model = await client.ApiClient.GetTopCommunitiesAsync(paging, options).ConfigureAwait(false);

            if (model.Communities != null)
            {
                return(model.Communities.Select(x => RestTopCommunity.Create(client, x)).ToArray());
            }
            return(null);
        }