using System.ComponentModel;
using System.Text.Json.Serialization;
using Luski.net.Enums;

namespace Luski.Classes;

public class UpdaterSettings
{
    [JsonInclude]
    [Description("Self Contained")]
    [JsonPropertyName("self_contained")]
    public bool SelfContained { get; set; } = false;

    [JsonInclude]
    [JsonPropertyName("updater")]
    public string? Updater { get; set; } = null;

    [JsonInclude]
    [JsonPropertyName("platform")]
    public string Platform { get; set; } = "linux-x64";

    [JsonInclude]
    [Description("Auto Launch")]
    [JsonPropertyName("auto_launch")]
    public bool AutoLaunch { get; set; } = true;
    [JsonInclude]
    [Description("Auto Update")]
    [JsonPropertyName("auto_update")]
    public bool AutoUpdate { get; set; } = false;
    
    [JsonInclude]
    [Description("Check For Updates")]
    [JsonPropertyName("update_check")]
    public bool AutoUpdateCheck { get; set; } = true;
}

[JsonSerializable(typeof(UpdaterSettings))]
[JsonSourceGenerationOptions(
    GenerationMode = JsonSourceGenerationMode.Default,
    PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified,
    WriteIndented = true,
    DefaultIgnoreCondition = JsonIgnoreCondition.Never)]
internal partial class UpdaterSettingsContext : JsonSerializerContext
{

}
