sochkeal/Satori/FutamiCommon.cs
2023-06-28 22:12:23 +02:00

26 lines
761 B
C#

using System.Net.Http;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace SockChatKeepAlive {
public class FutamiCommon {
[JsonPropertyName("ping")]
public int Ping { get; set; }
[JsonPropertyName("uiharu")]
public string Metadata { get; set; }
[JsonPropertyName("eeprom")]
public string Uploads { get; set; }
[JsonPropertyName("servers")]
public string[] Servers { get; set; }
public static async Task<FutamiCommon> FetchAsync(HttpClient client, string host) {
return JsonSerializer.Deserialize<FutamiCommon>(
await client.GetByteArrayAsync(host + "/common.json")
);
}
}
}