com.nutanix.dp1.pri.prism.v4.common.Severity Maven / Gradle / Ivy
/*
* Generated file ..
*
* Product version: 4.0.3-alpha-2
*
* Part of the Nutanix Prism Versioned APIs
*
* (c) 2023 Nutanix Inc. All rights reserved
*
*/
package com.nutanix.dp1.pri.prism.v4.common;
import javax.validation.constraints.*;
import static com.nutanix.dp1.pri.deserializers.PriDeserializerUtils.*;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Severity of an alert
*/
public enum Severity {
$UNKNOWN,
$REDACTED,
/**
* Indicates that the severity of the alert is informational. This means that an actionable minor problem has been detected. It should be resolved relatively soon and not ignored.
*/
INFO,
/**
* Indicates that the severity of the alert is warning. This means that an actionable issue has been detected, and user intervention is required. A more serious issue may develop if this is not resolved soon.
*/
WARNING,
/**
* Indicates that the severity of the alert is critical. This means that an actionable critical situation has been detected, and action is required immediately. The cluster may have the potential to stop running, or it could run into irreparable issues.
*/
CRITICAL ;
private static final Map lookup = new LinkedHashMap();
static {
lookup.put("$UNKNOWN", $UNKNOWN);
lookup.put("$REDACTED", $REDACTED);
lookup.put("INFO", INFO);
lookup.put("WARNING", WARNING);
lookup.put("CRITICAL", CRITICAL);
}
@JsonCreator
public static Severity fromString(String enumTypeVar) {
return lookup.getOrDefault(enumTypeVar, Severity.$UNKNOWN);
}
@JsonValue
public String fromEnum() {
for (Map.Entry entry : lookup.entrySet()) {
if (entry.getValue() == this) {
return entry.getKey();
}
}
return "$UNKNOWN";
}
}