com.nutanix.dp1.pri.prism.v4.config.TaskStatus 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.config;
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;
/**
* Status of the task.
*/
public enum TaskStatus {
$UNKNOWN,
$REDACTED,
/**
* Status indicating that the task is queued for execution.
*/
QUEUED,
/**
* Status indicating that the task is currently being executed.
*/
RUNNING,
/**
* Status indicating that the task is marked for cancellation.
*/
CANCELING,
/**
* Status indicating that the task has been executed successfully.
*/
SUCCEEDED,
/**
* Status indicating that the task has failed.
*/
FAILED,
/**
* Status indicating that the task has been cancelled.
*/
CANCELED ;
private static final Map lookup = new LinkedHashMap();
static {
lookup.put("$UNKNOWN", $UNKNOWN);
lookup.put("$REDACTED", $REDACTED);
lookup.put("QUEUED", QUEUED);
lookup.put("RUNNING", RUNNING);
lookup.put("CANCELING", CANCELING);
lookup.put("SUCCEEDED", SUCCEEDED);
lookup.put("FAILED", FAILED);
lookup.put("CANCELED", CANCELED);
}
@JsonCreator
public static TaskStatus fromString(String enumTypeVar) {
return lookup.getOrDefault(enumTypeVar, TaskStatus.$UNKNOWN);
}
@JsonValue
public String fromEnum() {
for (Map.Entry entry : lookup.entrySet()) {
if (entry.getValue() == this) {
return entry.getKey();
}
}
return "$UNKNOWN";
}
}