24 lines
624 B
C#
24 lines
624 B
C#
using Newtonsoft.Json;
|
|
|
|
namespace ModpackUpdater;
|
|
|
|
public class UpdateInfos
|
|
{
|
|
public List<UpdateInfo> Updates { get; private set; } = [];
|
|
|
|
public static UpdateInfos? Parse(string? content)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(content))
|
|
return null;
|
|
return JsonConvert.DeserializeObject<UpdateInfos>(content);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return JsonConvert.SerializeObject(this, new JsonSerializerSettings
|
|
{
|
|
Formatting = Formatting.Indented,
|
|
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
|
|
});
|
|
}
|
|
} |