using System.Text.Json.Serialization;

namespace StellaOps.Feedser.Source.CertBund.Internal;

internal sealed record CertBundDetailResponse
{
    [JsonPropertyName("name")]
    public string? Name { get; init; }

    [JsonPropertyName("title")]
    public string? Title { get; init; }

    [JsonPropertyName("summary")]
    public string? Summary { get; init; }

    [JsonPropertyName("description")]
    public string? Description { get; init; }

    [JsonPropertyName("severity")]
    public string? Severity { get; init; }

    [JsonPropertyName("language")]
    public string? Language { get; init; }

    [JsonPropertyName("published")]
    public DateTimeOffset? Published { get; init; }

    [JsonPropertyName("updated")]
    public DateTimeOffset? Updated { get; init; }

    [JsonPropertyName("cveIds")]
    public string[]? CveIds { get; init; }

    [JsonPropertyName("references")]
    public CertBundDetailReference[]? References { get; init; }

    [JsonPropertyName("products")]
    public CertBundDetailProduct[]? Products { get; init; }
}

internal sealed record CertBundDetailReference
{
    [JsonPropertyName("url")]
    public string? Url { get; init; }

    [JsonPropertyName("label")]
    public string? Label { get; init; }
}

internal sealed record CertBundDetailProduct
{
    [JsonPropertyName("vendor")]
    public string? Vendor { get; init; }

    [JsonPropertyName("name")]
    public string? Name { get; init; }

    [JsonPropertyName("versions")]
    public string? Versions { get; init; }
}
