All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.onfido.model.ReportResult Maven / Gradle / Ivy

/*
 * Onfido API v3.6
 * The Onfido API (v3.6)
 *
 * The version of the OpenAPI document: v3.6
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.onfido.model;

import java.util.Objects;
import com.google.gson.annotations.SerializedName;

import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.JsonElement;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

/**
 * The result of the report. Read-only.
 */
@JsonAdapter(ReportResult.Adapter.class)
public enum ReportResult {
  
  CLEAR("clear"),
  
  CONSIDER("consider"),
  
  UNIDENTIFIED("unidentified"),
  
  UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

  private String value;

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

  public String getValue() {
    return value;
  }

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

  public static ReportResult fromValue(String value) {
    for (ReportResult b : ReportResult.values()) {
      if (b.value.equals(value)) {
        return b;
      }
    }
    return UNKNOWN_DEFAULT_OPEN_API;
  }

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

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

  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
    String value = jsonElement.getAsString();
    ReportResult.fromValue(value);
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy