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

            entity.Update(model);
            return(entity);
        }
示例#2
0
        internal static async Task <IReadOnlyCollection <RestChannelFollow> > GetFollowsAsync(BaseRestClient client, ulong userId, SortMode sort, bool ascending, uint limit, uint offset)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.GetFollowsInternalAsync(token, userId, sort, ascending, limit, offset);

            var entity = model.Follows.Select(x =>
            {
                var follow = new RestChannelFollow(client);
                follow.Update(x);
                return(follow);
            });

            return(entity.ToArray());
        }
示例#3
0
        internal static async Task <RestChannelFollow> GetFollowAsync(BaseRestClient client, ulong userId, ulong channelId)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.GetFollowInternalAsync(token, userId, channelId);

            if (model == null)
            {
                return(null);
            }

            var entity = new RestChannelFollow(client);

            entity.Update(model);
            return(entity);
        }
示例#4
0
        public static async Task <RestChannelFollow> GetFollowAsync(BaseTwitchClient client, ulong userId, ulong channelId, RequestOptions options)
        {
            var model = await client.ApiClient.GetFollowAsync(userId, channelId, options).ConfigureAwait(false);

            return(RestChannelFollow.Create(client, model));
        }
示例#5
0
        // Follows
        public static async Task <IReadOnlyCollection <RestChannelFollow> > GetFollowsAsync(BaseTwitchClient client, ulong userId, SortMode sort, bool ascending, PageOptions paging = null, RequestOptions options = null)
        {
            var model = await client.ApiClient.GetFollowsAsync(userId, sort, ascending, paging, options).ConfigureAwait(false);

            return(model.Follows.Select(x => RestChannelFollow.Create(client, x)).ToArray());
        }