com.lob.model.PostcardSize 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;
/**
* Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations.
*/
@JsonAdapter(PostcardSize.Adapter.class)
public enum PostcardSize {
_4X6("4x6"),
_6X9("6x9"),
_6X11("6x11");
private String value;
PostcardSize(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static PostcardSize fromValue(String value) {
for (PostcardSize b : PostcardSize.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 PostcardSize enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public PostcardSize read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return PostcardSize.fromValue(value);
}
}
}