/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package com.cloudera.api.swagger.model;

import java.util.Objects;
import java.util.Arrays;
import io.swagger.v3.oas.annotations.media.Schema;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

/**
 * The CDH version of the cluster.
 */
@JsonAdapter(ApiClusterVersion.Adapter.class)
public enum ApiClusterVersion {
  @SerializedName("CDH3")
  CDH3("CDH3"),
  @SerializedName("CDH3u4X")
  CDH3U4X("CDH3u4X"),
  @SerializedName("CDH4")
  CDH4("CDH4"),
  @SerializedName("CDH5")
  CDH5("CDH5"),
  @SerializedName("CDH6")
  CDH6("CDH6"),
  @SerializedName("CDH7")
  CDH7("CDH7"),
  @SerializedName("DATA_SERVICES1")
  DATA_SERVICES1("DATA_SERVICES1"),
  @SerializedName("DATA_SERVICES2")
  DATA_SERVICES2("DATA_SERVICES2"),
  @SerializedName("UNKNOWN")
  UNKNOWN("UNKNOWN");

  private String value;

  ApiClusterVersion(String value) {
    this.value = value;
  }

  public String getValue() {
    return value;
  }

  @Override
  public String toString() {
    return String.valueOf(value);
  }

  public static ApiClusterVersion fromValue(String input) {
    for (ApiClusterVersion b : ApiClusterVersion.values()) {
      if (b.value.equals(input)) {
        return b;
      }
    }
    return null;
  }

  public static class Adapter extends TypeAdapter<ApiClusterVersion> {
    @Override
    public void write(final JsonWriter jsonWriter, final ApiClusterVersion enumeration) throws IOException {
      jsonWriter.value(String.valueOf(enumeration.getValue()));
    }

    @Override
    public ApiClusterVersion read(final JsonReader jsonReader) throws IOException {
      Object value = jsonReader.nextString();
      return ApiClusterVersion.fromValue((String)(value));
    }
  }
}
