protected async Task <Note[]> UsersNotesAsync(UsersNotesQuerySpec qs, string userId = null, string username = null, string host = null) { var q = new Dictionary <string, object>() { { "userId", userId }, { "username", username }, { "host", host }, { "includeReplies", qs.IncludeReplies }, { "withMedia", qs.WithMedia }, { "limit", qs.Limit }, }; if (!string.IsNullOrEmpty(qs.SinceId)) { q.Add("sinceId", qs.SinceId); } else if (!string.IsNullOrEmpty(qs.UntilId)) { q.Add("untilId", qs.UntilId); } else if (qs.SinceDate > 0) { q.Add("sinceDate", qs.SinceDate); } else if (qs.UntilDate > 0) { q.Add("untilDate", qs.UntilDate); } return(await RequestArrayAsync <Note>("/api/users/notes", q)); }
/// <summary> /// Fetch users notes by username and host /// </summary> /// <param name="username">username</param> /// <param name="host">host</param> /// <param name="querySpec">querySpec</param> /// <returns>users notes</returns> public async Task <Note[]> UsersNotesByNameAsync(string username, string host, UsersNotesQuerySpec querySpec) { return(await UsersNotesAsync(querySpec, null, username, host)); }
/// <summary> /// Fetch users notes by UserId /// </summary> /// <param name="userId">userId</param> /// <param name="querySpec">querySpec</param> /// <returns>users notes</returns> public async Task <Note[]> UsersNotesByIdAsync(string userId, UsersNotesQuerySpec querySpec) { return(await UsersNotesAsync(querySpec, userId, null, null)); }