com.lob.model.UploadState Maven / Gradle / Ivy
Show all versions of lob-java Show documentation
/*
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: [email protected]
*
* 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.lob.model;
import java.util.Objects;
import java.util.Arrays;
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;
/**
* The `state` property on the `upload` object. As the file is processed, the `state` will change from `Ready for Validation` to `Validating` and then will be either `Scheduled` (successfully processed) or `Errored` (Unsuccessfully processed).
*/
@JsonAdapter(UploadState.Adapter.class)
public enum UploadState {
PREPROCESSING("Preprocessing"),
DRAFT("Draft"),
READY_FOR_VALIDATION("Ready for Validation"),
VALIDATING("Validating"),
SCHEDULED("Scheduled"),
CANCELLED("Cancelled"),
ERRORED("Errored");
private String value;
UploadState(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static UploadState fromValue(String value) {
for (UploadState b : UploadState.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final UploadState enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public UploadState read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return UploadState.fromValue(value);
}
}
}