package unmarshal

import "io"

type KnownExploitedVulnerability struct {
	CveID                      string   `json:"cveID"`
	VendorProject              string   `json:"vendorProject"`
	Product                    string   `json:"product"`
	VulnerabilityName          string   `json:"vulnerabilityName"`
	DateAdded                  string   `json:"dateAdded"`
	ShortDescription           string   `json:"shortDescription"`
	RequiredAction             string   `json:"requiredAction"`
	DueDate                    string   `json:"dueDate"`
	KnownRansomwareCampaignUse string   `json:"knownRansomwareCampaignUse"`
	Notes                      string   `json:"notes"`
	CWEs                       []string `json:"cwes"`
}

func (g KnownExploitedVulnerability) IsEmpty() bool {
	return g.CveID == ""
}

func KnownExploitedVulnerabilityEntries(reader io.Reader) ([]KnownExploitedVulnerability, error) {
	return unmarshalSingleOrMulti[KnownExploitedVulnerability](reader)
}
