package com.github.sullis.email.markup.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.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.1-dev * User agent: apibuilder app.apibuilder.io/sullis/email-markup/0.0.1-dev/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 Order { private final Address billingAddress; private final Customer customer; private final BigDecimal discount; private final String discountCurrency; private final Boolean isGift; private final Merchant merchant; private final String orderNumber; private final String priceCurrency; private final PriceSpecification priceSpecification; private final BigDecimal price; private final Offer[] acceptedOffer; private final String url; private final String orderStatus; private final PaymentMethod paymentMethod; private final String paymentMethodId; private final DateTime orderDate; @JsonCreator public Order(@JsonProperty("billingAddress") Address billingAddress, @JsonProperty("customer") Customer customer, @JsonProperty("discount") BigDecimal discount, @JsonProperty("discountCurrency") String discountCurrency, @JsonProperty("isGift") Boolean isGift, @JsonProperty("merchant") Merchant merchant, @JsonProperty("orderNumber") String orderNumber, @JsonProperty("priceCurrency") String priceCurrency, @JsonProperty("priceSpecification") PriceSpecification priceSpecification, @JsonProperty("price") BigDecimal price, @JsonProperty("acceptedOffer") Offer[] acceptedOffer, @JsonProperty("url") String url, @JsonProperty("orderStatus") String orderStatus, @JsonProperty("paymentMethod") PaymentMethod paymentMethod, @JsonProperty("paymentMethodId") String paymentMethodId, @JsonProperty("orderDate") DateTime orderDate) { this.billingAddress = billingAddress; this.customer = customer; this.discount = discount; this.discountCurrency = discountCurrency; this.isGift = isGift; this.merchant = merchant; this.orderNumber = orderNumber; this.priceCurrency = priceCurrency; this.priceSpecification = priceSpecification; this.price = price; this.acceptedOffer = acceptedOffer; this.url = url; this.orderStatus = orderStatus; this.paymentMethod = paymentMethod; this.paymentMethodId = paymentMethodId; this.orderDate = orderDate; } public Address getBillingAddress() { return billingAddress; } public Customer getCustomer() { return customer; } public BigDecimal getDiscount() { return discount; } public String getDiscountCurrency() { return discountCurrency; } public Boolean getIsGift() { return isGift; } public Merchant getMerchant() { return merchant; } public String getOrderNumber() { return orderNumber; } public String getPriceCurrency() { return priceCurrency; } public PriceSpecification getPriceSpecification() { return priceSpecification; } public BigDecimal getPrice() { return price; } public Offer[] getAcceptedOffer() { return acceptedOffer; } public String getUrl() { return url; } public String getOrderStatus() { return orderStatus; } public PaymentMethod getPaymentMethod() { return paymentMethod; } public String getPaymentMethodId() { return paymentMethodId; } public DateTime getOrderDate() { return orderDate; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Order that = (Order) o; if (billingAddress != null ? !billingAddress.equals(that.billingAddress) : that.billingAddress != null) return false; if (customer != null ? !customer.equals(that.customer) : that.customer != null) return false; if (discount != null ? !discount.equals(that.discount) : that.discount != null) return false; if (discountCurrency != null ? !discountCurrency.equals(that.discountCurrency) : that.discountCurrency != null) return false; if (isGift != null ? !isGift.equals(that.isGift) : that.isGift != null) return false; if (merchant != null ? !merchant.equals(that.merchant) : that.merchant != null) return false; if (orderNumber != null ? !orderNumber.equals(that.orderNumber) : that.orderNumber != null) return false; if (priceCurrency != null ? !priceCurrency.equals(that.priceCurrency) : that.priceCurrency != null) return false; if (priceSpecification != null ? !priceSpecification.equals(that.priceSpecification) : that.priceSpecification != null) return false; if (price != null ? !price.equals(that.price) : that.price != null) return false; if (!Arrays.equals(acceptedOffer, that.acceptedOffer)) return false; if (url != null ? !url.equals(that.url) : that.url != null) return false; if (orderStatus != null ? !orderStatus.equals(that.orderStatus) : that.orderStatus != null) return false; if (paymentMethod != null ? !paymentMethod.equals(that.paymentMethod) : that.paymentMethod != null) return false; if (paymentMethodId != null ? !paymentMethodId.equals(that.paymentMethodId) : that.paymentMethodId != null) return false; if (orderDate != null ? !orderDate.equals(that.orderDate) : that.orderDate != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (billingAddress != null ? billingAddress.hashCode() : 0); result = 31 * result + (customer != null ? customer.hashCode() : 0); result = 31 * result + (discount != null ? discount.hashCode() : 0); result = 31 * result + (discountCurrency != null ? discountCurrency.hashCode() : 0); result = 31 * result + (isGift != null ? isGift.hashCode() : 0); result = 31 * result + (merchant != null ? merchant.hashCode() : 0); result = 31 * result + (orderNumber != null ? orderNumber.hashCode() : 0); result = 31 * result + (priceCurrency != null ? priceCurrency.hashCode() : 0); result = 31 * result + (priceSpecification != null ? priceSpecification.hashCode() : 0); result = 31 * result + (price != null ? price.hashCode() : 0); result = 31 * result + (acceptedOffer != null ? acceptedOffer.hashCode() : 0); result = 31 * result + (url != null ? url.hashCode() : 0); result = 31 * result + (orderStatus != null ? orderStatus.hashCode() : 0); result = 31 * result + (paymentMethod != null ? paymentMethod.hashCode() : 0); result = 31 * result + (paymentMethodId != null ? paymentMethodId.hashCode() : 0); result = 31 * result + (orderDate != null ? orderDate.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.github.sullis.email.markup.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Order parseJson(String json) throws IOException { return com.github.sullis.email.markup.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, Order.class); } }