com.nutanix.dp1.pri.prism.v4.config.ResourceGroup 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;
/**
* An enum denoting the resource group. Resources can be organised into either entity or policy. Hence it supports
* two possible values:
* * ENTITY
* * POLICY
*
*/
public enum ResourceGroup {
$UNKNOWN,
$REDACTED,
/**
* A ResourceGroup denoting a nutanix entity like vm, cluster, host, image, etc.
*/
ENTITY,
/**
* A ResourceGroup denoting a nutanix policy like vm host affinity policy, image placement policy, access control policy, etc.
*/
POLICY ;
private static final Map lookup = new LinkedHashMap();
static {
lookup.put("$UNKNOWN", $UNKNOWN);
lookup.put("$REDACTED", $REDACTED);
lookup.put("ENTITY", ENTITY);
lookup.put("POLICY", POLICY);
}
@JsonCreator
public static ResourceGroup fromString(String enumTypeVar) {
return lookup.getOrDefault(enumTypeVar, ResourceGroup.$UNKNOWN);
}
@JsonValue
public String fromEnum() {
for (Map.Entry entry : lookup.entrySet()) {
if (entry.getValue() == this) {
return entry.getKey();
}
}
return "$UNKNOWN";
}
}