package com.shopr.api.clickouts.api.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.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.math.BigDecimal; import org.joda.time.DateTime; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/shopr/clickouts-api/0.0.1-dev/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 * * Represents an Offer click-out. It contains all the information needed to properly identify the offer, trace it ot the user navigating from search page, and relevant information about the offer at the click-out moment (e.g.: price, lowest price among other offers, etc.) */ @JsonIgnoreProperties( ignoreUnknown = true ) public class Clickout { private final String productId; private final String seller; private final String sellerProductId; private final BigDecimal price; private final String deepUrl; private final BigDecimal lowestPrice; private final BigDecimal highestPrice; private final Integer offerCount; private final Integer offerPosition; private final String categoryId; private final Tracking tracking; private final DateTime creationTime; @JsonCreator public Clickout(@JsonProperty("productId") String productId, @JsonProperty("seller") String seller, @JsonProperty("sellerProductId") String sellerProductId, @JsonProperty("price") BigDecimal price, @JsonProperty("deepUrl") String deepUrl, @JsonProperty("lowestPrice") BigDecimal lowestPrice, @JsonProperty("highestPrice") BigDecimal highestPrice, @JsonProperty("offerCount") Integer offerCount, @JsonProperty("offerPosition") Integer offerPosition, @JsonProperty("categoryId") String categoryId, @JsonProperty("tracking") Tracking tracking, @JsonProperty("creationTime") DateTime creationTime) { this.productId = productId; this.seller = seller; this.sellerProductId = sellerProductId; this.price = price; this.deepUrl = deepUrl; this.lowestPrice = lowestPrice; this.highestPrice = highestPrice; this.offerCount = offerCount; this.offerPosition = offerPosition; this.categoryId = categoryId; this.tracking = tracking; this.creationTime = creationTime; } /** * Product identifier */ public String getProductId() { return productId; } /** * Seller/Retailer unique identifier */ public String getSeller() { return seller; } /** * Product as identifier given by the seller/retailer */ public String getSellerProductId() { return sellerProductId; } /** * Offer price at the moment of the click-out */ public BigDecimal getPrice() { return price; } /** * Full product URL at the retailer side */ public String getDeepUrl() { return deepUrl; } /** * Lowest price among all offers */ public BigDecimal getLowestPrice() { return lowestPrice; } /** * Seller/Retailer unique identifier */ public BigDecimal getHighestPrice() { return highestPrice; } /** * Number of offers */ public Integer getOfferCount() { return offerCount; } /** * Offer position among other offers (e.g.: first, second, etc.) */ public Integer getOfferPosition() { return offerPosition; } /** * Category where the product was put into */ public String getCategoryId() { return categoryId; } /** * Tracking information */ public Tracking getTracking() { return tracking; } /** * When this click-out happened */ public DateTime getCreationTime() { return creationTime; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Clickout that = (Clickout) o; if (productId != null ? !productId.equals(that.productId) : that.productId != null) return false; if (seller != null ? !seller.equals(that.seller) : that.seller != null) return false; if (sellerProductId != null ? !sellerProductId.equals(that.sellerProductId) : that.sellerProductId != null) return false; if (price != null ? !price.equals(that.price) : that.price != null) return false; if (deepUrl != null ? !deepUrl.equals(that.deepUrl) : that.deepUrl != null) return false; if (lowestPrice != null ? !lowestPrice.equals(that.lowestPrice) : that.lowestPrice != null) return false; if (highestPrice != null ? !highestPrice.equals(that.highestPrice) : that.highestPrice != null) return false; if (offerCount != null ? !offerCount.equals(that.offerCount) : that.offerCount != null) return false; if (offerPosition != null ? !offerPosition.equals(that.offerPosition) : that.offerPosition != null) return false; if (categoryId != null ? !categoryId.equals(that.categoryId) : that.categoryId != null) return false; if (tracking != null ? !tracking.equals(that.tracking) : that.tracking != null) return false; if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (productId != null ? productId.hashCode() : 0); result = 31 * result + (seller != null ? seller.hashCode() : 0); result = 31 * result + (sellerProductId != null ? sellerProductId.hashCode() : 0); result = 31 * result + (price != null ? price.hashCode() : 0); result = 31 * result + (deepUrl != null ? deepUrl.hashCode() : 0); result = 31 * result + (lowestPrice != null ? lowestPrice.hashCode() : 0); result = 31 * result + (highestPrice != null ? highestPrice.hashCode() : 0); result = 31 * result + (offerCount != null ? offerCount.hashCode() : 0); result = 31 * result + (offerPosition != null ? offerPosition.hashCode() : 0); result = 31 * result + (categoryId != null ? categoryId.hashCode() : 0); result = 31 * result + (tracking != null ? tracking.hashCode() : 0); result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.shopr.api.clickouts.api.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Clickout parseJson(String json) throws IOException { return com.shopr.api.clickouts.api.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, Clickout.class); } }