com.lob.model.Export 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 java.time.OffsetDateTime;
import com.google.gson.Gson;
import java.util.HashMap;
import java.util.Map;
/**
* Export
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Export {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
/**
* Unique identifier prefixed with `ex_`.
* @return id
**/
@javax.annotation.Nonnull
public String getId() { return id; }
public void setId (String id) throws IllegalArgumentException {
if(!id.matches("^ex_[a-zA-Z0-9]+$")) {
throw new IllegalArgumentException("Invalid id provided");
}
this.id = id;
}
public static final String SERIALIZED_NAME_DATE_CREATED = "dateCreated";
@SerializedName(SERIALIZED_NAME_DATE_CREATED)
private OffsetDateTime dateCreated;
/**
* A timestamp in ISO 8601 format of the date the export was created
* @return dateCreated
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "A timestamp in ISO 8601 format of the date the export was created")
public OffsetDateTime getDateCreated() {
return dateCreated;
}
public static final String SERIALIZED_NAME_DATE_MODIFIED = "dateModified";
@SerializedName(SERIALIZED_NAME_DATE_MODIFIED)
private OffsetDateTime dateModified;
/**
* A timestamp in ISO 8601 format of the date the export was last modified
* @return dateModified
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "A timestamp in ISO 8601 format of the date the export was last modified")
public OffsetDateTime getDateModified() {
return dateModified;
}
public static final String SERIALIZED_NAME_DELETED = "deleted";
@SerializedName(SERIALIZED_NAME_DELETED)
private Boolean deleted;
/**
* Returns as `true` if the resource has been successfully deleted.
* @return deleted
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Returns as `true` if the resource has been successfully deleted.")
public Boolean getDeleted() {
return deleted;
}
public static final String SERIALIZED_NAME_S3_URL = "s3Url";
@SerializedName(SERIALIZED_NAME_S3_URL)
private String s3Url;
/**
* The URL for the generated export file.
* @return s3Url
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The URL for the generated export file.")
public String getS3Url() {
return s3Url;
}
/**
* The state of the export file, which can be `in_progress`, `failed` or `succeeded`.
*/
@JsonAdapter(StateEnum.Adapter.class)
public enum StateEnum {
IN_PROGRESS("in_progress"),
FAILED("failed"),
SUCCEEDED("succeeded");
private String value;
StateEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StateEnum fromValue(String value) {
for (StateEnum b : StateEnum.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 StateEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StateEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StateEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATE = "state";
@SerializedName(SERIALIZED_NAME_STATE)
private StateEnum state;
/**
* The state of the export file, which can be `in_progress`, `failed` or `succeeded`.
* @return state
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The state of the export file, which can be `in_progress`, `failed` or `succeeded`.")
public StateEnum getState() {
return state;
}
/**
* The export file type, which can be `all`, `failures` or `successes`.
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
ALL("all"),
FAILURES("failures"),
SUCCESSES("successes");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type;
/**
* The export file type, which can be `all`, `failures` or `successes`.
* @return type
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The export file type, which can be `all`, `failures` or `successes`.")
public TypeEnum getType() {
return type;
}
public static final String SERIALIZED_NAME_UPLOAD_ID = "uploadId";
@SerializedName(SERIALIZED_NAME_UPLOAD_ID)
private String uploadId;
/**
* Unique identifier prefixed with `upl_`.
* @return uploadId
**/
@javax.annotation.Nonnull
public String getUploadId() { return uploadId; }
public void setUploadId (String uploadId) throws IllegalArgumentException {
if(!uploadId.matches("^upl_[a-zA-Z0-9]+$")) {
throw new IllegalArgumentException("Invalid uploadId provided");
}
this.uploadId = uploadId;
}
/*
public Export id(String id) {
this.id = id;
return this;
}
*/
/*
public Export dateCreated(OffsetDateTime dateCreated) {
this.dateCreated = dateCreated;
return this;
}
*/
public void setDateCreated(OffsetDateTime dateCreated) {
this.dateCreated = dateCreated;
}
/*
public Export dateModified(OffsetDateTime dateModified) {
this.dateModified = dateModified;
return this;
}
*/
public void setDateModified(OffsetDateTime dateModified) {
this.dateModified = dateModified;
}
/*
public Export deleted(Boolean deleted) {
this.deleted = deleted;
return this;
}
*/
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
/*
public Export s3Url(String s3Url) {
this.s3Url = s3Url;
return this;
}
*/
public void setS3Url(String s3Url) {
this.s3Url = s3Url;
}
/*
public Export state(StateEnum state) {
this.state = state;
return this;
}
*/
public void setState(StateEnum state) {
this.state = state;
}
/*
public Export type(TypeEnum type) {
this.type = type;
return this;
}
*/
public void setType(TypeEnum type) {
this.type = type;
}
/*
public Export uploadId(String uploadId) {
this.uploadId = uploadId;
return this;
}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Export export = (Export) o;
return Objects.equals(this.id, export.id) &&
Objects.equals(this.dateCreated, export.dateCreated) &&
Objects.equals(this.dateModified, export.dateModified) &&
Objects.equals(this.deleted, export.deleted) &&
Objects.equals(this.s3Url, export.s3Url) &&
Objects.equals(this.state, export.state) &&
Objects.equals(this.type, export.type) &&
Objects.equals(this.uploadId, export.uploadId);
}
@Override
public int hashCode() {
return Objects.hash(id, dateCreated, dateModified, deleted, s3Url, state, type, uploadId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n");
sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n");
sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n");
sb.append(" s3Url: ").append(toIndentedString(s3Url)).append("\n");
sb.append(" state: ").append(toIndentedString(state)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" uploadId: ").append(toIndentedString(uploadId)).append("\n");
sb.append("}");
return sb.toString();
}
public Map toMap() {
Map localMap = new HashMap();
localMap.put("id", id);
localMap.put("dateCreated", dateCreated);
localMap.put("dateModified", dateModified);
localMap.put("deleted", deleted);
localMap.put("s3Url", s3Url);
localMap.put("state", state);
localMap.put("type", type);
localMap.put("uploadId", uploadId);
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 ");
}
}