com.lob.model.CardEditable 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 com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import java.util.HashMap;
import java.util.Map;
/**
* CardEditable
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CardEditable {
public static final String SERIALIZED_NAME_FRONT = "front";
@SerializedName(SERIALIZED_NAME_FRONT)
private String front;
/**
* A PDF template for the front of the card
* @return front
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "A PDF template for the front of the card")
public String getFront() {
return front;
}
public static final String SERIALIZED_NAME_BACK = "back";
@SerializedName(SERIALIZED_NAME_BACK)
private String back = "https://s3.us-west-2.amazonaws.com/public.lob.com/assets/card_blank_horizontal.pdf";
/**
* A PDF template for the back of the card
* @return back
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "A PDF template for the back of the card")
public String getBack() {
return back;
}
/**
* The size of the card
*/
@JsonAdapter(SizeEnum.Adapter.class)
public enum SizeEnum {
_3_375X2_125("3.375x2.125"),
_2_125X3_375("2.125x3.375");
private String value;
SizeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SizeEnum fromValue(String value) {
for (SizeEnum b : SizeEnum.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 SizeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SizeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SizeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private SizeEnum size = SizeEnum._2_125X3_375;
/**
* The size of the card
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The size of the card")
public SizeEnum getSize() {
return size;
}
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
/**
* Description of the card.
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Description of the card.")
public String getDescription() {
return description;
}
/*
public CardEditable front(String front) {
this.front = front;
return this;
}
*/
public void setFront(String front) {
this.front = front;
}
/*
public CardEditable back(String back) {
this.back = back;
return this;
}
*/
public void setBack(String back) {
this.back = back;
}
/*
public CardEditable size(SizeEnum size) {
this.size = size;
return this;
}
*/
public void setSize(SizeEnum size) {
this.size = size;
}
/*
public CardEditable description(String description) {
this.description = description;
return this;
}
*/
public void setDescription(String description) {
this.description = description;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CardEditable cardEditable = (CardEditable) o;
return Objects.equals(this.front, cardEditable.front) &&
Objects.equals(this.back, cardEditable.back) &&
Objects.equals(this.size, cardEditable.size) &&
Objects.equals(this.description, cardEditable.description);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(front, back, size, description);
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{\n");
sb.append(" front: ").append(toIndentedString(front)).append("\n");
sb.append(" back: ").append(toIndentedString(back)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append("}");
return sb.toString();
}
public Map toMap() {
Map localMap = new HashMap();
localMap.put("front", front);
localMap.put("back", back);
localMap.put("size", size);
localMap.put("description", description);
return localMap;
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}