package bombas.storeback.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.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.2.6 * User agent: apibuilder app.apibuilder.io/bombas/storeback-api/0.2.6/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 Variant { private final Long id; private final Long productId; private final String sku; private final String title; private final Boolean isAvailable; private final Price price; private final Shipping shipping; private final String createdAt; private final String updatedAt; private final Size[] sizes; @JsonCreator public Variant(@JsonProperty("id") Long id, @JsonProperty("product_id") Long productId, @JsonProperty("sku") String sku, @JsonProperty("title") String title, @JsonProperty("is_available") Boolean isAvailable, @JsonProperty("price") Price price, @JsonProperty("shipping") Shipping shipping, @JsonProperty("created_at") String createdAt, @JsonProperty("updated_at") String updatedAt, @JsonProperty("sizes") Size[] sizes) { this.id = id; this.productId = productId; this.sku = sku; this.title = title; this.isAvailable = isAvailable; this.price = price; this.shipping = shipping; this.createdAt = createdAt; this.updatedAt = updatedAt; this.sizes = sizes; } /** * The unique numeric identifier for the product variant. */ public Long getId() { return id; } /** * The unique numeric identifier for the product. */ public Long getProductId() { return productId; } /** * A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService. */ public String getSku() { return sku; } /** * The title of the product variant. */ public String getTitle() { return title; } /** * If the variant is availabor not */ public Boolean getIsAvailable() { return isAvailable; } public Price getPrice() { return price; } public Shipping getShipping() { return shipping; } /** * The date and time (ISO 8601 format) when the product was created. */ public String getCreatedAt() { return createdAt; } /** * The date and time (ISO 8601 format) when the product was last modified. */ public String getUpdatedAt() { return updatedAt; } public Size[] getSizes() { return sizes; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Variant that = (Variant) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (productId != null ? !productId.equals(that.productId) : that.productId != null) return false; if (sku != null ? !sku.equals(that.sku) : that.sku != null) return false; if (title != null ? !title.equals(that.title) : that.title != null) return false; if (isAvailable != null ? !isAvailable.equals(that.isAvailable) : that.isAvailable != null) return false; if (price != null ? !price.equals(that.price) : that.price != null) return false; if (shipping != null ? !shipping.equals(that.shipping) : that.shipping != null) return false; if (createdAt != null ? !createdAt.equals(that.createdAt) : that.createdAt != null) return false; if (updatedAt != null ? !updatedAt.equals(that.updatedAt) : that.updatedAt != null) return false; if (!Arrays.equals(sizes, that.sizes)) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (productId != null ? productId.hashCode() : 0); result = 31 * result + (sku != null ? sku.hashCode() : 0); result = 31 * result + (title != null ? title.hashCode() : 0); result = 31 * result + (isAvailable != null ? isAvailable.hashCode() : 0); result = 31 * result + (price != null ? price.hashCode() : 0); result = 31 * result + (shipping != null ? shipping.hashCode() : 0); result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0); result = 31 * result + (updatedAt != null ? updatedAt.hashCode() : 0); result = 31 * result + (sizes != null ? sizes.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return bombas.storeback.api.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Variant parseJson(String json) throws IOException { return bombas.storeback.api.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, Variant.class); } }