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.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; import java.util.Map; /** * 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_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 * */ @JsonIgnoreProperties( ignoreUnknown = true ) public class Product { private final String name; private final String product; private final Long id; private final String brand; private final String url; private final ProductContent content; private final String[] categories; private final Map imageUrls; private final Sku[] skus; @JsonCreator public Product(@JsonProperty("name") String name, @JsonProperty("product") String product, @JsonProperty("id") Long id, @JsonProperty("brand") String brand, @JsonProperty("url") String url, @JsonProperty("content") ProductContent content, @JsonProperty("categories") String[] categories, @JsonProperty("image_urls") Map imageUrls, @JsonProperty("skus") Sku[] skus) { this.name = name; this.product = product; this.id = id; this.brand = brand; this.url = url; this.content = content; this.categories = categories; this.imageUrls = imageUrls; this.skus = skus; } /** * Product name */ public String getName() { return name; } /** * URL to product object */ public String getProduct() { return product; } /** * Unique identifier for product */ public Long getId() { return id; } /** * Brand name */ public String getBrand() { return brand; } /** * Link to product detail page where item can be purchased */ public String getUrl() { return url; } public ProductContent getContent() { return content; } /** * A list of categories to which this product belongs. */ public String[] getCategories() { return categories; } /** * 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 Skus */ public Sku[] getSkus() { return skus; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Product that = (Product) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (product != null ? !product.equals(that.product) : that.product != null) return false; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (brand != null ? !brand.equals(that.brand) : that.brand != null) return false; if (url != null ? !url.equals(that.url) : that.url != null) return false; if (content != null ? !content.equals(that.content) : that.content != null) return false; if (!Arrays.equals(categories, that.categories)) return false; if (imageUrls != null ? !imageUrls.equals(that.imageUrls) : that.imageUrls != null) return false; if (!Arrays.equals(skus, that.skus)) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (product != null ? product.hashCode() : 0); result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (brand != null ? brand.hashCode() : 0); result = 31 * result + (url != null ? url.hashCode() : 0); result = 31 * result + (content != null ? content.hashCode() : 0); result = 31 * result + (categories != null ? categories.hashCode() : 0); result = 31 * result + (imageUrls != null ? imageUrls.hashCode() : 0); result = 31 * result + (skus != null ? skus.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.gilt.public_.api.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Product parseJson(String json) throws IOException { return com.gilt.public_.api.android.ApiBuilderObjectMapper.getInstance().readValue( json, Product.class); } }