package models
import (
    "errors"
)
// Malware threat status
type WindowsMalwareThreatState int

const (
    // Active
    ACTIVE_WINDOWSMALWARETHREATSTATE WindowsMalwareThreatState = iota
    // Action failed
    ACTIONFAILED_WINDOWSMALWARETHREATSTATE
    // Manual steps required
    MANUALSTEPSREQUIRED_WINDOWSMALWARETHREATSTATE
    // Full scan required
    FULLSCANREQUIRED_WINDOWSMALWARETHREATSTATE
    // Reboot required
    REBOOTREQUIRED_WINDOWSMALWARETHREATSTATE
    // Remediated with non critical failures 
    REMEDIATEDWITHNONCRITICALFAILURES_WINDOWSMALWARETHREATSTATE
    // Quarantined
    QUARANTINED_WINDOWSMALWARETHREATSTATE
    // Removed
    REMOVED_WINDOWSMALWARETHREATSTATE
    // Cleaned
    CLEANED_WINDOWSMALWARETHREATSTATE
    // Allowed
    ALLOWED_WINDOWSMALWARETHREATSTATE
    // No status cleared
    NOSTATUSCLEARED_WINDOWSMALWARETHREATSTATE
)

func (i WindowsMalwareThreatState) String() string {
    return []string{"active", "actionFailed", "manualStepsRequired", "fullScanRequired", "rebootRequired", "remediatedWithNonCriticalFailures", "quarantined", "removed", "cleaned", "allowed", "noStatusCleared"}[i]
}
func ParseWindowsMalwareThreatState(v string) (any, error) {
    result := ACTIVE_WINDOWSMALWARETHREATSTATE
    switch v {
        case "active":
            result = ACTIVE_WINDOWSMALWARETHREATSTATE
        case "actionFailed":
            result = ACTIONFAILED_WINDOWSMALWARETHREATSTATE
        case "manualStepsRequired":
            result = MANUALSTEPSREQUIRED_WINDOWSMALWARETHREATSTATE
        case "fullScanRequired":
            result = FULLSCANREQUIRED_WINDOWSMALWARETHREATSTATE
        case "rebootRequired":
            result = REBOOTREQUIRED_WINDOWSMALWARETHREATSTATE
        case "remediatedWithNonCriticalFailures":
            result = REMEDIATEDWITHNONCRITICALFAILURES_WINDOWSMALWARETHREATSTATE
        case "quarantined":
            result = QUARANTINED_WINDOWSMALWARETHREATSTATE
        case "removed":
            result = REMOVED_WINDOWSMALWARETHREATSTATE
        case "cleaned":
            result = CLEANED_WINDOWSMALWARETHREATSTATE
        case "allowed":
            result = ALLOWED_WINDOWSMALWARETHREATSTATE
        case "noStatusCleared":
            result = NOSTATUSCLEARED_WINDOWSMALWARETHREATSTATE
        default:
            return 0, errors.New("Unknown WindowsMalwareThreatState value: " + v)
    }
    return &result, nil
}
func SerializeWindowsMalwareThreatState(values []WindowsMalwareThreatState) []string {
    result := make([]string, len(values))
    for i, v := range values {
        result[i] = v.String()
    }
    return result
}
