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

com.lob.model.TemplateWritable Maven / Gradle / Ivy

The newest version!
/*
 * 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.EngineHtml; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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; /** * TemplateWritable */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateWritable { 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_HTML = "html"; @SerializedName(SERIALIZED_NAME_HTML) private String html; /** * An HTML string of less than 100,000 characters to be used as the `published_version` of this template. See [here](#section/HTML-Examples) for guidance on designing HTML templates. Please see endpoint specific documentation for any other product-specific HTML details: - [Postcards](https://docs.lob.com/#tag/Postcards/operation/postcard_create) - `front` and `back` - [Self Mailers](https://docs.lob.com/#tag/Self-Mailers/operation/self_mailer_create) - `inside` and `outside` - [Letters](https://docs.lob.com/#tag/Letters/operation/letter_create) - `file` - [Checks](https://docs.lob.com/#tag/Checks/operation/check_create) - `check_bottom` and `attachment` - [Cards](https://docs.lob.com/#tag/Cards/operation/card_create) - `front` and `back` If there is a syntax error with your variable names within your HTML, then an error will be thrown, e.g. using a `{{#users}}` opening tag without the corresponding closing tag `{{/users}}`. * @return html **/ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "An HTML string of less than 100,000 characters to be used as the `published_version` of this template. See [here](#section/HTML-Examples) for guidance on designing HTML templates. Please see endpoint specific documentation for any other product-specific HTML details: - [Postcards](https://docs.lob.com/#tag/Postcards/operation/postcard_create) - `front` and `back` - [Self Mailers](https://docs.lob.com/#tag/Self-Mailers/operation/self_mailer_create) - `inside` and `outside` - [Letters](https://docs.lob.com/#tag/Letters/operation/letter_create) - `file` - [Checks](https://docs.lob.com/#tag/Checks/operation/check_create) - `check_bottom` and `attachment` - [Cards](https://docs.lob.com/#tag/Cards/operation/card_create) - `front` and `back` If there is a syntax error with your variable names within your HTML, then an error will be thrown, e.g. using a `{{#users}}` opening tag without the corresponding closing tag `{{/users}}`. ") public String getHtml() { return html; } 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_ENGINE = "engine"; @SerializedName(SERIALIZED_NAME_ENGINE) private EngineHtml engine = EngineHtml.LEGACY; /** * Get engine * @return engine **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public EngineHtml getEngine() { return engine; } /* public TemplateWritable description(String description) { this.description = description; return this; } */ public void setDescription(String description) { this.description = description; } /* public TemplateWritable html(String html) { this.html = html; return this; } */ public void setHtml(String html) { this.html = html; } /* public TemplateWritable metadata(Map metadata) { this.metadata = metadata; return this; } */ public TemplateWritable putMetadataItem(String key, String metadataItem) { if (this.metadata == null) { this.metadata = new HashMap(); } this.metadata.put(key, metadataItem); return this; } public void setMetadata(Map metadata) { this.metadata = metadata; } /* public TemplateWritable engine(EngineHtml engine) { this.engine = engine; return this; } */ public void setEngine(EngineHtml engine) { this.engine = engine; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TemplateWritable templateWritable = (TemplateWritable) o; return Objects.equals(this.description, templateWritable.description) && Objects.equals(this.html, templateWritable.html) && Objects.equals(this.metadata, templateWritable.metadata) && Objects.equals(this.engine, templateWritable.engine); } 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(description, html, metadata, engine); } 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(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" html: ").append(toIndentedString(html)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" engine: ").append(toIndentedString(engine)).append("\n"); sb.append("}"); return sb.toString(); } public Map toMap() { Map localMap = new HashMap(); localMap.put("description", description); localMap.put("html", html); localMap.put("metadata", metadata); localMap.put("engine", engine); 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 "); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy