sochkeal/Satori/FutamiCommon.cs

27 lines
761 B
C#
Raw Normal View History

2023-06-28 20:12:23 +00:00
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")
);
}
}
}