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

com.lob.model.TrackingEventNormal 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 io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.time.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import java.util.HashMap; import java.util.Map; /** * TrackingEventNormal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TrackingEventNormal { /** * non-Certified postcards, self mailers, letters, and checks */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { NORMAL("normal"); 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; /** * non-Certified postcards, self mailers, letters, and checks * @return type **/ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "non-Certified postcards, self mailers, letters, and checks") public TypeEnum getType() { return type; } /** * Name of tracking event (for normal postcards, self mailers, letters, and checks): * `Mailed` - The mailpiece has been handed off to and accepted by USPS and is en route. <a href=\"https://help.lob.com/print-and-mail/getting-data-and-results/tracking-your-mail#mailed-tracking-events-4\" target=\"_blank\">More about Mailed.</a> Note this data is only available in Enterprise editions of Lob. <a href=\"https://lob.com/support/contact#contact\" target=\"_blank\">Contact Sales</a> if you want access to this feature. * `In Transit` - The mailpiece is being processed at the entry/origin facility. * `In Local Area` - The mailpiece is being processed at the destination facility. * `Processed for Delivery` - The mailpiece has been greenlit for delivery at the recipient's nearest postal facility. The mailpiece should reach the mailbox within 1 business day of this tracking event. * `Delivered` - The mail piece has been delivered to the recipients address. The final scan is generated when the mail carrier's GPS unit leaves the delivery area. * `Re-Routed` - The mailpiece is re-routed due to recipient change of address, address errors, or USPS relabeling of barcode/ID tag area. * `Returned to Sender` - The mailpiece is being returned to sender due to barcode, ID tag area, or address errors. * `International Exit` - The mail piece has been processed to ship to a destination abroad. This is typically the last scan a US-originated international mail piece will receive from the USPS. [More about tracking](https://support.lob.com/hc/en-us/articles/115000097404-Can-I-track-my-mail-) */ @JsonAdapter(NameEnum.Adapter.class) public enum NameEnum { MAILED("Mailed"), IN_TRANSIT("In Transit"), IN_LOCAL_AREA("In Local Area"), PROCESSED_FOR_DELIVERY("Processed for Delivery"), DELIVERED("Delivered"), RE_ROUTED("Re-Routed"), RETURNED_TO_SENDER("Returned to Sender"), INTERNATIONAL_EXIT("International Exit"); private String value; NameEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static NameEnum fromValue(String value) { for (NameEnum b : NameEnum.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 NameEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public NameEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return NameEnum.fromValue(value); } } } public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private NameEnum name; /** * Name of tracking event (for normal postcards, self mailers, letters, and checks): * `Mailed` - The mailpiece has been handed off to and accepted by USPS and is en route. More about Mailed. Note this data is only available in Enterprise editions of Lob. Contact Sales if you want access to this feature. * `In Transit` - The mailpiece is being processed at the entry/origin facility. * `In Local Area` - The mailpiece is being processed at the destination facility. * `Processed for Delivery` - The mailpiece has been greenlit for delivery at the recipient's nearest postal facility. The mailpiece should reach the mailbox within 1 business day of this tracking event. * `Delivered` - The mail piece has been delivered to the recipients address. The final scan is generated when the mail carrier's GPS unit leaves the delivery area. * `Re-Routed` - The mailpiece is re-routed due to recipient change of address, address errors, or USPS relabeling of barcode/ID tag area. * `Returned to Sender` - The mailpiece is being returned to sender due to barcode, ID tag area, or address errors. * `International Exit` - The mail piece has been processed to ship to a destination abroad. This is typically the last scan a US-originated international mail piece will receive from the USPS. [More about tracking](https://support.lob.com/hc/en-us/articles/115000097404-Can-I-track-my-mail-) * @return name **/ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "Name of tracking event (for normal postcards, self mailers, letters, and checks): * `Mailed` - The mailpiece has been handed off to and accepted by USPS and is en route. More about Mailed. Note this data is only available in Enterprise editions of Lob. Contact Sales if you want access to this feature. * `In Transit` - The mailpiece is being processed at the entry/origin facility. * `In Local Area` - The mailpiece is being processed at the destination facility. * `Processed for Delivery` - The mailpiece has been greenlit for delivery at the recipient's nearest postal facility. The mailpiece should reach the mailbox within 1 business day of this tracking event. * `Delivered` - The mail piece has been delivered to the recipients address. The final scan is generated when the mail carrier's GPS unit leaves the delivery area. * `Re-Routed` - The mailpiece is re-routed due to recipient change of address, address errors, or USPS relabeling of barcode/ID tag area. * `Returned to Sender` - The mailpiece is being returned to sender due to barcode, ID tag area, or address errors. * `International Exit` - The mail piece has been processed to ship to a destination abroad. This is typically the last scan a US-originated international mail piece will receive from the USPS. [More about tracking](https://support.lob.com/hc/en-us/articles/115000097404-Can-I-track-my-mail-) ") public NameEnum getName() { return name; } public static final String SERIALIZED_NAME_LOCATION = "location"; @SerializedName(SERIALIZED_NAME_LOCATION) private String location; /** * The zip code in which the scan event occurred. Null for `Mailed` events. * @return location **/ @javax.annotation.Nullable @ApiModelProperty(value = "The zip code in which the scan event occurred. Null for `Mailed` events. ") public String getLocation() { return location; } public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; /** * Unique identifier prefixed with `evnt_`. * @return id **/ @javax.annotation.Nullable public String getId() { return id; } public void setId (String id) throws IllegalArgumentException { if(!id.matches("^evnt_[a-zA-Z0-9]+$")) { throw new IllegalArgumentException("Invalid id provided"); } this.id = id; } public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) private OffsetDateTime time; /** * A timestamp in ISO 8601 format of the date USPS registered the event. * @return time **/ @javax.annotation.Nullable @ApiModelProperty(value = "A timestamp in ISO 8601 format of the date USPS registered the event.") public OffsetDateTime getTime() { return time; } public static final String SERIALIZED_NAME_DATE_CREATED = "date_created"; @SerializedName(SERIALIZED_NAME_DATE_CREATED) private OffsetDateTime dateCreated; /** * A timestamp in ISO 8601 format of the date the resource was created. * @return dateCreated **/ @javax.annotation.Nullable @ApiModelProperty(value = "A timestamp in ISO 8601 format of the date the resource was created.") public OffsetDateTime getDateCreated() { return dateCreated; } public static final String SERIALIZED_NAME_DATE_MODIFIED = "date_modified"; @SerializedName(SERIALIZED_NAME_DATE_MODIFIED) private OffsetDateTime dateModified; /** * A timestamp in ISO 8601 format of the date the resource was last modified. * @return dateModified **/ @javax.annotation.Nullable @ApiModelProperty(value = "A timestamp in ISO 8601 format of the date the resource was last modified.") public OffsetDateTime getDateModified() { return dateModified; } /** * Gets or Sets _object */ @JsonAdapter(ObjectEnum.Adapter.class) public enum ObjectEnum { TRACKING_EVENT("tracking_event"); private String value; ObjectEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ObjectEnum fromValue(String value) { for (ObjectEnum b : ObjectEnum.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 ObjectEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ObjectEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ObjectEnum.fromValue(value); } } } public static final String SERIALIZED_NAME_OBJECT = "object"; @SerializedName(SERIALIZED_NAME_OBJECT) private ObjectEnum _object = ObjectEnum.TRACKING_EVENT; /** * Get _object * @return _object **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public ObjectEnum getObject() { return _object; } /* public TrackingEventNormal type(TypeEnum type) { this.type = type; return this; } */ public void setType(TypeEnum type) { this.type = type; } /* public TrackingEventNormal name(NameEnum name) { this.name = name; return this; } */ public void setName(NameEnum name) { this.name = name; } /* public TrackingEventNormal details(DetailsEnum details) { this.details = details; return this; } */ /* public TrackingEventNormal location(String location) { this.location = location; return this; } */ public void setLocation(String location) { this.location = location; } /* public TrackingEventNormal id(String id) { this.id = id; return this; } */ /* public TrackingEventNormal time(OffsetDateTime time) { this.time = time; return this; } */ public void setTime(OffsetDateTime time) { this.time = time; } /* public TrackingEventNormal dateCreated(OffsetDateTime dateCreated) { this.dateCreated = dateCreated; return this; } */ public void setDateCreated(OffsetDateTime dateCreated) { this.dateCreated = dateCreated; } /* public TrackingEventNormal dateModified(OffsetDateTime dateModified) { this.dateModified = dateModified; return this; } */ public void setDateModified(OffsetDateTime dateModified) { this.dateModified = dateModified; } /* public TrackingEventNormal _object(ObjectEnum _object) { this._object = _object; return this; } */ public void setObject(ObjectEnum _object) { this._object = _object; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TrackingEventNormal trackingEventNormal = (TrackingEventNormal) o; return Objects.equals(this.type, trackingEventNormal.type) && Objects.equals(this.name, trackingEventNormal.name) && Objects.equals(this.location, trackingEventNormal.location) && Objects.equals(this.id, trackingEventNormal.id) && Objects.equals(this.time, trackingEventNormal.time) && Objects.equals(this.dateCreated, trackingEventNormal.dateCreated) && Objects.equals(this.dateModified, trackingEventNormal.dateModified) && Objects.equals(this._object, trackingEventNormal._object); } 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(type, name, location, id, time, dateCreated, dateModified, _object); } 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(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" location: ").append(toIndentedString(location)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); sb.append("}"); return sb.toString(); } public Map toMap() { Map localMap = new HashMap(); localMap.put("type", type); localMap.put("name", name); localMap.put("location", location); localMap.put("id", id); localMap.put("time", time); localMap.put("date_created", dateCreated); localMap.put("date_modified", dateModified); localMap.put("object", _object); 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