package com.hbc.api.fraud.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 java.util.Arrays; import org.joda.time.DateTime; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.2 * User agent: apibuilder app.apibuilder.io/hbc/api-fraud/0.0.2/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 * * Defines data expected to come in from OMS describing a transaction */ @JsonIgnoreProperties( ignoreUnknown = true ) public class Transaction { private final String orderId; private final String groupId; private final BigDecimal orderTotal; private final BigDecimal shippingCost; private final String currencyCode; private final Integer storeNumber; private final String salesRep; private final DateTime lastModifiedDate; private final Banner banner; private final CreditCard creditCard; private final Promo[] promos; private final Item[] items; private final String ipAddress; private final String source; private final Customer customer; private final AdditionalData additionalData; @JsonCreator public Transaction(@JsonProperty("orderId") String orderId, @JsonProperty("groupId") String groupId, @JsonProperty("orderTotal") BigDecimal orderTotal, @JsonProperty("shippingCost") BigDecimal shippingCost, @JsonProperty("currencyCode") String currencyCode, @JsonProperty("storeNumber") Integer storeNumber, @JsonProperty("salesRep") String salesRep, @JsonProperty("lastModifiedDate") DateTime lastModifiedDate, @JsonProperty("banner") Banner banner, @JsonProperty("creditCard") CreditCard creditCard, @JsonProperty("promos") Promo[] promos, @JsonProperty("items") Item[] items, @JsonProperty("ipAddress") String ipAddress, @JsonProperty("source") String source, @JsonProperty("customer") Customer customer, @JsonProperty("additionalData") AdditionalData additionalData) { this.orderId = orderId; this.groupId = groupId; this.orderTotal = orderTotal; this.shippingCost = shippingCost; this.currencyCode = currencyCode; this.storeNumber = storeNumber; this.salesRep = salesRep; this.lastModifiedDate = lastModifiedDate; this.banner = banner; this.creditCard = creditCard; this.promos = promos; this.items = items; this.ipAddress = ipAddress; this.source = source; this.customer = customer; this.additionalData = additionalData; } public String getOrderId() { return orderId; } public String getGroupId() { return groupId; } public BigDecimal getOrderTotal() { return orderTotal; } public BigDecimal getShippingCost() { return shippingCost; } public String getCurrencyCode() { return currencyCode; } public Integer getStoreNumber() { return storeNumber; } public String getSalesRep() { return salesRep; } public DateTime getLastModifiedDate() { return lastModifiedDate; } public Banner getBanner() { return banner; } public CreditCard getCreditCard() { return creditCard; } public Promo[] getPromos() { return promos; } public Item[] getItems() { return items; } public String getIpAddress() { return ipAddress; } /** * Order source (web, store, etc) */ public String getSource() { return source; } public Customer getCustomer() { return customer; } /** * Additional `envelope` data sent through our system to f-s, should include InAuthId */ public AdditionalData getAdditionalData() { return additionalData; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Transaction that = (Transaction) o; if (orderId != null ? !orderId.equals(that.orderId) : that.orderId != null) return false; if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null) return false; if (orderTotal != null ? !orderTotal.equals(that.orderTotal) : that.orderTotal != null) return false; if (shippingCost != null ? !shippingCost.equals(that.shippingCost) : that.shippingCost != null) return false; if (currencyCode != null ? !currencyCode.equals(that.currencyCode) : that.currencyCode != null) return false; if (storeNumber != null ? !storeNumber.equals(that.storeNumber) : that.storeNumber != null) return false; if (salesRep != null ? !salesRep.equals(that.salesRep) : that.salesRep != null) return false; if (lastModifiedDate != null ? !lastModifiedDate.equals(that.lastModifiedDate) : that.lastModifiedDate != null) return false; if (banner != null ? !banner.equals(that.banner) : that.banner != null) return false; if (creditCard != null ? !creditCard.equals(that.creditCard) : that.creditCard != null) return false; if (!Arrays.equals(promos, that.promos)) return false; if (!Arrays.equals(items, that.items)) return false; if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) return false; if (source != null ? !source.equals(that.source) : that.source != null) return false; if (customer != null ? !customer.equals(that.customer) : that.customer != null) return false; if (additionalData != null ? !additionalData.equals(that.additionalData) : that.additionalData != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (orderId != null ? orderId.hashCode() : 0); result = 31 * result + (groupId != null ? groupId.hashCode() : 0); result = 31 * result + (orderTotal != null ? orderTotal.hashCode() : 0); result = 31 * result + (shippingCost != null ? shippingCost.hashCode() : 0); result = 31 * result + (currencyCode != null ? currencyCode.hashCode() : 0); result = 31 * result + (storeNumber != null ? storeNumber.hashCode() : 0); result = 31 * result + (salesRep != null ? salesRep.hashCode() : 0); result = 31 * result + (lastModifiedDate != null ? lastModifiedDate.hashCode() : 0); result = 31 * result + (banner != null ? banner.hashCode() : 0); result = 31 * result + (creditCard != null ? creditCard.hashCode() : 0); result = 31 * result + (promos != null ? promos.hashCode() : 0); result = 31 * result + (items != null ? items.hashCode() : 0); result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0); result = 31 * result + (source != null ? source.hashCode() : 0); result = 31 * result + (customer != null ? customer.hashCode() : 0); result = 31 * result + (additionalData != null ? additionalData.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.hbc.api.fraud.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Transaction parseJson(String json) throws IOException { return com.hbc.api.fraud.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, Transaction.class); } }