private IPagedList<User> GetUsers(UserOptions options, string[] urlParameters) { var response = MakeRequest<UserResponse>("users", urlParameters, new { key = apiKey, page = options.Page ?? null, pagesize = options.PageSize ?? null, filter = options.Filter, sort = options.SortBy.ToString().ToLower(), order = GetSortDirection(options.SortDirection), fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null, todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null, min = options.Min ?? null, max = options.Max ?? null }); return new PagedList<User>(response.Users, response); }
public virtual void GetUserMentions(IEnumerable <int> userIds, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, UserOptions options) { MakeRequest <CommentResponse>("users", new string[] { userIds.Vectorize(), "mentioned" }, new { key = apiKey, page = options.Page ?? null, pagesize = options.PageSize ?? null, filter = options.Filter, sort = options.SortBy.ToString().ToLower(), order = GetSortDirection(options.SortDirection), fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null, todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null, min = options.Min ?? null, max = options.Max ?? null }, (items) => onSuccess(new PagedList <Comment>(items.Comments, items)), onError); }
public virtual void GetUserMentions(int userId, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, UserOptions options) { GetUserMentions(new int[] { userId }, onSuccess, onError, options); }
public virtual void GetUsers(IEnumerable <int> userIds, Action <IPagedList <User> > onSuccess, Action <ApiException> onError, UserOptions options) { GetUsers(onSuccess, onError, new string[] { userIds.Vectorize() }, options); }
public virtual void GetUsers(Action <IPagedList <User> > onSuccess, Action <ApiException> onError, UserOptions options) { GetUsers(onSuccess, onError, null, options); }
private void GetUsers(Action <IPagedList <User> > onSuccess, Action <ApiException> onError, string[] urlParameters, UserOptions options) { MakeRequest <UserResponse>("users", urlParameters, new { key = apiKey, page = options.Page ?? null, pagesize = options.PageSize ?? null, filter = options.Filter, sort = options.SortBy.ToString().ToLower(), order = GetSortDirection(options.SortDirection), fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null, todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null, min = options.Min ?? null, max = options.Max ?? null }, (items) => onSuccess(new PagedList <User>(items.Users, items)), onError); }
public virtual IPagedList<User> GetUsers(IEnumerable<int> userIds, UserOptions options) { return GetUsers(options, new string[] { userIds.Vectorize() }); }
public virtual IPagedList<User> GetModerators(UserOptions options) { return GetUsers(options, new string[] { "moderators" }); }
public virtual IPagedList<User> GetUsers(UserOptions options) { return GetUsers(options, null); }