package io.chio.core.common.v0.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.UUID; import org.joda.time.DateTime; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.0-beta.1 * User agent: apibuilder app.apibuilder.io/chio/core-common/0.0.0-beta.1/android_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson and retrofit2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * * A generic error providing a message and some basic meta data. */ @JsonIgnoreProperties( ignoreUnknown = true ) public class GenericError { private final UUID id; private final DateTime timestamp; private final String source; private final String type; private final String message; @JsonCreator public GenericError(@JsonProperty("id") UUID id, @JsonProperty("timestamp") DateTime timestamp, @JsonProperty("source") String source, @JsonProperty("type") String type, @JsonProperty("message") String message) { this.id = id; this.timestamp = timestamp; this.source = source; this.type = type; this.message = message; } /** * A guid for identifying the error e.g. in log files. */ public UUID getId() { return id; } /** * Timestamp of the when the error occurred. */ public DateTime getTimestamp() { return timestamp; } /** * An optional source on which the error occurred. */ public String getSource() { return source; } /** * An optional type for categorizing e.g. `validation` or `invalid_state`. */ public String getType() { return type; } /** * The actual message of the error. */ public String getMessage() { return message; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GenericError that = (GenericError) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false; if (source != null ? !source.equals(that.source) : that.source != null) return false; if (type != null ? !type.equals(that.type) : that.type != null) return false; if (message != null ? !message.equals(that.message) : that.message != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0); result = 31 * result + (source != null ? source.hashCode() : 0); result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (message != null ? message.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return io.chio.core.common.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static GenericError parseJson(String json) throws IOException { return io.chio.core.common.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, GenericError.class); } }