forked from SOBotics/SharpExchange
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f90dc92
commit 41b23d0
Showing
5 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using SharpExchange.Api.V22.Types; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SharpExchange.Api.V22.Endpoints | ||
{ | ||
public static class UserTimelines | ||
{ | ||
/// <summary> | ||
/// Gets a subset of the actions of that have been taken by | ||
/// the users identified by a set of ids. | ||
/// </summary> | ||
public static Task<Result<UserTimeline[]>> GetByIdsAsync(IEnumerable<int> userIds, QueryOptions options = null) | ||
{ | ||
userIds.ThrowIfNullOrEmpty(nameof(userIds)); | ||
options = options.GetDefaultIfNull(); | ||
|
||
var idsStr = userIds.ToDelimitedList(); | ||
var endpoint = $"{Constants.BaseApiUrl}/users/{idsStr}/timeline"; | ||
|
||
return ApiRequestScheduler.ScheduleRequestAsync<UserTimeline[]>(endpoint, options); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace SharpExchange.Api.V22.Types | ||
{ | ||
public class UserTimeline | ||
{ | ||
[JsonProperty("badge_id")] | ||
public int? BadgeId { get; internal set; } | ||
|
||
[JsonProperty("comment_id")] | ||
public int? CommentId { get; internal set; } | ||
|
||
[JsonProperty("creation_date")] | ||
[JsonConverter(typeof(UnixDateTimeConverter))] | ||
public DateTime? CreatedOn { get; internal set; } | ||
|
||
[JsonProperty("detail")] | ||
public string Details { get; internal set; } | ||
|
||
[JsonProperty("link")] | ||
public string Link { get; internal set; } | ||
|
||
[JsonProperty("post_id")] | ||
public int? PostId { get; internal set; } | ||
|
||
[JsonProperty("post_type")] | ||
public PostType PostType { get; internal set; } | ||
|
||
[JsonProperty("suggested_edit_id")] | ||
public int? SuggestedEditid { get; internal set; } | ||
|
||
[JsonProperty("timeline_type")] | ||
public UserTimelineType? TimelineType { get; internal set; } | ||
|
||
[JsonProperty("title")] | ||
public string Title { get; internal set; } | ||
|
||
[JsonProperty("user_id")] | ||
public int? UserId { get; internal set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace SharpExchange.Api.V22.Types | ||
{ | ||
public enum UserTimelineType | ||
{ | ||
[EnumMember(Value = "commented")] | ||
Commented, | ||
|
||
[EnumMember(Value = "asked")] | ||
Asked, | ||
|
||
[EnumMember(Value = "answered")] | ||
Answered, | ||
|
||
[EnumMember(Value = "badge")] | ||
Badge, | ||
|
||
[EnumMember(Value = "revision")] | ||
Revision, | ||
|
||
[EnumMember(Value = "accepted")] | ||
Accepted, | ||
|
||
[EnumMember(Value = "reviewed")] | ||
Reviewed, | ||
|
||
[EnumMember(Value = "suggested")] | ||
Suggested | ||
} | ||
} |