package com.gilt.public_.api.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.Arrays; import java.util.Map; import org.joda.time.DateTime; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 1.0.1 * User agent: apibuilder app.apibuilder.io/gilt/gilt-public-api/1.0.1/android_rx2_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, retrofit2 and RxJava2 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 * */ @JsonIgnoreProperties( ignoreUnknown = true ) public class SaleDetail { private final String name; private final String sale; private final String saleKey; private final Store store; private final String description; private final String saleUrl; private final DateTime begins; private final DateTime ends; private final Map imageUrls; private final String[] products; @JsonCreator public SaleDetail(@JsonProperty("name") String name, @JsonProperty("sale") String sale, @JsonProperty("sale_key") String saleKey, @JsonProperty("store") Store store, @JsonProperty("description") String description, @JsonProperty("sale_url") String saleUrl, @JsonProperty("begins") DateTime begins, @JsonProperty("ends") DateTime ends, @JsonProperty("image_urls") Map imageUrls, @JsonProperty("products") String[] products) { this.name = name; this.sale = sale; this.saleKey = saleKey; this.store = store; this.description = description; this.saleUrl = saleUrl; this.begins = begins; this.ends = ends; this.imageUrls = imageUrls; this.products = products; } /** * Sale name */ public String getName() { return name; } /** * URL to single sale object */ public String getSale() { return sale; } /** * unique identifier for sale */ public String getSaleKey() { return saleKey; } /** * Store key */ public Store getStore() { return store; } /** * A description of the sale's theme or brand */ public String getDescription() { return description; } /** * Permalink to sale website */ public String getSaleUrl() { return saleUrl; } /** * ISO8601-formatted time for beginning of sale */ public DateTime getBegins() { return begins; } /** * ISO-8601-formatted time for end of sale */ public DateTime getEnds() { return ends; } /** * A map of key/value pairs with the key being the image resolution WIDTHxHEIGHT and the value being an array of image objects. */ public Map getImageUrls() { return imageUrls; } /** * List of URLs to individual product objects (not available if sale is upcoming or sold out) */ public String[] getProducts() { return products; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SaleDetail that = (SaleDetail) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (sale != null ? !sale.equals(that.sale) : that.sale != null) return false; if (saleKey != null ? !saleKey.equals(that.saleKey) : that.saleKey != null) return false; if (store != null ? !store.equals(that.store) : that.store != null) return false; if (description != null ? !description.equals(that.description) : that.description != null) return false; if (saleUrl != null ? !saleUrl.equals(that.saleUrl) : that.saleUrl != null) return false; if (begins != null ? !begins.equals(that.begins) : that.begins != null) return false; if (ends != null ? !ends.equals(that.ends) : that.ends != null) return false; if (imageUrls != null ? !imageUrls.equals(that.imageUrls) : that.imageUrls != null) return false; if (!Arrays.equals(products, that.products)) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (sale != null ? sale.hashCode() : 0); result = 31 * result + (saleKey != null ? saleKey.hashCode() : 0); result = 31 * result + (store != null ? store.hashCode() : 0); result = 31 * result + (description != null ? description.hashCode() : 0); result = 31 * result + (saleUrl != null ? saleUrl.hashCode() : 0); result = 31 * result + (begins != null ? begins.hashCode() : 0); result = 31 * result + (ends != null ? ends.hashCode() : 0); result = 31 * result + (imageUrls != null ? imageUrls.hashCode() : 0); result = 31 * result + (products != null ? products.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.gilt.public_.api.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static SaleDetail parseJson(String json) throws IOException { return com.gilt.public_.api.android.ApiBuilderObjectMapper.getInstance().readValue( json, SaleDetail.class); } }