/// <summary> /// Get a history of notifications of current API client. History items are stored for 24 hours. /// <remarks>User API key usage permitted if subscribe permission is added through apikey.authorize().</remarks> /// </summary> /// <param name="sinceId">If specified, will only return data with id higher than since_id (newer).</param> /// <param name="sinceTime">String with date. If specified, will only return data with timestamp after specified value (newer).</param> /// <param name="limit">Maximum number of history items to get. Default and max: 100.</param> /// <param name="order">Order of data that will be returned.</param> /// <returns>List of History objects.</returns> public async Task <List <History> > GetHistory(string sinceId = null, DateTime?sinceTime = null, int limit = MaxLimit, DataObjectOrder order = DataObjectOrder.Ascending) { if (limit > MaxLimit || limit < 1) { throw new ArgumentException(); } return (await _syncanoClient.GetAsync <List <History> >("notification.get_history", new { since_id = sinceId, since_time = sinceTime, limit, order = DataObjectOrderStringConverter.GetString(order) }, "history")); }
/// <summary> /// Gets string representing DataObjectOrder object. /// </summary> /// <param name="order">Order object.</param> /// <returns>String object.</returns> public static string GetString(DataObjectOrder order) { string result; switch (order) { case DataObjectOrder.Ascending: result = "ASC"; break; case DataObjectOrder.Descending: result = "DESC"; break; default: result = ""; break; } return(result); }
/// <summary> /// Gets string representing DataObjectOrder object. /// </summary> /// <param name="order">Order object.</param> /// <returns>String object.</returns> public static string GetString(DataObjectOrder order) { string result; switch (order) { case DataObjectOrder.Ascending: result = "ASC"; break; case DataObjectOrder.Descending: result = "DESC"; break; default: result = ""; break; } return result; }
/// <summary> /// Get a history of notifications of current API client. History items are stored for 24 hours. /// <remarks>User API key usage permitted if subscribe permission is added through apikey.authorize().</remarks> /// </summary> /// <param name="sinceId">If specified, will only return data with id higher than since_id (newer).</param> /// <param name="sinceTime">String with date. If specified, will only return data with timestamp after specified value (newer).</param> /// <param name="limit">Maximum number of history items to get. Default and max: 100.</param> /// <param name="order">Order of data that will be returned.</param> /// <returns>List of History objects.</returns> public async Task<List<History>> GetHistory(string sinceId = null, DateTime? sinceTime = null, int limit = MaxLimit, DataObjectOrder order = DataObjectOrder.Ascending) { if (limit > MaxLimit || limit < 1) throw new ArgumentException(); return await _syncanoClient.GetAsync<List<History>>("notification.get_history", new { since_id = sinceId, since_time = sinceTime, limit, order = DataObjectOrderStringConverter.GetString(order) }, "history"); }