using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace StellaOps.Feedser.Source.Ics.Cisa.Internal;

public sealed record IcsCisaAdvisoryDto
{
    [JsonPropertyName("advisoryId")]
    public required string AdvisoryId { get; init; }

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

    [JsonPropertyName("link")]
    public required string Link { get; init; }

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

    [JsonPropertyName("descriptionHtml")]
    public string DescriptionHtml { get; init; } = string.Empty;

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

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

    [JsonPropertyName("medical")]
    public bool IsMedical { get; init; }

    [JsonPropertyName("aliases")]
    public IReadOnlyCollection<string> Aliases { get; init; } = Array.Empty<string>();

    [JsonPropertyName("cveIds")]
    public IReadOnlyCollection<string> CveIds { get; init; } = Array.Empty<string>();

    [JsonPropertyName("vendors")]
    public IReadOnlyCollection<string> Vendors { get; init; } = Array.Empty<string>();

    [JsonPropertyName("products")]
    public IReadOnlyCollection<string> Products { get; init; } = Array.Empty<string>();

    [JsonPropertyName("references")]
    public IReadOnlyCollection<string> References { get; init; } = Array.Empty<string>();

    [JsonPropertyName("attachments")]
    public IReadOnlyCollection<IcsCisaAttachmentDto> Attachments { get; init; } = Array.Empty<IcsCisaAttachmentDto>();

    [JsonPropertyName("mitigations")]
    public IReadOnlyCollection<string> Mitigations { get; init; } = Array.Empty<string>();

    [JsonPropertyName("detailHtml")]
    public string? DetailHtml { get; init; }
}
