1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 02:47:37 +08:00
osu-lazer/osu.Game/Online/API/Requests/Responses/APIKudosuHistory.cs

72 lines
1.7 KiB
C#
Raw Normal View History

2019-08-09 15:47:52 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
2019-08-19 02:27:53 +08:00
using Humanizer;
2019-08-09 15:47:52 +08:00
using Newtonsoft.Json;
namespace osu.Game.Online.API.Requests.Responses
{
public class APIKudosuHistory
{
2019-08-09 16:19:14 +08:00
[JsonProperty("created_at")]
2019-08-09 15:47:52 +08:00
public DateTimeOffset CreatedAt;
[JsonProperty("amount")]
public int Amount;
2019-08-19 02:27:53 +08:00
[JsonProperty("post")]
public ModdingPost Post;
public class ModdingPost
{
[JsonProperty("url")]
public string Url;
[JsonProperty("title")]
public string Title;
}
[JsonProperty("giver")]
public KudosuGiver Giver;
public class KudosuGiver
{
[JsonProperty("url")]
public string Url;
[JsonProperty("username")]
public string Username;
}
[JsonProperty("action")]
private string action
{
set
{
2019-08-30 15:26:11 +08:00
//We will receive something like "event.action" or just "action"
2019-08-19 02:27:53 +08:00
string parsed = value.Contains(".") ? value.Split('.')[0].Pascalize() + value.Split('.')[1].Pascalize() : value.Pascalize();
Action = (KudosuAction)Enum.Parse(typeof(KudosuAction), parsed);
}
}
public KudosuAction Action;
2019-08-09 15:47:52 +08:00
}
2019-09-02 14:57:55 +08:00
public enum KudosuAction
{
AllowKudosuGive,
DeleteReset,
DenyKudosuReset,
ForumGive,
ForumReset,
ForumRevoke,
RecalculateGive,
RecalculateReset,
RestoreGive,
VoteGive,
VoteReset,
}
2019-08-09 15:47:52 +08:00
}