Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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 com.lob.model.Campaign;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import java.util.HashMap;
import java.util.Map;
/**
* CampaignCreative
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CampaignCreative {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
/**
* Unique identifier prefixed with `crv_`.
* @return id
**/
@javax.annotation.Nullable
public String getId() { return id; }
public void setId (String id) throws IllegalArgumentException {
if(!id.matches("^crv_[a-zA-Z0-9]+$")) {
throw new IllegalArgumentException("Invalid id provided");
}
this.id = id;
}
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
/**
* An internal description that identifies this resource. Must be no longer than 255 characters.
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "An internal description that identifies this resource. Must be no longer than 255 characters. ")
public String getDescription() {
return description;
}
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public void setFrom(AddressEditable from) {
Gson gson = new Gson();
this.from = gson.toJson(from);
}
/**
* Mailpiece type for the creative
*/
@JsonAdapter(ResourceTypeEnum.Adapter.class)
public enum ResourceTypeEnum {
LETTER("letter"),
POSTCARD("postcard");
private String value;
ResourceTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ResourceTypeEnum fromValue(String value) {
for (ResourceTypeEnum b : ResourceTypeEnum.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 ResourceTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ResourceTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resource_type";
@SerializedName(SERIALIZED_NAME_RESOURCE_TYPE)
private ResourceTypeEnum resourceType;
/**
* Mailpiece type for the creative
* @return resourceType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Mailpiece type for the creative")
public ResourceTypeEnum getResourceType() {
return resourceType;
}
public static final String SERIALIZED_NAME_DETAILS = "details";
@SerializedName(SERIALIZED_NAME_DETAILS)
private String details;
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public void setDetails(PostcardDetailsWritable details) {
Gson gson = new Gson();
this.details = gson.toJson(details);
}
public void setDetails(LetterDetailsWritable details) {
Gson gson = new Gson();
this.details = gson.toJson(details);
}
public static final String SERIALIZED_NAME_METADATA = "metadata";
@SerializedName(SERIALIZED_NAME_METADATA)
private Map metadata = null;
public Map getMetadata() {
if (this.metadata == null) {
this.metadata = new HashMap();
}
return this.metadata;
}
public static final String SERIALIZED_NAME_TEMPLATE_PREVIEW_URLS = "template_preview_urls";
@SerializedName(SERIALIZED_NAME_TEMPLATE_PREVIEW_URLS)
private Object templatePreviewUrls;
/**
* Preview URLs associated with a creative's artwork asset(s) if the creative uses HTML templates as assets.
* @return templatePreviewUrls
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Preview URLs associated with a creative's artwork asset(s) if the creative uses HTML templates as assets.")
public Object getTemplatePreviewUrls() {
return templatePreviewUrls;
}
public static final String SERIALIZED_NAME_TEMPLATE_PREVIEWS = "template_previews";
@SerializedName(SERIALIZED_NAME_TEMPLATE_PREVIEWS)
private List