/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v50</h1>       <p>Introduced in Cloudera Manager 7.8.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.8.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 io.swagger.annotations.ApiModel;
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;

/**
 * 
 */
@JsonAdapter(ApiActivityStatus.Adapter.class)
public enum ApiActivityStatus {
  
  UNKNOWN("UNKNOWN"),
  
  SUBMITTED("SUBMITTED"),
  
  STARTED("STARTED"),
  
  SUSPENDED("SUSPENDED"),
  
  FAILED("FAILED"),
  
  KILLED("KILLED"),
  
  SUCCEEDED("SUCCEEDED"),
  
  ASSUMED_SUCCEEDED("ASSUMED_SUCCEEDED");

  private String value;

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

  public String getValue() {
    return value;
  }

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

  public static ApiActivityStatus fromValue(String text) {
    for (ApiActivityStatus b : ApiActivityStatus.values()) {
      if (String.valueOf(b.value).equals(text)) {
        return b;
      }
    }
    return null;
  }

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

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

