/**
* This code was auto-generated by a Codezu.
*
* Changes to this file may cause incorrect behavior and will be lost if
* the code is regenerated.
*/
package com.mozu.api.contracts.shippingruntime;
import java.util.List;
import java.util.HashMap;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.joda.time.DateTime;
import java.io.IOException;
import java.lang.ClassNotFoundException;
import com.mozu.api.contracts.shippingruntime.ProductSummary;
import com.mozu.api.contracts.shippingruntime.ItemMeasurements;
/**
* Properties of an item for which to calculate a shipping rate.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RateRequestItem implements Serializable
{
// Default Serial Version UID
private static final long serialVersionUID = 1L;
/**
* Unique identifier of an item used to calculate or request a shipping rate.
*/
protected String itemId;
public String getItemId() {
return this.itemId;
}
public void setItemId(String itemId) {
this.itemId = itemId;
}
/**
* The specified quantity of objects and items. This property is used for numerous object types including products, options, components within a product bundle, cart and order items, returned items, shipping line items, items in a digital product. and items associated with types and reservations.
*/
protected Integer quantity;
public Integer getQuantity() {
return this.quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
* If true, this item must ship separately from other items in a shipment.
*/
protected Boolean shipsByItself;
public Boolean getShipsByItself() {
return this.shipsByItself;
}
public void setShipsByItself(Boolean shipsByItself) {
this.shipsByItself = shipsByItself;
}
/**
* Data unique to the shipping rate for the item.
*/
protected transient com.fasterxml.jackson.databind.JsonNode data;
public com.fasterxml.jackson.databind.JsonNode getData() {
return this.data;
}
public void setData(com.fasterxml.jackson.databind.JsonNode data) {
this.data = data;
}
/**
* If Product Summaries are populated, this information will be utilized in Product Rules (e.g. ProductCode eq "ABC" or (Weight.Unit eq "lbs" and Weight.Value ge 50)
*/
protected List<ProductSummary> productSummaries;
public List<ProductSummary> getProductSummaries() {
return this.productSummaries;
}
public void setProductSummaries(List<ProductSummary> productSummaries) {
this.productSummaries = productSummaries;
}
/**
* Product specific dimensions used for shipping, used by product summary and rate request items. The dimensions can differ between the two uses as a `RateRequestItem `package may contain one or more products.
*/
protected ItemMeasurements unitMeasurements;
public ItemMeasurements getUnitMeasurements() {
return this.unitMeasurements;
}
public void setUnitMeasurements(ItemMeasurements unitMeasurements) {
this.unitMeasurements = unitMeasurements;
}
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
if(data == null){
out.writeBoolean(false);
} else {
out.writeBoolean(true);
new com.fasterxml.jackson.databind.ObjectMapper().configure(com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_TARGET, false).writeValue(out, data);
}
}
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
if(in.readBoolean()){
this.data = new com.fasterxml.jackson.databind.ObjectMapper().configure(com.fasterxml.jackson.core.JsonParser.Feature.AUTO_CLOSE_SOURCE, false).readValue(in, com.fasterxml.jackson.databind.JsonNode.class);
}
}
}